Example #1
0
$Unit = new Unit();
$supplier = $Supplier->SetFieldsById($_SESSION['member']['id_user']);
$check_sum = $Supplier->GetCheckSumSupplierProducts($Supplier->fields['id_user']);
$tpl->Assign("check_sum", $check_sum);
$tpl->Assign("supplier", $Supplier->fields);
//*********************************Заполнение рабочих дней
if (isset($GLOBALS['Rewrite'])) {
    $cabinet_page = $GLOBALS['Rewrite'];
    $tpl->Assign('cabinet_page', $cabinet_page);
} else {
    header('Location: ' . _base_url . '/cabinet/assortment/');
}
if (isset($cabinet_page) && $cabinet_page == "productsonmoderation") {
    $header = "Товары на модерации";
    $GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => _base_url . '/cabinet/productsonmoderation/');
    $list = $Products->GetProductsOnModeration($_SESSION['member']['id_user']);
    $tpl->Assign('list', $list);
    $parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'products_on_moderation.tpl'));
} elseif (isset($cabinet_page) && $cabinet_page == "promo_orders") {
    $header = "Заказы с промо-кодом";
    $GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => _base_url . '/cabinet/promo_orders/');
    $orders = $Order->GetOrdersByPromoSupplier($_SESSION['member']['id_user']);
    $tpl->Assign('orders', $orders);
    $parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'promo_orders.tpl'));
} elseif (isset($cabinet_page) && $cabinet_page == "promo_codes") {
    $header = "Промо-коды";
    $GLOBALS['IERA_LINKS'][] = array('title' => $header, 'url' => _base_url . '/cabinet/promo_codes/');
    if (isset($_POST['submit'])) {
        if ($Supplier->AddPromoCode($_POST['percent'], $_POST['name'])) {
            header('Location: /cabinet/promo_codes/');
        }
Example #2
0
if (isset($_GET['limit']) && $_GET['limit'] != 'all' || !isset($_GET['limit'])) {
    if (isset($_POST['page_nbr']) && is_numeric($_POST['page_nbr'])) {
        $_GET['page_id'] = $_POST['page_nbr'];
    }
    $cnt = $Products->GetProductsCntSupCab($arr, $params);
    $tpl->Assign('cnt', $cnt);
    $GLOBALS['paginator_html'] = G::NeedfulPages($cnt);
    $limit = ' LIMIT ' . $GLOBALS['Start'] . ',' . $GLOBALS['Limit_db'];
} else {
    $GLOBALS['Limit_db'] = 0;
    $limit = '';
}
// ---------Информация о поставщике
$Supplier->fields['active_products_cnt'] = $Products->GetProductsCntSupCab(array('a.id_supplier' => $id_supplier, 'a.active' => 1, 'p.visible' => 1), ' AND a.product_limit > 0 AND (a.price_mopt_otpusk > 0 OR a.price_opt_otpusk > 0)');
$Supplier->fields['all_products_cnt'] = $Products->GetProductsCntSupCab($arr);
$Supplier->fields['moderation_products_cnt'] = count($Products->GetProductsOnModeration($id_supplier));
$check_sum = $Supplier->GetCheckSumSupplierProducts($id_supplier);
$tpl->Assign('check_sum', $check_sum);
$tpl->Assign('supplier', $Supplier->fields);
$Products->SetProductsList1($id_supplier, $order, $limit, $arr, $params);
$products = $Products->list;
if ($products) {
    foreach ($products as &$p) {
        $p['images'] = $Products->GetPhotoById($p['id_product']);
    }
}
$tpl->Assign('list', $products);
$parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_assortment.tpl'));
if ($parsed_res['issuccess'] === true) {
    $tpl_center .= $parsed_res['html'];
}
<?php

if (!_acl::isAllow('product_moderation')) {
    die("Access denied");
}
unset($parsed_res);
$dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db);
$Products = new Products();
$suppliers = new Suppliers();
$tpl->Assign('h1', 'Товары на модерации');
$ii = count($GLOBALS['IERA_LINKS']);
$GLOBALS['IERA_LINKS'][$ii]['title'] = "Товары на модерации";
$prods = $Products->GetProductsOnModeration();
$list = $suppl = array();
foreach ($prods as $prod) {
    if ($prod['moderation_status'] != 2) {
        $suppliers->SetFieldsById($prod['id_supplier']);
        $suppl[$prod['id_supplier']] = $suppliers->fields;
        $list[$prod['id_supplier']][] = $prod;
    }
}
// Формирование списка категорий для выпадающего списка
$category = $Products->generateCategory();
$tpl->Assign('category', $category);
$tpl->Assign('list', $list);
$tpl->Assign('suppliers', $suppl);
$tpl_center .= $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_moderation.tpl');