</script> </head> <body> <form action="../Controlers/qlhanghoathuoctinh_ctrl.php" > <center> <table border="1"> <tr> <th style="width:300px;">Lọc theo</th> <th style="width:300px;">Giá trị</th> </tr> <tr> <td> Loại hàng hóa: <select name="select_loaihh" id="select_loaihh"> <?php $rs = getAllLoaiHH(); $idloaihh = @$_REQUEST['idloaihh']; if ($idloaihh == null) { $idloaihh = 1; } if (count($rs) > 0) { foreach ($rs as $r) { echo "<option value='" . $r['IDLoaiHH'] . "' "; if ($idloaihh != null) { if ($r['IDLoaiHH'] == $idloaihh) { echo "selected"; } } echo " > " . $r['TenLoaiHH'] . "</option>"; } }
</form> </center> </div> <!--Phần hiển thị dữ liệu--> <div style="float:left;"> <center> <h1> Dữ liệu trong bảng hiện tại </h1> </center> <table id="tbl1" style="width:500px; padding-left: 50px;"> <tr> <th>ID Loại hàng hóa </th> <th>Tên loại hàng hóa</th> <th>Mô tả </th> </tr> <?php $result = getAllLoaiHH(); if (count($result) > 0) { foreach ($result as $i) { echo "<tr>"; echo "<td>" . $i[Constants::$ID_LoaiHH_name] . "</td>"; echo "<td>" . $i['TenLoaiHH'] . "</td>"; echo "<td>" . $i['MoTa'] . "</td>"; echo "<td> <a href='?id=" . $i[Constants::$ID_LoaiHH_name] . "&ten=" . $i['TenLoaiHH'] . "&mota=" . $i['MoTa'] . "'>Sửa</a></td>"; echo "<td> <a href='" . Constants::$QL_LoaiHH_Ctrl_url . "?id=" . $i[Constants::$ID_LoaiHH_name] . "&act=del' onclick='return confirmDel()'>Xóa</a></td>"; echo "</tr>"; } } ?> </table> </div> <!-- tìm kiếm loại hàng hóa -->