<?php ini_set("display_errors", 0); require_once '../../../libraries/oop.php'; require_once '../../../libraries/phieunhap.php'; require_once '../../../libraries/chitietphieunhap.php'; $pn = new PhieuNhap(); $ct = new ChiTietPhieuNhap(); $id = $_GET['id']; $ct->set_idphieunhap($id); $ct->delete_allchitietinphieunhap(); $pn->set_idphieunhap($id); $pn->delete_phieunhap(); echo '14'; ?>
<?php $idphieu = $_GET['idphieu']; $ghichu = $_GET['ghichu']; require_once '../../../libraries/oop.php'; require_once '../../../libraries/phieunhap.php'; $a = new PhieuNhap(); $a->set_idphieunhap($idphieu); $a->set_ngaynhap(date("Y-m-d", time())); $a->set_tongtien(0); $a->set_ghichu($ghichu); $a->insert_phieunhap(); echo "15";
<?php require_once '../../../libraries/oop.php'; require_once '../../../libraries/phieunhap.php'; $a = new PhieuNhap(); $id = $_GET['id']; $ghichu = $_GET['ghichu']; $a->set_idphieunhap($id); $a->set_ghichu($ghichu); $a->update_phieunhap(); echo "13";
<tr height="20px"> <td class=title width="50px">STT</td> <td class=title width="100px">Mã Phiếu</td> <td class=title width="100px">Ngày Nhập</td> <td class=title width="100px">Tổng Tiền</td> <td class=title width="150px">Ghi Chú</td> <td class=title width="100px">Chi Tiết</td> <td class=title width="100px">Sửa</td> <td class=title width="100px">Xóa</td> </tr> <?php //ini_set( "display_errors", 0); require_once '../../../libraries/oop.php'; require_once '../../../libraries/phieunhap.php'; require_once '../../../libraries/function.php'; $phieunhap = new PhieuNhap(); $data_phieunhap = $phieunhap->listphieunhap(); $stt = 0; if ($data_phieunhap == 0) { echo "<tr><td colspan='8'> <div align='center'>Không có phiếu nhập</div> </td> </tr>"; } else { foreach ($data_phieunhap as $item_phieunhap) { $stt++; $ngaynhap = substr($item_phieunhap[NgayNhap], -2) . '-' . substr($item_phieunhap[NgayNhap], 5, 2) . '-' . substr($item_phieunhap[NgayNhap], 0, 4); echo "<tr height='20px'>"; echo "<td align=center width='50px'>{$stt}</td>"; echo "<td align=center width='100px'><input type='text' id='maphieu{$stt}' value='{$item_phieunhap['idPhieuNhap']}' size='25' disabled='disabled'/></td>"; echo "<td align=center width='100px'><input type='text' id='ngaynhap{$stt}' value='{$ngaynhap}' size='25' disabled='disabled'/></td>"; echo "<td align=center width='100px'><font style='font-weight:900; color:#FF0'>" . xulygia($item_phieunhap[TongTien]) . "</font></td>"; echo "<td align=center width='150px'><input type='text' id='ghichu{$stt}' value='{$item_phieunhap['GhiChu']}' size='30'/></td>"; ?>
echo "<script type='text/javascript'>\r\n \t\talert('Bạn chưa chọn hàng');\r\n\t\t</script> "; } else { if ($_POST['soluong'] != "") { $soluong = $_POST['soluong']; } else { $soluong = 0; } $chitiet = new ChiTietPhieuNhap(); $chitiet->set_idhang($idhang); $chitiet->set_idphieunhap($id); $chitiet->set_soluong($soluong); $chitiet->insert_chitietphieunhap(); } echo "<script type='text/javascript'>\r\n \t\tlocation.href='chitiet.php?id={$id}';\r\n\t\t</script> "; } $a = new PhieuNhap(); $a->set_idphieunhap($id); if (isset($_POST['xoa'])) { $a->delete_phieunhap(); dongcuaso(); exit; } $data = $a->getdata(); $ngaynhap = $data['NgayNhap']; $nam = substr($ngaynhap, 0, 4); $thang = substr($ngaynhap, 5, 2); $ngay = substr($ngaynhap, 8, 2); $ngaynhap = $ngay . '-' . $thang . '-' . $nam; $tongtien = $data['TongTien']; $ghichu = $data['GhiChu']; $chitiet = new ChiTietPhieuNhap();