Ejemplo n.º 1
0
<?php

// initialize
include_once '../../common/init.php';
if (!isLoggedInAdmin() && !isLoggedInOperator()) {
    redirect('');
} else {
    // include needed database functions
    include_once $BASE_PATH . 'database/products.php';
    $search = strip_tags($_POST['search']);
    if (isset($_POST['pagenr'])) {
        $pagenr = $_POST['pagenr'];
        if ($search) {
            $products = searchProductPageImage($search, $pagenr);
        } else {
            $products = getAllProductsPageImage($pagenr);
        }
        echo json_encode(array("numpages" => ceil($products[0]['count'] / $pagesize), "products" => $products));
    }
}
Ejemplo n.º 2
0
<?php

// initialize
include_once '../../../common/init.php';
if (!isLoggedInOperator()) {
    redirect("pages/operator/auth/login.php");
} else {
    include_once $BASE_PATH . 'database/products.php';
    $products = getAllProductsPageImage(0);
    $smarty->assign('products', $products);
    $smarty->assign('numpages', ceil($products[0]['count'] / $pagesize));
    $smarty->display("operator/sales/index.tpl");
}