} if (isset($_POST['smb']) && isset($_POST['supl'])) { $Products->SetProductsList1($_POST['supl']); list($r, $cats_cols) = $Products->GetExportRows($Products->list); // Формирование заголовка $h = array('Артикул'); for ($ii = 0; $ii < $cats_cols; $ii++) { $h[] = "Категория {$ii}"; } $h = array_merge($h, array('Название', 'Сертификат', 'Фото 1', 'Фото 2', 'Фото 3', 'Макс кол-во поставщиков', 'Коэф опт', 'Коэф мелк опт', 'Описание', 'Страна', 'Кол-во в ящ', 'Минимальное количество по мелкому опту', 'Кратность', 'Видимость', 'транслит', 'Вес', 'Объем', 'Обяз прим', 'Ед. измерения')); $Products->GenExcelFile($h, $r, $cats_cols); exit(0); } $orderby = " sort ASC, ord ASC, name ASC"; $Products->SetProductsList(array('cp.id_category' => $id_category), null, array('order_by' => $orderby, 'administration' => '1')); $arr = $dbtree->GetNodeFields($id_category, array('name', 'category_level')); // --- --- --- subcats $l = $arr['category_level'] + 1; $tpl->Assign('subcats', $dbtree->GetSubCats($id_category, array('id_category', 'name', 'translit', 'art', 'category_level'))); // === === === subcats $tpl->Assign('list', $Products->list); $tpl->Assign('catname', $arr['name']); $tpl->Assign('id_category', $id_category); $parsed_res = array('issuccess' => true, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_products.tpl')); $res = $dbtree->Parents($id_category, array('id_category', 'name', 'category_level')); $ii = count($GLOBALS['IERA_LINKS']); foreach ($res as $cat) { if ($cat['category_level'] > 0) { $GLOBALS['IERA_LINKS'][$ii]['title'] = $cat['name']; $GLOBALS['IERA_LINKS'][$ii++]['url'] = $GLOBALS['URL_base'] . 'adm/products/' . $cat['id_category']; }
if ($l['cat_id'] != $cat['cat_id']) { $subcats[$branch][$jj]['nolink'] = true; } if (isset($cat_id) && $cat_id == $cat['cat_id']) { $subcats[$branch][$jj]['selected'] = true; $subcats[$branch][$jj]['nolink'] = true; } } $psubcats[$branch][$jj]['cat_id'] = $cat['cat_id']; $jj++; } } $branch++; } $tpl->Assign('manname', $Manufacturers->fields['name']); $tpl->Assign('mantranslit', $Manufacturers->fields['translit']); $tpl->Assign('man_image', $Manufacturers->fields['m_image']); $tpl->Assign('subcats', $subcats); if (isset($cat_id)) { $items->SetItemsList(array('cat_id' => $cat_id, 'manufacturer_id' => $manufacturer_id, 'visible' => 1)); $catarr = $dbtree->GetNodeFields($cat_id, array('name', 'translit')); $tpl->Assign('cat_id', $cat_id); $tpl->Assign('list', $items->list); $ii = count($GLOBALS['IERA_LINKS']); $GLOBALS['IERA_LINKS'][$ii]['title'] = $catarr['name']; } $parsed_res = array('issuccess' => TRUE, 'html' => $tpl->Parse($GLOBALS['PATH_tpl'] . 'cp_manufacturer.tpl')); if (TRUE == $parsed_res['issuccess']) { $tpl_center .= $parsed_res['html']; } // ---- right ----