Example #1
0
 $control = new Controls(Controls::Insert);
 //Chưa chọn loại sản phẩm;
 $Category = new Category(-1, "", new Brand(), new Device(), -1);
 if (isset($_POST["btnSave"])) {
     if (isset($_POST["txtControl"])) {
         $control->setValue($_POST["txtControl"]);
     }
     if (isset($_POST["txtCatProID"])) {
         $Category->setCatID($_POST["txtCatProID"]);
     }
     if (isset($_POST["txtCatName"])) {
         $Category->setCatName($_POST["txtCatName"]);
     }
     if (isset($_POST["cboDevice"])) {
         $oDevice = new Device($_POST["cboDevice"]);
         $Category->setDevice($oDevice);
     }
     if (isset($_POST["cboBrand"])) {
         $oBrand = new Brand($_POST["cboBrand"]);
         $Category->setBrand($oBrand);
     }
     if ($control == Controls::Insert) {
         $Category->insert();
         $insert = true;
     } else {
         if ($control == Controls::Update) {
             if (isset($_POST["chkStatus"])) {
                 $Category->setStatus($_POST["chkStatus"]);
             } else {
                 $Category->setStatus(0);
             }
Example #2
0
    //truyền số record cần hiển thịs
}
$offset = ($curPage - 1) * $rowsPerPage;
// tính offset bắt đầu load
//filter
$SortName = "";
$SortType = true;
$filterCategory = new Category(-1, "", new Brand(), new Device(), -1);
if (isset($_POST['CatProID']) & !empty($_POST['CatProID'])) {
    $filterCategory->setCatID($_POST['CatProID']);
}
if (isset($_POST['CatName']) & !empty($_POST['CatName'])) {
    $filterCategory->setCatName($_POST['CatName']);
}
if (isset($_POST['DeviceID']) & !empty($_POST['DeviceID'])) {
    $filterCategory->setDevice(new Device($_POST['DeviceID']));
}
if (isset($_POST['Status']) & !empty($_POST['Status'])) {
    $filterCategory->setStatus($_POST['Status']);
}
if (isset($_POST['SortName']) & !empty($_POST['SortName'])) {
    $SortName = $_POST['SortName'];
}
if (isset($_POST['SortType']) & !empty($_POST['SortType'])) {
    $SortType = $_POST['SortType'];
}
$numberOfRows = $filterCategory->countRecords();
// Số lượng dòng của bảng
$ListCategories = array();
if ($rowsPerPage == -1) {
    // nếu là chọn hiển thị là ALL
Example #3
0
    echo $ItemDev->getDeviceName();
    ?>
">
            <a class="cat-product-item" href="productsByCat.php?DeviceID=<?php 
    echo $ItemDev->getDeviceID();
    ?>
">
                <?php 
    echo $ItemDev->getDeviceName();
    ?>
            </a>

            <div class="list-group">
                <?php 
    $c = new Category();
    $c->setDevice($ItemDev);
    $ListCat = $c->loadLimit();
    foreach ($ListCat as $ItemCat) {
        ?>
                    <a href="productsByCat.php?CatID=<?php 
        echo $ItemCat->getCatID();
        ?>
" class="list-group-item">
                        <i class="fa fa-circle"></i><?php 
        echo $ItemCat->getCatName();
        ?>
                    </a>
                <?php 
    }
    ?>
            </div>
Example #4
0
    //truyền thứ tự trang cần xem
}
$offset = ($curPage - 1) * $rowsPerPage;
// tính offset bắt đầu load
if (isset($_GET["btnSearch"])) {
    $Product = new Product();
    $Product->setProName($_GET["txtProName"]);
    $Price = $_GET["txtPrice"];
    $Price = explode(',', $Price);
    $Product->setPrice($Price);
    require_once './entities/Category.php';
    require_once './entities/Brand.php';
    require_once './entities/Device.php';
    $CatPro = new Category();
    $CatPro->setBrand(new Brand($_GET["cboBra"]));
    $CatPro->setDevice(new Device($_GET["cboDevice"]));
    $Product->setCatPro($CatPro);
    $ListPro = $Product->loadLimit($rowsPerPage, $offset, "ProName");
    $numberOfRows = $Product->countRecords();
    $flag = true;
}
?>
    <div class="box clearfix">
        <ol class="breadcrumb box-top">
            <li><a href="index.php"><i class="fa fa-home"></i></a></li>
            <li class="active">Tìm Kiếm</li>
        </ol>
        <div id="searchBody">
            <form action="search.php" method="get">
                <div class="col-md-12 row">
                    <div class="form-group col-md-6">