<?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'; ?>
$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(); $chitiet->set_idphieunhap($id); $data_chitiet = $chitiet->listchitietphieunhap(); ?>