Ejemplo n.º 1
0
<?php

ini_set("display_errors", 0);
require_once 'libraries/hanghoa.php';
$m = $_GET['idloai'];
$b = new HangHoa();
$b->set_idloai($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->listhanghoatheoloai($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>";
Ejemplo n.º 2
0
<?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";
}
Ejemplo n.º 3
0
<?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>";
Ejemplo n.º 4
0
require_once '../../libraries/oop.php';
require_once '../../libraries/hanghoa.php';
if (isset($_SESSION['cart'][$id])) {
    $qty = $_SESSION['cart'][$id] + 1;
} else {
    $qty = 1;
}
$_SESSION['cart'][$id] = $qty;
$ok = 1;
foreach ($_SESSION['cart'] as $k => $v) {
    if (isset($k)) {
        $ok = 2;
    }
}
if ($ok == 2) {
    $hang = new HangHoa();
    foreach ($_SESSION['cart'] as $key => $value) {
        $hang->set_idhang($key);
        $dataid[] = $hang->getHang();
    }
    foreach ($dataid as $data) {
        foreach ($data as $rowid) {
            $total += $_SESSION['cart'][$rowid['idHang']] * $rowid['Gia'];
        }
    }
    $items = $_SESSION['cart'];
    $_SESSION['thanhtien'] = number_format($total);
    $_SESSION['tongmathang'] = count($items);
    echo $_SESSION['tongmathang'] . " Mặt hàng <br />";
    echo "<span id='border_cart'></span>";
    echo "Tổng: <span id='price'>" . $_SESSION['thanhtien'] . " VND</span>";
Ejemplo n.º 5
0
          <td class="title1"width="150px">Tên Hàng</td>
          <td class="title1"width="40px">Đơn vị tính</td>
          <td class="title1"width="40px">Số Lượng</td> 
          <td class="title1"width="130px">Đơn Giá</td> 
          <td class="title1"width="130px">Thành Tiền</td>
                                      
        </tr>
        <?php 
$chitiet = new ChiTietDonHang();
$chitiet->set_idDonHang($id);
$data_chitiet = $chitiet->listChiTietDonhang();
if ($data_chitiet == 0) {
    echo "<tr>\r\n                            \t\t<td class='info1' colspan='8'> Không có chi tiết nào trong phiếu này</td>\r\n\t\t\t\t\t\t\t\t</tr>";
} else {
    $stt = 0;
    $hanghoa = new HangHoa();
    foreach ($data_chitiet as $item_chitiet) {
        $stt++;
        echo "<tr>\r\n\t\t\t\t\t\t\t\t\t\t<td class='info1' width='10px'>{$stt}</td>";
        $hanghoa->set_idhang($item_chitiet['idHang']);
        $data_hanghoa = $hanghoa->listhanghoa();
        echo "<td class='info1' width='70px'>" . $data_hanghoa[0][TenLoai] . "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='info1' width='70px'>" . $data_hanghoa[0][TenCongTy] . "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='info1' width='150px'>" . $data_hanghoa[0][TenHang] . "</td>\r\n\t\t\t\t\t\t\t\t\t\t<td class='info1' width='40px'>Cái</td>\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<td class='info1' width='40px'>{$item_chitiet['SoLuong']}</td>\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t<td align='center' width='130px'>                                \t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\t" . xulygia($data_hanghoa[0][Gia]) . "      \r\n\t\t\t\t\t\t\t\t\t\t</td> \r\n\t\t\t\t\t\t\t\t\t\t<td align='center' width='130px'>" . xulygia($data_hanghoa[0][Gia] * $item_chitiet[SoLuong]) . "\r\n\t\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t</tr>";
    }
}
?>
        <tr>
       	  <td class='info1'width="10px"></td>
          <td class='info1' colspan="3" width="290px" align="center">Cộng</td>         
          <td class='info1'width="40px" align="center">X</td>
          <td class='info1'width="40px" align="center">X</td>
          <td class='info1'width="130px" align="center">X</td>
Ejemplo n.º 6
0
    	<tr height="20px">
        	<td class=title width="50px">STT</td>
        	<td class=title width="100px">Tên Loại</td>
            <td class=title width="130px">Tên Công Ty</td>
            <td class=title width="170px">Tên Hàng Hóa</td>
        	<td class=title width="50px">Chi Tiết</td>
            <td class=title width="50px">Sửa</td>
        	<td class=title width="50px">Xóa</td>                                                
        </tr>
<?php 
//ini_set( "display_errors", 0);
require_once '../../../libraries/oop.php';
require_once '../../../libraries/congty.php';
require_once '../../../libraries/loaihang.php';
require_once '../../../libraries/hanghoa.php';
$hanghoa = new HangHoa();
$congty = new CongTy();
$loaihang = new LoaiHang();
$data_loaihang = $loaihang->listloaihang();
$data_congty = $congty->listcongty();
$data_hanghoa = $hanghoa->listhanghoa();
$stt = 0;
foreach ($data_hanghoa as $item_hanghoa) {
    $stt++;
    echo "<tr height='20px'>";
    echo "<td align=center width='100px'>{$stt}</td>";
    echo "<td align=center width='100px'><select id='loaihangct" . $stt . "'> ";
    foreach ($data_congty as $item_congty) {
        if ($item_hanghoa['idCongTy'] == $item_congty['idCongTy']) {
            foreach ($data_loaihang as $item_loaihang) {
                if ($item_loaihang['idLoaiHang'] == $item_congty['idLoaiHang']) {
Ejemplo n.º 7
0
<?php

require_once '../../../libraries/oop.php';
require_once '../../../libraries/hanghoa.php';
$idcongty = $_GET['idcongty'];
$tenhang = $_GET['tenhang'];
$gia = $_GET['gia'];
$a = new HangHoa();
$a->set_idcongty($idcongty);
$a->set_tenhang($tenhang);
$a->set_gia($gia);
$a->set_ngaycapnhat(time());
/*$sql="insert into hanghoa(idCongTy,TenHang,NgayCapNhat,Gia) values('".$a->get_idcongty()."', '".$a->get_tenhang()."', '".$a->get_ngaycapnhat()."', '".$a->get_gia()."')<br/>";
	$sql1="select * from hanghoa where TenHang='".$a->get_tenhang()."' and idCongTy='".$a->get_idcongty()."'";
	
	echo $sql;
	echo $sql1;*/
if ($a->insert_hanghoatruoc()) {
    echo '9';
} else {
    echo '0';
}
Ejemplo n.º 8
0
<?php

ini_set("display_errors", 0);
require_once '../../../libraries/oop.php';
require_once '../../../libraries/congty.php';
require_once '../../../libraries/loaihang.php';
require_once '../../../libraries/hanghoa.php';
require_once '../../../libraries/function.php';
$idhang = $_GET['idhang'];
$a = new HangHoa();
$a->set_idhang($idhang);
$data = $a->getdata();
$hinh = $data[UrlHinh];
$tenhang = $data[TenHang];
$mota = $data[MoTa];
$congty = new CongTy();
$congty->set_idcongty($data['idCongTy']);
$data_congty = $congty->getdata();
$loaihang = new LoaiHang();
$loaihang->set_idloai($data_congty['idLoaiHang']);
$data_loaihang = $loaihang->getdata();
$thumuc = locdau($data_loaihang[TenLoai]);
$duongdan = "../../../images/" . $thumuc . "/";
if (isset($_POST['ok'])) {
    if ($_FILES['img']['name'] != "" || $_POST['txtfull'] != "") {
        if ($_FILES['img']['name'] != "") {
            if (!is_dir($duongdan)) {
                mkdir($duongdan);
            }
            move_uploaded_file($_FILES['img']['tmp_name'], $duongdan . $_FILES['img']['name']);
            if ($hinh != "" || $hinh != "none") {
Ejemplo n.º 9
0
<?php

require_once '../../../libraries/oop.php';
require_once '../../../libraries/hanghoa.php';
$a = new HangHoa();
$id = $_GET['id'];
$a->set_idhang($id);
$a->delete_hanghoa();
echo '8';
?>
   
Ejemplo n.º 10
0
<?php 
ini_set("display_errors", 0);
require_once 'libraries/hanghoa.php';
$id = $_GET['id'];
$b = new HangHoa();
$b->set_idhang($id);
$data1 = $b->getHang();
?>
<style >
#chitiet
{
width:600px;
border: 1px solid #c6dbef;
margin:0px 0px 0px 20px;

}
#chitiet h1
{
    font-size: 15px;
    background: #f7f3f7;
    height: 25px;
    padding:5px;
    border-bottom: 1px solid #c6dbef;
    line-height: 25px;
    color:#ff0000;
}
#khung
{
    overflow: hidden;
    margin:15px 0px 0px 0px;
}
Ejemplo n.º 11
0
<?php

session_start();
require_once 'libraries/hanghoa.php';
//$cart=$_SESSION['cart'];
$idHang = $_GET['idHang'];
if ($idHang == 0) {
    unset($_SESSION['cart']);
    unset($_SESSION['tongmathang']);
    unset($_SESSION['thanhtien']);
} else {
    unset($_SESSION['cart'][$idHang]);
    $_SESSION['tongmathang']--;
    if ($_SESSION['tongmathang'] == 0) {
        unset($_SESSION['tongmathang']);
        unset($_SESSION['thanhtien']);
    }
    $a = new HangHoa();
    $data = $a->set_idHang($idHang);
    foreach ($data as $row) {
        $total = $_SESSION['thanhtien'] - $_SESSION['cart'][$row['idHang']] * $row['Gia'];
    }
    $_SESSION['thanhtien'] = number_format($total);
}
ob_clean();
header("location:index.php?module=giohang&act=xem");
exit;
Ejemplo n.º 12
0
<?php

ini_set("display_errors", 0);
require_once 'libraries/hanghoa.php';
$txttim = $_POST['txttim'];
$b = new HangHoa();
$b->set_tim($txttim);
$A = 6;
if (isset($_GET['page'])) {
    $C = $_GET['page'];
} else {
    $B = $b->demtim();
    $C = ceil($B / $A);
}
if (isset($_GET['start'])) {
    $X = $_GET['start'];
} else {
    $X = 0;
}
$data1 = $b->tim($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>";