Postingan lainnya
Kelas Premium!
Belajar bikin website dari nol sekarang
Gunakan kupon "lebihcepat" untuk diskon 25%!
Filter data dengan combobox
Saya bikin combobox untuk sortir data, tapi masih belum bisa di gunakan combonya padahal urlnya sudah sesuai, mohon bantuan nya teman2....
<form method='get'>
<?php
if($_SESSION['level']=="Top_Administrator"){
?>
<div class="col-xs-1" align='center'>
<label>Perumahan </label>
</div>
<div class="col-xs-2" align="center">
<select name='id_cabang' class="form-control">
<option value=''>Pilih Cabang Perusahaan</option>
<?php
include "config/koneksi.php";
$r=mysql_query("select * from cabang order by nama_perumahan");
while($w=mysql_fetch_array($r)){
if(@$_GET['id_cabang']=="$w[id_cabang]"){
$sel="selected";}else{$sel="";
}
echo"<option value='$w[id_cabang]' $sel>$w[nama_perumahan]</option>";
}
?>
<select>
</div>
<?php
}elseif($_SESSION['level']=="Admin"){
echo"<input type='hidden' name='id_cabang' value='$_SESSION[id_cabang]' >";
}
?>
<div class="col-xs-1" align='center'>
<label>Status </label>
</div>
<div class="col-xs-2" align="center">
<select name='id_status' class="form-control">
<option value=''>Semua</option>
<option value='1' <?php if(@$_GET['id_status']==1){echo "selected";}?>>Belum Akad</option>
<option value='2' <?php if(@$_GET['id_status']==2){echo "selected";}?>>Sudah Akad</option>
<select>
</div>
<!-- hidden variable page/halaman !-->
<input type='hidden' name='page' value='tabel'/>
<div class="col-xs-4">
<button type="submit" name="filter" value="filter" class='btn btn-danger glyphicon glyphicon-search'> Cari</button>
</div>
</form>
<br></br>
<!-- /.box-header -->
<div class="box-body" style="overflow:auto;">
<table id="example1" class="table table-bordered table-striped" >
<thead>
<tr>
<th>No</th>
<th>Booking Fee</th>
<th>Biaya Akad</th>
<th>AKAD</th>
<th>Status</th>
<th>PROMO</th>
<th>Keterangan</th>
</tr>
</thead>
<tbody>
<?php
if($_SESSION[level]=="Sales Leader" ){
if($_POST[id_cabang]!=""){
$where="where id_cabang='$_POST[id_cabang]' ";
}else{
$where="";
}else{
$where="where id_cabang='$_SESSION[id_cabang]'";
}
$q=mysql_query("select * from nomor n, wilayah w, cabang c where
n.kode_wilayah=w.kode_wilayah and
n.id_cabang=c.id_cabang and
w.id_cabang=c.id_cabang and
c.id_cabang='$_SESSION[id_cabang]' and w.statuss3='Open' order by n.id_nomor");
0
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban