if (isset($_POST["txtProID"])) { $Product->setProID($_POST["txtProID"]); } if (isset($_POST["txtProName"])) { $Product->setProName($_POST["txtProName"]); } if (isset($_POST["txtImageURL_Old"])) { $Product->setImageURL($_POST["txtImageURL_Old"]); } if (isset($_POST["txtProPrice"])) { $fProPrice = str_replace(',', '', $_POST["txtProPrice"]); $Product->setPrice($fProPrice); } if (isset($_POST["txtProQuantity"])) { $fProQuantity = str_replace(',', '', $_POST["txtProQuantity"]); $Product->setInStock($fProQuantity); } if (isset($_POST["txtProCreated"])) { $dProCreate = strtotime(str_replace('/', '-', $_POST["txtProCreated"])); //d-m-Y $Product->setProCreated($dProCreate); } if (isset($_POST["cboCatPro"])) { $oCatPro = new Category($_POST["cboCatPro"]); $Product->setCatPro($oCatPro); } if (isset($_POST["txtTinyDes"])) { $Product->setTinyDes($_POST["txtTinyDes"]); } if (isset($_POST["txtFullDes"])) { $Product->setFullDes($_POST["txtFullDes"]);
// tính offset bắt đầu load //filter $SortName = ""; $SortType = "ASC"; $filterPro = new Product(); if (isset($_POST['ProID']) & !empty($_POST['ProID'])) { $filterPro->setProID($_POST['ProID']); } if (isset($_POST['ProName']) & !empty($_POST['ProName'])) { $filterPro->setProName($_POST['ProName']); } if (isset($_POST['Price']) & !empty($_POST['Price'])) { $filterPro->setPrice($_POST['Price']); } if (isset($_POST['InStock']) & !empty($_POST['InStock'])) { $filterPro->setInStock($_POST['InStock']); } if (isset($_POST['CatProID']) & !empty($_POST['CatProID'])) { $filterPro->setCatPro(new Category($_POST['CatProID'])); } if (isset($_POST['Status']) & !empty($_POST['Status'])) { $filterPro->setStatus($_POST['Status']); } if (isset($_POST['SortName']) & !empty($_POST['SortName'])) { $SortName = $_POST['SortName']; } if (isset($_POST['SortType']) & !empty($_POST['SortType'])) { $SortType = $_POST['SortType']; } $numberOfRows = $filterPro->countRecords(); // Số lượng dòng của bảng