GetModuleIdByPath ( '/modules/mod_catalog/catalogcontent.backend.php' ); $Catalog = new CatalogLayout(NULL, $id_module); //for .htaccess if( isset($_REQUEST['str_cat'])){ $categ_parent = NULL; $categ = NULL; //echo '
$_REQUEST[str_cat]=';print_r($_REQUEST['str_cat']); foreach($_REQUEST['str_cat'] as $key=>$value){ //echo '
$key='.$key; $categ_parent = $categ; $categ = $Catalog->GetIdCategByTranslit($key, $categ_parent, $Catalog->lang_id); //echo '
$categ='.$categ; } } else { if( !isset($_REQUEST['categ']) ) $categ=NULL; else $categ = $_REQUEST['categ']; } //for .htaccess if( isset($_REQUEST['str_id'])){ $curcod = $Catalog->GetIdPropByTranslit($_REQUEST['str_id'], $categ, $Catalog->lang_id); //echo '
$curcod='.$curcod; } else { if( !isset($_REQUEST['curcod']) ) $curcod=NULL; else $curcod = $_REQUEST['curcod']; } if( !isset($_REQUEST['task']) ) $task=NULL; else $task = $_REQUEST['task']; if(!isset($_REQUEST['sort'])) $sort=NULL; else $sort=$_REQUEST['sort']; if(!isset($_REQUEST['start'])) $start=0; else $start=$_REQUEST['start']; if(!isset($_REQUEST['display'])) $display=20; else $display=$_REQUEST['display']; if( !isset($_REQUEST['search_keywords']) ) $search_keywords=NULL; else $search_keywords = $_REQUEST['search_keywords']; if( !isset($_REQUEST['search_type']) ) $search_type=NULL; else $search_type = $_REQUEST['search_type']; if( !isset($_REQUEST['search_in_description']) ) $search_in_description=NULL; else $search_in_description = $_REQUEST['search_in_description']; if( !isset($_REQUEST['inc_subcat']) ) $inc_subcat=NULL; else $inc_subcat = $_REQUEST['inc_subcat']; if( !isset($_REQUEST['id_manufac']) ) $id_manufac=NULL; else $id_manufac = $_REQUEST['id_manufac']; if( !isset($_REQUEST['id_group']) ) $id_group=NULL; else $id_group = $_REQUEST['id_group']; if( !isset($_REQUEST['pfrom']) ) $pfrom=NULL; else $pfrom = intval(trim($_REQUEST['pfrom'])); if( !isset($_REQUEST['pto']) ) $pto=NULL; else $pto = intval(trim($_REQUEST['pto'])); if( !isset($_REQUEST['dfrom']) ) $dfrom=NULL; else $dfrom = $_REQUEST['dfrom']; if( !isset($_REQUEST['dto']) ) $dto=NULL; else $dto = $_REQUEST['dto']; if( !isset($_REQUEST['img']) ) $img=NULL; else $img = $_REQUEST['img']; if( !isset($_REQUEST['file']) ) $file=NULL; else $file = $_REQUEST['file']; if( !isset($_REQUEST['modif']) ) $modif=NULL; else $modif = $_REQUEST['modif']; if( !isset( $_REQUEST['color1'] ) ) $color1 = NULL; else $color1 = $_REQUEST['color1']; if( !isset( $_REQUEST['color2'] ) ) $color2 = NULL; else $color2 = $_REQUEST['color2']; if( !isset( $_REQUEST['def_currency'] ) ) $def_currency = NULL; else $def_currency = $_REQUEST['def_currency']; if ( !empty($val_categ) ) { $val_categ='$'.$val_categ.';'; eval($val_categ); } $Catalog->display = $display; $Catalog->sort = $sort; $Catalog->start = $start; $Catalog->id_cat = $categ; $Catalog->id = $curcod; $Catalog->task = $task; $Catalog->id_manufac = $id_manufac; $Catalog->id_group = $id_group; $Catalog->id_img = $img; $Catalog->id_file = $file; $Catalog->modify = $modif; $Catalog->color1 = $color1; $Catalog->color2 = $color2; $Catalog->def_currency = $def_currency; $Catalog->SetMetaData(); $Catalog->lang_id = _LANG_ID; $Catalog->search_keywords = addslashes($search_keywords); $Catalog->search_type = $search_type; $Catalog->search_in_description = $search_in_description; $Catalog->inc_subcat = $inc_subcat; $Catalog->pfrom = addslashes($pfrom); $Catalog->pto = addslashes($pto); $Catalog->dfrom = addslashes($dfrom); $Catalog->dto = addslashes($dto); if( !empty($Catalog->id)){ // get parameters influens on images for current position if ( is_array($_REQUEST) ) { foreach($_REQUEST as $key=>$value){ if( strstr( $key,PARAM_VAR_NAME.PARAM_VAR_SEPARATOR) ){ $par_tmp = explode(PARAM_VAR_SEPARATOR,$key); if(isset($par_tmp[1])){ // if parameter is multiselect then build array in array if(isset($par_tmp[2])){ $Catalog->arr_current_img_params_value[$par_tmp[1]][$par_tmp[2]]=$value; } else { $Catalog->arr_current_img_params_value[$par_tmp[1]]=$value; } } //end if } //end if } // end foreach }// end if //echo '
$Catalog->arr_current_img_params_value='; print_r($Catalog->arr_current_img_params_value); if( empty($Catalog->id_img) ) $id_img = $Catalog->GetFirstImgOfProp($Catalog->id); else $id_img = $Catalog->id_img; // если параметры товара не передавлись через массив $_REQUEST, то // получаю значения параметров товара, которые зависят от изображения для текущего изображения if ( !isset($Catalog->arr_current_img_params_value) ) $Catalog->arr_current_img_params_value = $Catalog->GetParamsValuesOfPropForImg($id_img); //echo '
$Catalog->arr_current_img_params_value='; print_r($Catalog->arr_current_img_params_value); } $Catalog->script=$_SERVER['PHP_SELF']."?display=$Catalog->display&start=$Catalog->start&sort=$Catalog->sort&task=$Catalog->task&categ=$Catalog->id_cat&curcod=$Catalog->id&id_manufac=$Catalog->id_manufac"; if ( empty($Catalog->title) ) $title = ''; else $title = $Catalog->title; if ( empty($Catalog->description) ) $Description = ''; else $Description = $Catalog->description; if ( empty($Catalog->keywords) ) $Keywords = ''; else $Keywords = $Catalog->keywords; $Page->SetTitle( $title ); $Page->SetDescription( $Description ); $Page->SetKeywords( $Keywords ); if( strstr($Catalog->task,'ajax_refresh') ) $show_header_footer=false; else $show_header_footer=true; //=== set error page ==== if( empty($Catalog->task) AND $show_header_footer==true AND ( isset($_REQUEST['str_cat']) AND empty($Catalog->id_cat) OR ( isset($_REQUEST['str_id']) AND empty($Catalog->id)) ) ) $Page->Set_404(); //======================= if($show_header_footer) $Page->WriteHeader($Catalog); //echo '
$search_keywords='.$search_keywords; //echo '
$pfrom='.$pfrom.' $pto='.$pto; //echo '
$task='.$task; switch ($Catalog->task){ case 'quick_search': $Catalog->ShowSearchResult($Catalog->QuickSearch($search_keywords),$search_keywords); break; case 'advansed_search_form': $Catalog->ShowAdvansedSearchForm(); break; case 'make_advansed_search': $Catalog->ShowSearchResult($Catalog->AdvansedSearch($search_keywords, $search_in_description, $inc_subcat, $pfrom, $pto, $dfrom, $dto), $search_keywords); break; case 'add_to_cart': // check selection of the options //if ( $Catalog->CheckSelections($modif, $color1, $color2)){ //$tmp_script="order.php?task=$task&prod_id=$Catalog->id&modif=$modif&color1=$color1&color2=$color2"; $curr_href = NULL; if( is_array($Catalog->arr_current_img_params_value)){ foreach($Catalog->arr_current_img_params_value as $k=>$v){ //???? ?????????????? ????? ??????? if( is_array($v) ){ foreach($v as $k_tmp=>$v_tmp){ $curr_href = $curr_href.'&'.PARAM_VAR_NAME.PARAM_VAR_SEPARATOR.$k.PARAM_VAR_SEPARATOR.$k_tmp.'='.$v_tmp; } } else { $curr_href = $curr_href.'&'.PARAM_VAR_NAME.PARAM_VAR_SEPARATOR.$k.'='.$v; } } // end foreach } $tmp_script="order.php?task=add_to_cart&prod_id=$Catalog->id".$curr_href; echo '
$tmp_script='.$tmp_script; echo ""; //} break; case 'golink': $link = $Catalog->GetNumberName($Catalog->id); if( strpos($link, "/")==1 ) $link = substr($link, 2, strlen($link) ); if( strstr($link, "http://") ) $link = substr($link, strpos($link, "http://")+7, strlen($link) ); if( strstr($link, "www.") ) $link = substr($link, strpos($link, "www.")+4, strlen($link) ); //echo '
$link='.$link; echo ""; break; case 'ajax_refresh_price': $rows = $Catalog->GetArrModelsOfManufacForCategory($Catalog->id_cat, NULL, "move", "asc"); $Catalog->ShowListOfContentByPages($rows, NULL); //$Catalog->ShowContentCurentLevel(); break; case 'ajax_refresh_price_small': //echo '
$Catalog->Logon->user_id='.$Catalog->Logon->user_id; if( empty($Catalog->Logon->user_id) ) $arr_pice = $Catalog->GetPriceLevels($Catalog->id, 'general'); else $arr_pice = $Catalog->GetPriceLevels($Catalog->id, $Catalog->Logon->user_id); $Catalog->ShowRefreshPriceLevels($arr_pice); break; case 'show_files': //$Catalog->ShowErr('Under Construction'); //echo '$Catalog->Logon->user_id='.$Catalog->Logon->user_id.' $Catalog->id_file='.$Catalog->id_file.' $Catalog->id_cat='.$Catalog->id_cat.' $Catalog->id='.$Catalog->id; //if( !empty($Catalog->Logon->user_id) AND !empty($Catalog->id_file) ){ $tmp = $Catalog->GetFileData($Catalog->id_file); $link = Catalog_Upload_Files_Path.'/'.$Catalog->id.'/'.$tmp['path']; //} //else {$link="#";} //echo '
$link='.$link; echo ""; break; case 'ajax_refresh_print_it': //echo '
1111111111111111'; $Catalog->ShowPrintVersion(); break; case 'photogallery': $Catalog->Photogallery(); break; default: //echo '
$Catalog->id_img='.$Catalog->id_img; if ( !empty($Catalog->id) ) $Catalog->ShowDetailsCurrentPosition($Catalog->id_img); else { if ( !empty($Catalog->id_cat) ) $Catalog->ShowContentCurentLevel(); else $Catalog->ShowCategoryOfCatalog(); } break; } if($show_header_footer){ /*========= Save Catalog Statistic START ====================*/ $Catalog->SetStat(); /*========= Save Catalog Statistic END ======================*/ $Page->WriteFooter(); } ?>