PageRenderTime 25ms CodeModel.GetById 0ms RepoModel.GetById 0ms app.codeStats 0ms

/admin/hanghoa.php

http://webdienmay.googlecode.com/
PHP | 77 lines | 72 code | 5 blank | 0 comment | 2 complexity | ac6432869b0cab9bb244aa1f13db07f5 MD5 | raw file
  1. <?php
  2. ob_start();
  3. session_start();
  4. ob_clean();
  5. if(isset($_SESSION['username'])&&$_SESSION['level']==2)
  6. {
  7. require_once("../includes/config.php");
  8. ?>
  9. <link href="style.css" rel="stylesheet" name="text/css" />
  10. <center> <div class="tieude">Danh Sách Hŕng Hóa</div> <br />
  11. <font size="5"><a href=them_hanghoa.php>Thęm Hŕng Hóa </a>----
  12. <a href=index.php>Tr? V? Trang Qu?n Tr?</a></font>
  13. </center>
  14. <table width="900" align=center>
  15. <tr>
  16. <td width="50" align=center class=title>STT</td>
  17. <td width="100" align=center class=title>Lo?i Hŕng</td>
  18. <td width="100" align=center class=title>Công Ty</td>
  19. <td width="150" align=center class=title>M?t Hŕng</td>
  20. <td width="100" align=center class=title>??n Giá</td>
  21. <td width="100" align=center class=title>S? L??ng T?n</td>
  22. <td width="100" align=center class=title>Hěnh</td>
  23. <td width="100" align=center class=title>Ghi Chú</td>
  24. <td width="50" align=center class=title>S?a </td>
  25. <td width="50" align=center class=title>Xóa </td>
  26. </tr>
  27. <?php
  28. $sql="select * from hanghoa,loaihang,congty where hanghoa.idcongty= congty.idcongty and congty.idloaihang=loaihang.idloaihang order by tenloai ASC";
  29. $query=mysql_query($sql);
  30. if(mysql_num_rows($query)==0)
  31. {
  32. echo "<tr>";
  33. echo " <td colspan=11> Không có d? li?u</td>";
  34. echo "</tr>";
  35. }
  36. else
  37. {
  38. $i=1;
  39. while($row=mysql_fetch_assoc($query))
  40. {
  41. echo "<tr>";
  42. echo "<td align='center'>$i</td>";
  43. echo "<td align='center'>".$row['tenloai']."</td>";
  44. echo "<td align='center'>".$row['tencongty']."</td>";
  45. echo "<td align='center'>".$row['tenhang']."</td>";
  46. echo "<td align='center'>".$row['dongia']."</td>";
  47. echo "<td align='center'>".$row['soluongton']."</td>";
  48. echo "<td align='center'><a href='sua_hanghoa.php?id=".$row['idhanghoa']."'><img width='50' height='50' src='../images/".$row['urlhinh']."'/></a></td>";
  49. echo "<td align='center'>".$row['ghichu']."</td>";
  50. echo "<td align=center><a href=sua_hanghoa.php?id=".$row['idhanghoa'].">S?a</a></td>";
  51. echo "<td align=center><a href=xoa_hanghoa.php?id=".$row['idhanghoa'].">Xóa</a></td>";
  52. echo "</tr>";
  53. $i++;
  54. }
  55. echo "<tr><td colspan=2 class=goback>";
  56. echo "";
  57. echo "</td>";
  58. echo "<td colspan=2 class=goback>";
  59. echo "</td>";
  60. echo "</tr>";
  61. }
  62. ?>
  63. </table>
  64. <?php
  65. mysql_close($conn);
  66. }
  67. else
  68. {
  69. header("location:login.php");
  70. exit();
  71. }
  72. ?>