Example #1
0
include_once 'render_config.php';
session_start();
$admin = new Administrator();
$i = 0;
//$qty[] = null;
$wid = null;
$total = 0;
$numPerPage = 10;
if (isset($_REQUEST['page'])) {
    $page = $_REQUEST['page'];
} else {
    $page = 1;
}
$start_from = ($page - 1) * $numPerPage;
$admin = new Administrator();
$item = new Item();
//$admin = new User();
$all = $admin->getAllClothes();
$allbrands = $item->getBrands();
$totalNumRows = $item->countSkirts();
$total_clothes = $totalNumRows['skirt_id'];
$total_pages = ceil($totalNumRows / $numPerPage);
$ar = $all->fetch_all(MYSQLI_ASSOC);
$ab = $allbrands->fetch_all(MYSQLI_ASSOC);
$allData['skirts'] = $ar;
$allB['brands'] = $ab;
/** @var array $data */
echo $twig->render('admin.twig', ['skirts' => $ar, 'brands' => $ab, 'total_clothes' => $total_clothes, 'page' => $page, 'totalPages' => $total_pages]);
//print_r($_SESSION['cart']);
//unset($_SESSION['cart']);
//session_destroy();
 public function actionJGetBrands()
 {
     //echo(CJSON::encode(Item::getBrands()));
     echo self::__pack_response(Item::getBrands());
 }