Minggu, 13 Februari 2022

Select Auto Search

 


<input list="browsers" name="id" value="<?php echo "$nama_ibuhamil";?>" class="form-control" <?php echo $read;?>>

<datalist id="browsers">

 <?php  

  echo"<option value='$nama_ibuhamil' ";echo">$nama_ibuhamil </option>";
  $sql="select * from `$tbibuhamil` ";
$arr=getData($conn,$sql);
foreach($arr as $d) {
$id0=$d["id"];
$id_rm0=$d["id_rm"];
$nama_ibuhamil=$d["nama_ibuhamil"];
echo"<option value='$nama_ibuhamil' ";if($id0==$id){echo"selected";} echo">$nama_ibuhamil ($id_rm0)</option>";
}
?>

</datalist>  





Bonus DataTable

<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
<script src="https://cdn.datatables.net/1.11.3/js/jquery.dataTables.min.js"></script>

<script>
$(document).ready(function() {
    $('#examplec').DataTable();
} );
</script>

<link rel="stylesheet" href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css">


<table id="examplec" class="display" style="width:100%">
        <thead>
            <tr>
                <th>Name</th>
                <th>Position</th>
                <th>Office</th>
                <th>Age</th>
                <th>Start date</th>
                <th>Salary</th>
            </tr>
        </thead>
        <tbody>
            <tr>
                <td>Tiger Nixon</td>
                <td>System Architect</td>
                <td>Edinburgh</td>
                <td>61</td>
                <td>2011/04/25</td>
                <td>$320,800</td>
            </tr>
            <tr>
                <td>Garrett Winters</td>
                <td>Accountant</td>
                <td>Tokyo</td>
                <td>63</td>
                <td>2011/07/25</td>
                <td>$170,750</td>
            </tr>


 <tr>
                <td>Donna Snider</td>
                <td>Customer Support</td>
                <td>New York</td>
                <td>27</td>
                <td>2011/01/25</td>
                <td>$112,000</td>
            </tr>
        </tbody>
        <tfoot>
            <tr>
                <th>Name</th>
                <th>Position</th>
                <th>Office</th>
                <th>Age</th>
                <th>Start date</th>
                <th>Salary</th>
            </tr>
        </tfoot>
    </table>






Tidak ada komentar:

Posting Komentar

global_priv WARNING Selalu

 Jika muncul pesan kesalahan: Warning in .\libraries\classes\Dbal\DbiMysqli.php#209  mysqli::query(): (HY000/1034): Index for table 'glo...