Example #1
0
 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"]);
 }
 if ($control == Controls::Insert) {
     $Product->insert();
     addImageURL($Product);
     addListImages($Product);
     $insert = true;
 } else {
     if ($control == Controls::Update) {
         if (isset($_POST["chkStatus"])) {
Example #2
0
$numberOfRows = 0;
if (isset($_GET['page']) && !empty($_GET['page'])) {
    $curPage = $_GET['page'];
    //truyền thứ tự trang cần xem
}
$offset = ($curPage - 1) * $rowsPerPage;
// tính offset bắt đầu load
$p = new Product();
$c = new Category();
$device = new Device();
$bra = new Brand();
$flag = 0;
if (isset($_GET["CatID"]) && !empty($_GET["CatID"])) {
    $catID = $_GET["CatID"];
    $c = Category::getCat($catID);
    $p->setCatPro($c);
    $flag = 1;
}
if (isset($_GET["DeviceID"]) && !empty($_GET["DeviceID"])) {
    $devID = $_GET["DeviceID"];
    $c->setDevice(new Device($devID));
    require_once 'entities/Device.php';
    $device = Device::getDevice($devID);
    $p->setCatPro($c);
    $flag = 2;
}
if (isset($_GET["BraID"]) && !empty($_GET["BraID"])) {
    $braID = $_GET["BraID"];
    $c->setBrand(new Brand($braID));
    require_once 'entities/Brand.php';
    $bra = Brand::getBrand($braID);
Example #3
0
$ListPro_Cat = $p_Cat->loadLimit(6);
Product::printListProduct($ListPro_Cat);
?>
    </div>
    <!--/CUNG LOAI SAN PHAM-->

    <!--CUNG NHA SAN XUAT-->
    <div class="latest box clearfix">
        <div class="box-top">
            <p>Cùng nhà sản xuất</p>
        </div>
        <?php 
$p_Bra = new Product();
$c_Bra = new Category();
$c_Bra->setBrand($c->getBrand());
$p_Bra->setCatPro($c_Bra);
$ListPro_Bra = $p_Bra->loadLimit(6);
Product::printListProduct($ListPro_Bra);
?>
    </div>
    <!--/CUNG NHA SAN XUAT-->
    <script type="text/javascript">
        $(document).ready(function () {

            $('#product-detail button.btn-shopping-cart').on('click', function () {
                var proID = $(this).data('proid');
                $('#txtProID').val(proID);
                var orderQuantity = $('#txtOrderQuantity').val();
                $('#txtOrderQ').val(orderQuantity);
                $('#addToCart-form').submit();
            });
Example #4
0
$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
$ListProducts = array();
if ($rowsPerPage == -1) {
    // nếu là chọn hiển thị là ALL