include_once($_SERVER[DOCUMENT_ROOT]."/class/define.php");
include_once("utils.php");
include_once("./pear/HTML/ITX.php");
include_once("sql.class.php");
include_once("users.class.php");
include_once("stat.class.php");
include_once("pre.class.php");
include_once("news.class.php");
include_once("spec.class.php");
include_once("foto_unit2.class.php");
include_once("foto_unit.class.php");
include_once("catalog.class.php");
include_once("catalog2.class.php");
include_once("best_units.class.php");
include_once("keywords.class.php");
include_once("basket.class.php");
include_once("tpl.class.php");
include_once("form_attr.class.php");
include_once("form_sel.class.php");
include_once("upload_file.class.php");
// ...� header'� ����� ����� ����������� �������� ����� �� ����
$Users = new Users;
$Stat = new Stat;
$Pre = new Pre;
$Foto_unit2 = new Foto_unit2;
$Catalog2 = new Catalog2;
$Best_units = new Best_units;
$News = new News;
$Spec = new Spec;
$Keywords = new Keywords;
$Basket = new Basket;
$Tpl_class = new Tpl_class;
$Form_attr = new Form_attr;
$Form_sel = new Form_sel;
$Upload_file = new Upload_file;
$s_uid = (int)$s_uid;
$fu_uid = (int)$fu_uid;
// -- ���� ���
if (!defined('_SAPE_USER')){
define('_SAPE_USER', 'd2556a15257901a157581e943a5727af');
}
require_once($_SERVER['DOCUMENT_ROOT']._SAPE_USER.'/sape.php');
$o = array();
$o[ 'force_show_code' ] = true;
$o['request_uri'] = getenv('REQUEST_URI');
$sape = new SAPE_client( $o );
$saplink = $sape->return_links();
//-------------------------------------------------------------------------
$parent_uid = 0;
if($s_uid!=0){
$t = $Catalog2->Show_by_uid($s_uid);
$BODY_n = from_base($t[0]['name']);
$parent_uid = $t[0]['parent'];
$tpl_name = $Tpl_class->Get($t[0]['tpl_uid']);
$fr_more_info = $Pre->Show_by_uid($t[0]['more_info']);
$RIGHT_TEXT = from_base($fr_more_info[0]['pre']);
// �������� ���������-��������� ������
//------------------------------------
$img_path = "photos/img2/";
// ���������
//----------
$_name = $s_uid."ss";
$PIC_s = Get_pic_info($_name, $img_path);
//v($PIC_s);
$_w = $PIC_s['width'];
if($a['small_pic_width']!=0){
$_w = $a['small_pic_width'];
}
if($PIC_s['src']!=""){
$img_ss = "
";
}else{
// �� �������� ������ ��������� ��������
$img_ss = "";
}
// �������� ���������-��������� �����
//------------------------------------
}
$main_tpl = new IntegratedTemplateExtension('./tpl');
$main_tpl->loadTemplateFile($tpl_name,true,false);
//-------------------------------------------------------------------------
include_once('_common.inc');
//include_once('_show_basket.inc');
//-------------------------------------------------------------------------
// ����� ��������� �����
$SM_TEXT = '';
$SM = $Catalog2->Show(0);
if(!is_array($SM)){
$SM = $Catalog2->Show($parent_uid);
}
$SUB_MENU = '';
$_t = 0;
if(is_array($SM)){
foreach($SM as $sm){
$_t++;
$_href = '/sec2.php?s_uid='.$sm['uid'];
$_name = from_base($sm['name']);
if($sm['file_name']!=''){
if(file_exists($sm['file_name'])){
$_href = '/'.$sm['file_name'];
}
}
$SM_TEXT .= '
'.$_name.'
';
if($_t < sizeOf($SM)){
$SM_TEXT .= ' ';
}
}
$SUB_MENU = $SM_TEXT;
}
// ����� ��������� �����
$SN_TEXT = '';
$SN = $Catalog2->Show(19885);
if(!is_array($SN)){
$SN = $Catalog2->Show($parent_uid);
}
$SSUB_MENU = '';
$_t = 0;
if(is_array($SN)){
foreach($SN as $sn){
$_t++;
$_href = '/sec2.php?s_uid='.$sn['uid'];
$_name = from_base($sn['name']);
if($sn['file_name']!=''){
if(file_exists($sn['file_name'])){
$_href = '/'.$sn['file_name'];
}
}
$SN_TEXT .= ''.$_name.'';
if($_t < sizeOf($SN)){
$SN_TEXT .= ' ';
}
}
$SSUB_MENU = $SN_TEXT;
}
// ����� ��������� �����
$SA_TEXT = '';
$SA = $Catalog2->Show(19895);
if(!is_array($SA)){
$SA = $Catalog2->Show($parent_uid);
}
$ASUB_MENU = '';
$_t = 0;
if(is_array($SA)){
foreach($SA as $sa){
$_t++;
$_href = '/sec2.php?s_uid='.$sa['uid'];
$_name = from_base($sa['name']);
if($sa['file_name']!=''){
if(file_exists($sa['file_name'])){
$_href = '/'.$sa['file_name'];
}
}
$SA_TEXT .= ''.$_name.' | ';
if($_t < sizeOf($SA)){
$SA_TEXT .= ' ';
}
}
$ASUB_MENU = $SA_TEXT;
}
// ���� ��� ������������
//if($flag == 0){
if(1){
$BODY = $Catalog2->Show_by_uid($s_uid);
//$BODY_n = nl2br(from_base($BODY[0]["name"]));
$TITLE = nl2br(from_base($BODY[0]["title"]));
$KEYWORDS = nl2br(from_base($BODY[0]["keywords"]));
$DESCRIPTION = nl2br(from_base($BODY[0]["description"]));
$count_in_line = (int)$BODY[0]["count_in_line"];
$pic_width = (int)$BODY[0]["pic_width"];
if((int)$count_in_line==0){
$count_in_line = 1;
}
if((int)$pic_width==0){
$pic_width = 100;
}
// ������
$tr_counter = 0;
$FU = $Foto_unit2->Show($s_uid);
if(is_array($FU)){
foreach($FU as $a){
//print_vs($a);
$fu_uid = $a['uid'];
$fu_pic_align = $a['pic_align'];
// ��������
//---------
$img_path = "photos/img2/";
// ���������
//----------
$_name = $fu_uid."s";
$PIC_s = Get_pic_info($_name, $img_path);
$_w = $PIC_s['width'];
if($a['small_pic_width']!=0){
$_w = $a['small_pic_width'];
}
if($PIC_s['src']!=""){
$img_s = "
";
}else{
// �� �������� ������ ��������� ��������
$img_s = "";
}
// �������
//--------
$_name = $fu_uid."b";
$PIC_b = Get_pic_info($_name, $img_path);
$new_location = "img_view2.php?fu_uid=".$fu_uid;
//������� ������ ����
$image_w = $PIC_b['width'];
$image_h = $PIC_b['height'];
// �� �������� �� ������ 3-�� ������ (����� ��)
$_pic ="".$img_s."";
// �� �������� ������ ������� ��������,
// �������� ������ ��������� ��������
if($PIC_b['src'] == ""){
$_pic = $img_s;
}
// ��������� 1
//------------
$doc1 = '';
$_icon = '';
$_name = $fu_uid."d1";
$doc_path = "photos/doc_01/";
$DOC1 = Get_doc_info($_name, $doc_path);
if($DOC1['src']!=''){
if($DOC1['ext']=='pdf'){$_icon = '
';}
if($DOC1['ext']=='xls'){$_icon = '
';}
if($DOC1['ext']=='doc'){$_icon = '
';}
$doc1 = "".$_icon." ����������";
}
// ��������� 2
//------------
$doc2 = '';
$_icon = '';
$_name = $fu_uid."d2";
$doc_path = "photos/doc_01/";
$DOC2 = Get_doc_info($_name, $doc_path);
if($DOC2['src']!=''){
if($DOC2['ext']=='pdf'){$_icon = '
';}
if($DOC2['ext']=='xls'){$_icon = '
';}
if($DOC2['ext']=='doc'){$_icon = '
';}
$doc2 = "".$_icon." ����������";
}
$_ww = (int)(100 / $count_in_line);
$_ww .= "%";
///$ABZ .= "";
///$ABZ .= "| ".StripSlashes(nl2br($a['name']))." | ";
$ABZ .= from_base($a['name']);
$__t = $_pic.from_base($a['descr']);
if($doc1!='' or $doc2!='' ){
$__t = $__t." ".$doc1." ".$doc2;
}
///$ABZ .= "| ".$__t." | ";
$ABZ .= $__t;
/*
if($a['view_price']!=0){
$ABZ .= "
����: ".$a['price1']." ���.";
$ABZ .= $_form." ";
}
*/
// ������ - ������� �����, ���� ����
//----------------------------------
$__t = '';
if($a['form_id']>0){
$FORMS_A = $Form_attr->Show_by_uid($a['form_id']);
if(is_array($FORMS_A)){
foreach($FORMS_A as $fa){
$__t = "";
}
// ����� - ������� �����, ���� ����
//---------------------------------
}
}
}
///$BODY_b .= $ABZ." ";
$BODY_b .= $ABZ;
// ����� �������� ����� ������ ��� �������� "�������� �����"
//print $sec;
//if($s_uid == 66 or $parent_uid==120
// or $s_uid == 133 or $parent_uid==133){
if(isset($Submit1)){
$BODY_b = "
���� ��������� ����������! ".$BODY_b;
$text = "";
for($i=1;$i<=30;$i++){
if($fName[$i]!=''){
$text .= $fName[$i].": ".$fData[$i]."\n";
}
}
//v($text);
$subj = "���������� �� ������������ � �����";
$to = $Global_params->Get('ADMIN_EMAIL');
$from = $to;
My_mail($to,$subj,$from,$text);
$subj = "���������� �� ������������ � �����";
$to = "strel22@mail.ru";
$from = $to;
My_mail($to,$subj,$from,$text);
}
// ������� �������� (5 ����)
if($s_uid==160){
$SUB_MENU = '������� ';
}
if($s_uid==195 and $kod_us>0){
$dir_name = "uploaded_docs";
// �������� ����� �� ������ � �����
if($f_submit and $f_name){
// �������� �����
//------------------
reset($_FILES);
if(is_array($_FILES)){
while (list ($key, $f_struct) = each ($_FILES)){
$ext = Get_ext($f_struct["name"]);
$_time = time();
//v($_time);
//v($kod_us);
$_new_file_name = $kod_us."_".$_time;
$f_fullname = $_new_file_name.".".$ext;
if($ext == 'doc' or $ext == 'xls' or $ext == 'pdf' or $ext == 'DOC' or $ext == 'XLS' or $ext == 'PDF'){
$new_file_name_f = $_SERVER[DOCUMENT_ROOT]."/".$dir_name."/".$_new_file_name.".".$ext;
}
@copy($f_struct["tmp_name"], $new_file_name_f);
}
}
//$Upload_file->Create();
$Upload_file->Add( to_base($t_name),
to_base($t_descr),
to_base($_new_file_name),
$f_fullname,
(int)$kod_us);
}
$BODY_b .= "�������� ���������� �� ������ ��������� ���������, ��������� ����� ����. ������� ��������� ��� ����. ";
$BODY_b .= "";
$BODY_b .= " ";
// �������� ���������� � ����������� ������
$dir = $_SERVER[DOCUMENT_ROOT]."/".$dir_name."/";
$_no_files_flag = 0;
// ������� �������� ������������ ������� � ������ ��������� ��� ����������
$BODY_b .= "����������� �����: ";
$BODY_b .= "";
if (is_dir($dir)) {
if ($dh = opendir($dir)) {
while (($file = readdir($dh)) !== false) {
$_file_type = filetype($dir . $file);
if($_file_type!='dir'){
$_kod_us = explode("_",$file);
$_kod_us = $_kod_us[0];
// ������ �� ���� ������������
if($_kod_us==$kod_us){
$_no_files_flag = 1;
$_fn = explode(".",$file);
$_f = $_fn[0];
$__name = "";
$__descr = "";
$UF = $Upload_file->Show_by_f_name($_f);
if(is_array($UF)){
foreach($UF as $uf){
$__name = from_base($uf['name']);
$__descr = from_base($uf['descr']);
}
}
$_name = "".$file."";
$_href = "/".$dir_name."/".$file;
$_href = "".$_name." ";
$BODY_b .= "| ".$_href." | ".$__name." | ";
}
}
}
closedir($dh);
}
}
$BODY_b .= " ";
if($_no_files_flag==0){
$BODY_b .= "��� ����������� ������";
}
}
//******************************************************************************
$IMG_SEC = ' ';
//print $B_TOTAL;
$main_tpl->setVariable( array( 'HEAD_x' => $HEAD_x,
'BODY_B' => $BODY_b,
'BODY_N' => $BODY_n,
'NEWS' => $NEWS,
'SPEC' => $SPEC,
'INFO' => $INFO,
'PARTNERS' => $PARTNERS,
'ABOUT' => $ABOUT,
'NEWS_R' => $NEWS_R,
'SPEC' => $SPEC,
'RIGHT_MENU' => $right_menu,
'TITLE_IMG' => $TITLE_IMG,
'CONTACTS' => $CONTACTS,
'SUB_MENU' => $SUB_MENU,
'SSUB_MENU' => $SSUB_MENU,
'ASUB_MENU' => $ASUB_MENU,
'MENU_y' => $MENU_y,
'SAPLINK' => $saplink,
'B_TOTAL' => $B_TOTAL,
'BASKET_R' => $BASKET_R,
'BODY_COLOR' => $BODY_COLOR,
'TITLE' => $TITLE,
'KEYWORDS' => $KEYWORDS,
'DESCRIPTION' => $DESCRIPTION,
'USER_NAME' => $user_name,
'IMG_SEC' => $IMG_SEC,
'IMG_SS' => $img_ss,
'RIGHT_TEXT' => $RIGHT_TEXT,
'DUB' => $dub
));
$main_tpl->show();
?> |