Пример #1
0
    dongcuaso();
    exit;
}
$ngaydat = date('d');
$thangdat = date('m');
$namdat = date('Y');
$dat = "{$namdat}-{$thangdat}-{$ngaydat}";
/////// lay tong tien tu donhang ra
$iddh = $_GET['id'];
$a = new DonHang();
$a->set_idDonHang($iddh);
$data = $a->getdatatheogiatri("TongTien");
$a->update_tinhtrang();
//cap nhat tinh trang la da xuat cho don hang
//lay danh sach hanghoa trong chitietdonhang
$chitietdh = new ChiTietDonHang();
$chitietdh->set_idDonHang($iddh);
$datachitietdh = $chitietdh->listChiTietDonhang();
// lay cac bien
$bophan = $_POST['txtbophan'];
$so = $_POST['txtso'];
$no = $_POST['txtno'];
$co = $_POST['txtco'];
$hoten = $_POST['txthoten'];
$diachi = $_POST['txtdiachi'];
$sodienthoai = $_POST['txtsodienthoai'];
$lydoxuatkho = $_POST['txtlydoxuatkho'];
$xuattaikho = $_POST['txtxuattaikho'];
$tongtien = $data[0]['TongTien'];
/////chen chitietphieuxuatvao
$chitietpx = new ChiTietPhieuXuat();
Пример #2
0
<?php

require_once '../../../libraries/oop.php';
require_once '../../../libraries/chitietdonhang.php';
$a = new ChiTietDonHang();
$iddonhang = $_GET['iddonhang'];
$idhang = $_GET['idhang'];
$a->set_idDonHang($iddonhang);
$a->set_idHang($idhang);
$a->XoaChitietDonHang();
echo "{$iddonhang}";
Пример #3
0
<?php

require_once '../../../libraries/oop.php';
require_once '../../../libraries/chitietdonhang.php';
$a = new ChiTietDonHang();
$iddonhang = $_GET['iddonhang'];
$idhang = $_GET['idhang'];
$soluong = $_GET['soluong'];
$a->set_idDonHang($iddonhang);
$a->set_idHang($idhang);
$a->set_SoLuong($soluong);
if ($a->updateChiTiet()) {
    echo "{$iddonhang}";
} else {
    echo "0";
}
Пример #4
0
   	  <p>&nbsp;</p>   
              
      <table width="640px">
        <tr>
          <td class="title1" width="10px">STT</td>
          <td class="title1" width="70px">Loại Hàng</td>
          <td class="title1"width="70px">Công Ty </td>
          <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>";
    }
}
Пример #5
0
<?php

ini_set("display_errors", 0);
require_once '../../../libraries/oop.php';
require_once '../../../libraries/donhang.php';
require_once '../../../libraries/chitietdonhang.php';
$dh = new DonHang();
$ct = new ChiTietDonHang();
$id = $_GET['id'];
$ct->set_idDonHang($id);
$ct->Xoa_tatcaChitietDonHang();
$dh->set_idDonHang($id);
$dh->XoaDonHang();
echo '17';
?>
   
Пример #6
0
<script language="javascript" src="modules/user/calendar.js"></script>
<?php 
session_start();
require_once "libraries/donhang.php";
require_once "libraries/chitietdonhang.php";
require_once "modules/user/classes/tc_calendar.php";
if (isset($_SESSION['username'])) {
    if (isset($_POST['ok'])) {
        $idDonHang = time();
        $donhang = new DonHang();
        $chitietdonhang = new ChiTietDonHang();
        if ($_POST['txttennn'] == NULL) {
            $loi[] = "Xin nhập họ tên<br/>";
        } else {
            $tennn = $_POST['txttennn'];
        }
        if ($_POST['txtdt'] == NULL) {
            $loi[] = "Xin nhập số điện thoại<br/>";
        } else {
            $dt = $_POST['txtdt'];
        }
        if ($_POST['txtdc'] == NULL) {
            $loi[] = "Xin nhập địa chỉ<br/>";
        } else {
            $dc = $_POST['txtdc'];
        }
        if ($_POST['date1_day'] == 0) {
            $loi[] = "Chưa chọn ngày giao<br/>";
        } else {
            $ngaygiao = $_POST['date1_day'];
        }