/admin/hanghoa.php
PHP | 77 lines | 72 code | 5 blank | 0 comment | 2 complexity | ac6432869b0cab9bb244aa1f13db07f5 MD5 | raw file
- <?php
- ob_start();
- session_start();
- ob_clean();
- if(isset($_SESSION['username'])&&$_SESSION['level']==2)
- {
- require_once("../includes/config.php");
- ?>
- <link href="style.css" rel="stylesheet" name="text/css" />
- <center> <div class="tieude">Danh Sách Hŕng Hóa</div> <br />
- <font size="5"><a href=them_hanghoa.php>Thęm Hŕng Hóa </a>----
- <a href=index.php>Tr? V? Trang Qu?n Tr?</a></font>
- </center>
- <table width="900" align=center>
- <tr>
- <td width="50" align=center class=title>STT</td>
- <td width="100" align=center class=title>Lo?i Hŕng</td>
- <td width="100" align=center class=title>Công Ty</td>
- <td width="150" align=center class=title>M?t Hŕng</td>
- <td width="100" align=center class=title>??n Giá</td>
- <td width="100" align=center class=title>S? L??ng T?n</td>
- <td width="100" align=center class=title>Hěnh</td>
- <td width="100" align=center class=title>Ghi Chú</td>
- <td width="50" align=center class=title>S?a </td>
- <td width="50" align=center class=title>Xóa </td>
- </tr>
-
- <?php
-
- $sql="select * from hanghoa,loaihang,congty where hanghoa.idcongty= congty.idcongty and congty.idloaihang=loaihang.idloaihang order by tenloai ASC";
- $query=mysql_query($sql);
- if(mysql_num_rows($query)==0)
- {
- echo "<tr>";
- echo " <td colspan=11> Không có d? li?u</td>";
- echo "</tr>";
- }
- else
- {
- $i=1;
- while($row=mysql_fetch_assoc($query))
- {
- echo "<tr>";
- echo "<td align='center'>$i</td>";
- echo "<td align='center'>".$row['tenloai']."</td>";
- echo "<td align='center'>".$row['tencongty']."</td>";
- echo "<td align='center'>".$row['tenhang']."</td>";
- echo "<td align='center'>".$row['dongia']."</td>";
- echo "<td align='center'>".$row['soluongton']."</td>";
-
- echo "<td align='center'><a href='sua_hanghoa.php?id=".$row['idhanghoa']."'><img width='50' height='50' src='../images/".$row['urlhinh']."'/></a></td>";
- echo "<td align='center'>".$row['ghichu']."</td>";
- echo "<td align=center><a href=sua_hanghoa.php?id=".$row['idhanghoa'].">S?a</a></td>";
- echo "<td align=center><a href=xoa_hanghoa.php?id=".$row['idhanghoa'].">Xóa</a></td>";
- echo "</tr>";
- $i++;
- }
- echo "<tr><td colspan=2 class=goback>";
- echo "";
- echo "</td>";
- echo "<td colspan=2 class=goback>";
-
- echo "</td>";
- echo "</tr>";
-
- }
- ?>
- </table>
- <?php
- mysql_close($conn);
- }
- else
- {
- header("location:login.php");
- exit();
- }
- ?>