<?php if (!_acl::isAllow('catalog')) { die("Access denied"); } $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); $specification = new Specification(); $user = new Users(); $specification->Setlist(); $tpl->Assign('spec_list', $specification->list); unset($parsed_res); if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) { $id_category = $GLOBALS['REQAR'][1]; } //else{ // if(isset($_GET['upload'])){ // $img_upload = array(); // $img_upload = array( // 'download_via_php' => true, // 'upload_dir' => $_SERVER['DOCUMENT_ROOT'].'/images/category_banner/', // 'upload_url' => $_SERVER['DOCUMENT_ROOT'].'/images/category_banner/', // 'user_dirs' => false, // 'param_name' => 'img', // 'accept_file_types' => '/\.(gif|jpe?g|jpg|png)$/i' // ); // if(isset($_GET['category_img_urls'])){ // $arr = $dbtree->Full(array('translit'), array('and' => array('id_category = '.$_POST['id_category']))); // $img_name = $arr[0]['translit']; // $_FILES['img']['name'] = $img_name; // $img_upload['upload_dir'] = $_SERVER['DOCUMENT_ROOT'].'/efiles/katalog/'; // $img_upload['upload_url'] = $_SERVER['DOCUMENT_ROOT'].'/efiles/katalog/';
ini_set("display_errors", 1); error_reporting(E_ALL); if (!_acl::isAllow('product')) { die("Access denied"); } unset($parsed_res); $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Каталог"; $GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/cat/'; if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) { $id_category = $GLOBALS['REQAR'][1]; } else { header('Location: ' . $GLOBALS['URL_base'] . '404/'); exit; } $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); $Products = new Products(); if (isset($_POST['smb']) && isset($_POST['ord'])) { $Products->Reorder($_POST); $tpl->Assign('msg', 'Сортировка выполнена успешно.'); } elseif (isset($_FILES["import_file"])) { // Импорт if ($_FILES["import_file"]["size"] > 1024 * 3 * 1024) { echo "Размер файла превышает три мегабайта"; exit; } // Проверяем загружен ли файл if (is_uploaded_file($_FILES["import_file"]["tmp_name"])) { set_time_limit(3600); //list($total_added, $total_updated) = $Products->ProcessProductsFile($_FILES["import_file"]["tmp_name"]); if (isset($_POST['smb_check'])) {
<? if ($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); $nav = new Products; //Достаем сегменты, которые попадают под тип сегментации if (isset($_POST['action'])) { switch ($_POST['action']) { case "segments": //Устанавливаем куку с типом сегмента setcookie("Segmentation", $_POST['type'], time() + 60 * 60 * 24 * 7); if($_POST['type'] == 1 || $_POST['type'] == 2) { $segments = $dbtree->Getsegments($_POST['type']); $segm = '<ul class="second_nav">'; foreach ($segments as &$v) { $segm .= '<li data-id="' . $v['id'] . '" onclick="segmentOpen(' . $v['id'] . ')"> <span class="link_wrapp"><a href="#">' . $v['name'] . '</a><span><i class="material-icons"></i></span></span> </li>'; } $segm .= '</ul>'; echo $segm; exit(); } else if ($_POST['type'] == 0){ $navigation = $dbtree->GetCategories(array('id_category', 'category_level', 'name', 'translit', 'pid'), 1); foreach($navigation as &$l1){ $level2 = $dbtree->GetSubCats($l1['id_category'], 'all'); foreach($level2 as &$l2){ $level3 = $dbtree->GetSubCats($l2['id_category'], 'all'); $l2['subcats'] = $level3; } $l1['subcats'] = $level2; }
<?php if (!_acl::isAllow('product')) { die("Access denied"); } unset($parsed_res); if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) { $id_product = $GLOBALS['REQAR'][1]; } else { header('Location: ' . $GLOBALS['URL_base'] . '404/'); exit; } $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); $Unit = new Unit(); $Products = new Products(); $News = new News(); $Images = new Images(); $specification = new Specification(); $segmentation = new Segmentation(); if ($News->GetCommentListById($id_product)) { $tpl->Assign('list_comment', $News->list); } $pops1 = $News->GetComent(); $tpl->Assign('pops1', $pops1); $tpl->Assign('related_prods_list', $Products->GetArrayRelatedProducts($id_product)); $specification->SetListByProdId($id_product); $tpl->Assign('product_specs', $specification->list); $specification->SetList(); $tpl->Assign('specs', $specification->list); $tpl->Assign('unitslist', $Unit->GetUnitsList()); $tpl->Assign('list_segment_types', $segmentation->GetSegmentationType());
<?php $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); // ---- center ---- unset($parsed_res); if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) { $id_category = $GLOBALS['REQAR'][1]; } else { header('Location: ' . $GLOBALS['URL_base'] . '404/'); exit; } $tpl->Assign('h1', 'Удаление категории'); $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Каталог"; $GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/cat/'; $GLOBALS['IERA_LINKS'][$ii]['title'] = "Удаление категории"; if (!$dbtree->DeleteAll($id_category)) { die('Ошибка при удалении категории.'); } $tpl->Assign('msg', 'Категория удалена.'); $parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_message.tpl')); if (TRUE == $parsed_res['issuccess']) { $tpl_center .= $parsed_res['html']; } // ---- right ----
public function navigation($idsegm) { $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $this->db); //Достаем категории 1-го уровня $navigation = $dbtree->GetCategories(array('id_category', 'category_level', 'name', 'translit', 'pid'), 1); //Перебираем категории 2-го и 3-го уровня, отсекая ненужные $needed = $dbtree->GetCatSegmentation($idsegm); foreach ($navigation as $key1 => &$l1) { $level2 = $dbtree->GetSubCats($l1['id_category'], 'all'); foreach ($level2 as $key2 => &$l2) { $level3 = $dbtree->GetSubCats($l2['id_category'], 'all'); foreach ($level3 as $key3 => &$l3) { if (!in_array($l3['id_category'], $needed)) { unset($level3[$key3]); } } if (in_array($l2['id_category'], $needed) || !empty($level3)) { $l2['subcats'] = $level3; } else { unset($level2[$key2]); } } if (in_array($l1['id_category'], $needed) || !empty($level2)) { $l1['subcats'] = $level2; } else { unset($navigation[$key1]); } } return $navigation; }
<?php // ---- center ---- unset($parsed_res); // -------------------------------------------------------------------------------------- /*if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])){ $item_id = $GLOBALS['REQAR'][1]; }else{ echo "Не указан id."; die(); }*/ $items = new Items(); $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); $db->Query("DROP TABLE `" . _DB_PREFIX_ . "category_seq`;"); $db->Query("TRUNCATE TABLE `" . _DB_PREFIX_ . "product`;"); $db->Query("TRUNCATE TABLE `" . _DB_PREFIX_ . "cat_prod`;"); $dbtree->Clear(array('visible' => '1', 'pid' => '0', 'name' => 'root', 'translit' => '')); //die(); print_r($dbtree->ERRORS); print_r($dbtree->ERRORS_MES); $tpl->Assign('msg', "catalog is empty"); $parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_message.tpl')); // -------------------------------------------------------------------------------------- if (TRUE == $parsed_res['issuccess']) { $tpl_center .= $parsed_res['html']; } // ---- right ---- // --------------------------------------------------------------------- function _iconv($txt) { return iconv("UTF-8", "windows-1251", $txt);
<?php if (!_acl::isAllow('catalog')) { die("Access denied"); } $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); unset($parsed_res); $header = 'Выгрузка товаров'; $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Каталог"; $GLOBALS['IERA_LINKS'][$ii++]['url'] = '/adm/cat/'; $GLOBALS['IERA_LINKS'][$ii]['title'] = $header; $tpl->Assign('h1', $header); $list = $dbtree->GetActiveCats(); $tpl->Assign('category_list', $list); $parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'unload_products.tpl')); if (true == $parsed_res['issuccess']) { $tpl_center .= $parsed_res['html']; }
<?php $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); $id_category = isset($GLOBALS['CURRENT_ID_CATEGORY']) ? $GLOBALS['CURRENT_ID_CATEGORY'] : 0; $dbtree->Ajar($id_category, array('id_category', 'category_level', 'name', 'translit'), array('and' => array('visible=1'))); $list = array(); while ($item = $dbtree->NextRow()) { $list[] = $item; } //print_r($list);die(); $tpl->Assign('list', $list); $parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'sb_navigation.tpl'));
<?php if (!_acl::isAllow('catalog') || $_SESSION['member']['gid'] == _ACL_REMOTE_CONTENT_) { die("Access denied"); } $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); unset($parsed_res); $header = 'Каталог'; $tpl->Assign('h1', $header); $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = $header; $GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/cat/'; $cat_arr = $dbtree->GetAllCats(array('id_category', 'category_level', 'name', 'translit', 'prom_id', 'pid', 'visible'), 1); if (!empty($cat_arr)) { foreach ($cat_arr as &$l1) { $level2 = $dbtree->GetAllSubCats($l1['id_category'], 'id_category', 'category_level', 'name', 'translit', 'prom_id', 'pid', 'visible'); foreach ($level2 as &$l2) { $level3 = $dbtree->GetAllSubCats($l2['id_category'], 'id_category', 'category_level', 'name', 'translit', 'prom_id', 'pid', 'visible'); foreach ($level3 as &$l3) { $level4 = $dbtree->GetAllSubCats($l3['id_category'], 'id_category', 'category_level', 'name', 'translit', 'prom_id', 'pid', 'visible'); $l3['subcats'] = $level4; } $l2['subcats'] = $level3; } $l1['subcats'] = $level2; } } $tpl->Assign('cat_arr', $cat_arr); $parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_cat.tpl')); if (TRUE == $parsed_res['issuccess']) { $tpl_center .= $parsed_res['html'];
<?php $Products = new Products(); $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); if (isset($_GET['savedprices']) == true) { $price_list = $Products->GetPricelistById($_GET['selected-array']); $i = 0; if ($_GET['photo'] == 4) { foreach ($price_list as $k => &$l) { if (!isset($name)) { $name = $l['price_name']; } $image = $Products->GetPhotoById($l['id_product']); $list1[] = array('id_product' => $l['id_product'], 'art' => $l['art'], 'img_1' => $l['img_1'], 'image' => $image[0]['src'], 'name' => $l['name'], 'note' => $l['note'], 'min_mopt_qty' => $l['min_mopt_qty'], 'inbox_qty' => $l['inbox_qty'], 'price_mopt' => $l['price_mopt'], 'price_opt' => $l['price_opt'], 'units' => $l['units'], 'opt_correction_set' => $l['opt_correction_set'], 'mopt_correction_set' => $l['mopt_correction_set']); } $list = $list1; } else { foreach ($price_list as $k => &$l) { if (!isset($name)) { $name = $l['price_name']; } $image = $Products->GetPhotoById($l['id_product']); $list1[$l['id_category']]['name'] = $l['cat_name']; $list1[$l['id_category']]['products'][] = array('id_product' => $l['id_product'], 'art' => $l['art'], 'img_1' => $l['img_1'], 'image' => $image[0]['src'], 'name' => $l['name'], 'note' => $l['note'], 'min_mopt_qty' => $l['min_mopt_qty'], 'inbox_qty' => $l['inbox_qty'], 'price_mopt' => $l['price_mopt'], 'price_opt' => $l['price_opt'], 'units' => $l['units'], 'opt_correction_set' => $l['opt_correction_set'], 'mopt_correction_set' => $l['mopt_correction_set']); $i++; } $fields = array('id_category', 'name', 'pid', 'category_level'); $var1 = $dbtree->GetCategories($fields, 1); foreach ($var1 as $v1) { $list[$v1['id_category']] = $v1; foreach ($dbtree->GetSubCats($v1['id_category'], $fields) as &$v2) {
<?php if (!_acl::isAllow('product')) { die('Access denied'); } // ---- center ---- unset($parsed_res); // -------------------------------------------------------------------------------------- $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); $Products = new Products(); $Unit = new Unit(); $Images = new Images(); $segmentation = new Segmentation(); if (isset($_GET['upload']) == true) { $res = $Images->upload($_FILES, $GLOBALS['PATH_product_img'] . 'original/' . date('Y') . '/' . date('m') . '/' . date('d') . '/'); echo str_replace($GLOBALS['PATH_global_root'], '/', $res); exit(0); } $tpl->Assign('h1', 'Добавление товара'); if (isset($_POST['smb'])) { if (isset($_POST['images_visible'])) { $_POST['images_visible'][0] = 1; } $_POST['art'] = $Products->CheckArticle((int) $_POST['art']); require_once $GLOBALS['PATH_block'] . 't_fnc.php'; // для ф-ции проверки формы if (isset($_POST['price']) && $_POST['price'] == '') { $_POST['price'] = 0; } list($err, $errm) = Product_form_validate(); if (!$err) {
$product['videos'] = $Products->GetVideoById($id_product); $GLOBALS['prod_title'] = $product['name']; $GLOBALS['product_canonical'] = Link::Product($product['translit']); /* product comments ======================================== */ $res = $Products->GetComentByProductId($id_product); $tpl->Assign('comment', $res); /* product comments ======================================== */ /* product rating ========================================== */ // $rating = $Products->GetProductRating($id_product); // $tpl->Assign('rating', $rating); /* product rating ========================================== */ $tpl->Assign('data', $Page->fields); $tpl->Assign('indexation', $product['indexation']); $tpl->Assign('item', $product); $tpl->Assign('header', $product['name']); $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); // если в ссылке не была указана категория, то выбирается первая из соответствий категория-продукт //if(!isset($id_category)) $id_category = $product['id_category']; $id_category = $Products->GetCatBreadCrumbs($id_product); $res = $dbtree->Parents($id_category, array('id_category', 'name', 'category_level', 'translit')); foreach ($res as $cat) { if ($cat['category_level'] > 0) { $GLOBALS['IERA_LINKS'][] = array('title' => $cat['name'], 'url' => Link::Category($cat['translit'])); } } // если отправили комментарий if (isset($_POST['sub_com'])) { $text = nl2br($_POST['feedback_text'], false); $text = stripslashes($text); $rating = isset($_POST['rating']) ? $_POST['rating'] : 0; $pid_comment = isset($_POST['pid_comment']) ? $_POST['pid_comment'] : false;
<?php $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); if ($GLOBALS['CurrentController'] == 'products') { $current_category = $dbtree->CheckParent($GLOBALS['Rewrite'], array('id_category')); if (!$current_category || empty($current_category)) { header('Location: /404/'); exit; } $GLOBALS['CURRENT_ID_CATEGORY'] = $id_category = $current_category['id_category']; $subcats = $dbtree->GetSubCats($id_category, array('id_category', 'category_level', 'name', 'translit', 'pid', 'visible')); foreach ($subcats as &$s) { $s['subcats'] = count($dbtree->GetSubCats($s['id_category'], 'all')); } $tpl->Assign('subcats', $subcats); $GLOBALS['current_categories'] = GetParents((int) $id_category); $GLOBALS['GLOBAL_CURRENT_ID_CATEGORY'] = isset($GLOBALS['current_categories']) && is_array($GLOBALS['current_categories']) ? end($GLOBALS['current_categories']) : 0; } // print_r(G::getmicrotime() - $s_time);die(); $navigation = $dbtree->GetCategories(array('id_category', 'category_level', 'name', 'translit', 'category_img', 'pid'), 1); foreach ($navigation as &$l1) { $level2 = $dbtree->GetSubCats($l1['id_category'], 'all'); foreach ($level2 as &$l2) { $level3 = $dbtree->GetSubCats($l2['id_category'], 'all'); $l2['subcats'] = $level3; } $l1['subcats'] = $level2; } $tpl->Assign('navigation', $navigation); unset($current_category, $subcats, $level2, $level3, $id, $res, $id_category); function GetSubCategories($id_category)
} else { $manufacturer_id = $Manufacturers->fields['manufacturer_id']; } if (isset($GLOBALS['REQAR'][2]) && is_numeric($GLOBALS['REQAR'][2])) { $cat_id = $GLOBALS['REQAR'][2]; } } else { header('Location: ' . _base_url . '/404/'); exit; } $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Производители"; $GLOBALS['IERA_LINKS'][$ii++]['url'] = _base_url . '/manufacturers/'; $GLOBALS['IERA_LINKS'][$ii]['title'] = $Manufacturers->fields['name']; $GLOBALS['IERA_LINKS'][$ii++]['url'] = _base_url . '/manufacturer/' . $Manufacturers->fields['translit'] . '/'; $dbtree = new dbtree('im_cat', 'cat', $db); $items = new Items(); // Список категорий производителя $items->SetCatListMan($manufacturer_id); $subcats = array(); $branch = 0; foreach ($items->list as $l) { $dbtree->Parents($l['cat_id'], array('cat_id', 'name', 'translit', 'cat_level')); if (!empty($dbtree->ERRORS_MES)) { die("Error parents"); } $jj = 0; while ($cat = $dbtree->NextRow()) { if (0 != $cat['cat_level']) { $fl = true; if ($branch) {
<?php if (!_acl::isAllow('catalog')) { die("Access denied"); } $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); // ---- center ---- unset($parsed_res); // -------------------------------------------------------------------------------------- $tpl->Assign('h1', 'Добавление категории'); $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Каталог"; $GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/cat/'; $GLOBALS['IERA_LINKS'][$ii]['title'] = "Добавление категории"; if (isset($_POST['smb'])) { require_once $GLOBALS['PATH_block'] . 't_fnc.php'; // для ф-ции проверки формы list($err, $errm) = Cat_form_validate(); if (!$err) { $arr = array(); $arr['name'] = mysql_real_escape_string(trim($_POST['name'])); $arr['content'] = mysql_real_escape_string(trim($_POST['content'])); $arr['translit'] = G::StrToTrans($_POST['name']); $arr['pid'] = mysql_real_escape_string(trim($_POST['pid'])); $arr['visible'] = 1; if (isset($_POST['visible']) && $_POST['visible'] == "on") { $arr['visible'] = 0; } if ($id = $dbtree->Insert($arr['pid'], $arr)) { $tpl->Assign('msg', 'Категория добавлена.'); unset($_POST);
<?php // ---- center ---- unset($parsed_res); $Page = new Page(); $Page->PagesList(); $tpl->Assign('list_menu', $Page->list); $items = new Items(); $dbtree = new dbtree('im_cat', 'cat', $db); $Manufacturers = new Manufacturers(); $dbtree->Full(array('cat_id', 'cat_level', 'name', 'translit'), array('and' => array('visible=1'))); while ($item = $dbtree->NextRow()) { $list[] = $item; } $tpl->Assign('cat_list', $list); $tpl->Assign('pages_list', $Page->list); $Manufacturers->ManufacturersList(); $tpl->Assign('mans_list', $Manufacturers->list); $GLOBALS['SITEMAP_URLS'][] = _base_url; $parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_sitemap.tpl')); $items->SetItemsList(array('visible' => 1)); $tpl->Assign('items_list', $items->list); foreach ($items->list as $li) { $GLOBALS['SITEMAP_URLS'][] = _base_url . '/item/' . $li['item_id'] . '/' . $li['translit'] . '/'; } $GLOBALS['SITEMAP_URLS'][] = _base_url . '/search/'; $GLOBALS['SITEMAP_URLS'][] = _base_url . '/sitemap.xml'; $sitemap = '<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; $first = true;
<?php unset($parsed_res); $Page = new Page(); $Page->PagesList(); $tpl->Assign('list_menu', $Page->list); $GLOBALS['IERA_LINKS'] = array(); $GLOBALS['IERA_LINKS'][0]['title'] = "Каталог"; $GLOBALS['IERA_LINKS'][0]['url'] = _base_url . '/cat/'; $GLOBALS['IERA_LINKS'] = array(); $GLOBALS['IERA_LINKS'][1]['title'] = "Карта каталога xt.ua"; $GLOBALS['IERA_LINKS'][1]['url'] = _base_url . '/cat/'; $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); unset($parsed_res); $list = $dbtree->Full(array('id_category', 'category_level', 'name', 'translit', 'pid', 'visible'), array('and' => array('visible=1'))); $tpl->Assign('list', $list); $parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_cat.tpl')); if (TRUE == $parsed_res['issuccess']) { $tpl_center .= $parsed_res['html']; }
<?php $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); // ---- center ---- unset($parsed_res); if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) { $id_category = $GLOBALS['REQAR'][1]; } else { header('Location: ' . $GLOBALS['URL_base'] . '404/'); exit; } $tpl->Assign('h1', 'Удаление категории'); $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Каталог"; $GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/cat/'; $GLOBALS['IERA_LINKS'][$ii]['title'] = "Удаление категории"; $res = $dbtree->DeleteAll($id_category); if ($res === true) { $tpl->Assign('msg', 'Категория удалена.'); } else { $tpl->Assign('msg', $res); $tpl->Assign('errm', 1); } $parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_message.tpl')); if (TRUE == $parsed_res['issuccess']) { $tpl_center .= $parsed_res['html']; } // ---- right ----
<?php if (!_acl::isAllow('catalog')) { die("Access denied"); } $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); // ---- center ---- unset($parsed_res); // -------------------------------------------------------------------------------------- if (isset($GLOBALS['REQAR'][1]) && is_numeric($GLOBALS['REQAR'][1])) { $id_category = $GLOBALS['REQAR'][1]; } else { header('Location: ' . $GLOBALS['URL_base'] . '404/'); exit; } $category = $dbtree->Full(array('id_category', 'category_level', 'name', 'translit', 'art', 'pid', 'content', 'visible'), array('and' => array('id_category = ' . $id_category))); $tpl->Assign('h1', 'Редактирование тегов категории'); // $dbtree->Parents($id_category, array('id_category', 'name', 'category_level')); // if (!empty($dbtree->ERRORS_MES)) { // print_r($dbtree->ERRORS_MES);die(); // } $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Каталог"; $GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/cat/'; $GLOBALS['IERA_LINKS'][$ii]['title'] = "Редактирование тегов категории"; foreach ($dbtree->GetTagsLevelsList($id_category) as $k => $l) { $level[$l['tag_level']] = $l; $level[$l['tag_level']]['tags'] = $dbtree->GetTagsList($id_category, $l['tag_level']); } $tpl->Assign('level', $level); if (!isset($_POST['smb'])) {
<?php if (!_acl::isAllow('graphics')) { die("Access denied"); } $Products = new Products(); $dbtree = new dbtree(_DB_PREFIX_ . 'category', 'category', $db); // ---- center ---- unset($parsed_res); $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = "Графики"; $tpl->Assign('h1', $GLOBALS['IERA_LINKS'][$ii]['title']); /* if ($Products->GetGraphList()){ $tpl->Assign('data_graph', $Products->GetGraphList()); }*/ /*Pagination*/ if (isset($_GET['limit']) && is_numeric($_GET['limit'])) { $GLOBALS['Limit_db'] = $_GET['limit']; } 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 = count($Products->GetGraphList()); $tpl->Assign('cnt', $cnt); $GLOBALS['paginator_html'] = G::NeedfulPages($cnt); $limit = ' LIMIT ' . $GLOBALS['Start'] . ',' . $GLOBALS['Limit_db']; } else { $GLOBALS['Limit_db'] = 0; $limit = '';