Пример #1
0
}
function fetchCategories($data)
{
    global $categories, $categoryTitle;
    //, $sourceCategoryTitle;
    if ($_GET['categoryId'] == $data['CAT_CO_CODIGO']) {
        $categoryTitle = NP_DDBB::decodeSQLValue($data['CAT_VA_NOMBRE'], "STRING_I18N");
    }
    // if (isset($_GET['sourceCategoryId']) && $_GET['sourceCategoryId'] == $data['CAT_CO_CODIGO'])
    //     $sourceCategoryTitle = $data['CAT_VA_NOMBRE'];
    array_push($categories, array($data['CAT_CO_CODIGO'], NP_DDBB::decodeSQLValue($data['CAT_VA_NOMBRE'], "STRING_I18N")));
}
if (isset($_GET['categoryId'])) {
    buildSQL($_GET['categoryId']);
} else {
    buildSQL();
}
$ddbb->executeSelectQuery($sqlProducts, "fetchProducts");
$ddbb->executeSelectQuery($sqlCategories, "fetchCategories");
if (count($itemIds) == 0) {
    /*
    if (isset($_GET['sourceCategoryId'])) {
        buildSQL($_GET['sourceCategoryId']);
        
        $tmp = $_GET['categoryId'];
        $_GET['categoryId'] = $_GET['sourceCategoryId'];
        $_GET['sourceCategoryId'] = $tmp;
        
        $tmp = $categoryTitle;
        $categoryTitle = $sourceCategoryTitle;
        $sourceCategoryTitle = $tmp;
Пример #2
0
<?php

define('APP_ROOT', "../");
require_once APP_ROOT . "/config/main.php";
require_once APP_ROOT . "/common/commonFunctions.php";
function buildSQL($type = null)
{
    global $ddbb, $npshop;
    $sql = "SELECT " . $ddbb->getMapping('Cart', 'orderId') . " FROM " . $ddbb->getTable('Cart');
    if (isset($type) && $type != "all") {
        $sql .= " WHERE " . $ddbb->getMapping('Cart', 'orderStatus') . "='" . $npshop['constants']["ORDER_STATUS"][$type] . "'";
    }
    $sql .= " ORDER BY " . $ddbb->getMapping('Cart', 'date') . " DESC";
    return $sql;
}
$orders = array();
function recoverOrders($data)
{
    global $orders;
    $cart = new Cart($data["PED_CO_CODIGO"]);
    array_push($orders, $cart);
}
if (!isset($_GET['type']) || $_GET['type'] == null) {
    $_GET['type'] = "all";
}
$sql = buildSQL($_GET['type']);
//NP_executeSelect($sql, 'recoverOrders');
$ddbb->executeSelectQuery($sql, 'recoverOrders');
showSkin("admin_" . basename(__FILE__));