<?php ini_set("display_errors", 0); require_once 'libraries/hanghoa.php'; $m = $_GET['idcongty']; $b = new HangHoa(); $b->set_idcongty($m); $A = 9; if (isset($_GET['page'])) { $C = $_GET['page']; } else { $B = $b->dem1(); $C = ceil($B / $A); } if (isset($_GET['start'])) { $X = $_GET['start']; } else { $X = 0; } $data1 = $b->listhanghoatheocongty($X, $A); foreach ($data1 as $item1) { echo "<div class='prod_box'>"; echo "<div class='top_prod_box'></div>"; echo "<div class='center_prod_box'>"; echo "<div class='product_img'><a href='#' rel='addToCart' onclick='getdata({$item1['idHang']})' ><img border='0px' src={$item1['UrlHinh']} width='150' height='120'/></a></div>"; echo "<div class='product_title'>{$item1['TenHang']}</div>"; echo "<div class='product_title_price'>" . number_format($item1['Gia']) . "</div>"; echo "<a style='margin-right:10px;' href='#' rel='addToCart' onclick='getdata({$item1['idHang']})'><img src='images/icons/cart.gif'/></a>"; echo "<a href='index.php?module=hanghoa&act=chitiet&id={$item1['idHang']}' >ChiTiết</a>"; echo "</div>"; echo "</div>";
<?php require_once '../../../libraries/oop.php'; require_once '../../../libraries/hanghoa.php'; $a = new HangHoa(); $id = $_GET['id']; $congty = $_GET['congty']; $ten = $_GET['ten']; $gia = $_GET['gia']; $a->set_idhang($id); $a->set_idcongty($congty); $a->set_tenhang($ten); $a->set_gia($gia); if ($a->update_hanghoa()) { echo "7"; } else { echo "0"; }