示例#1
0
    function edit()
    {
        if ($_POST['parent'] == '0') {
            $sql = '
				UPDATE {{infoblock}}
				SET 
					name=\'' . trim($_POST['name']) . '\',
					path=\'' . trim($_POST['path']) . '\'
				WHERE id=' . $_POST['id'] . '
			';
        } else {
            $sql = '
				UPDATE {{infoblock}}
				SET 
					name=\'' . trim($_POST['name']) . '\',
					path=\'' . (trim($_POST['path']) == '' ? Funcs::Transliterate(trim($_POST['name'])) : Funcs::Transliterate(trim($_POST['path']))) . '\',
					description=\'' . $_POST['description'] . '\',
					source=\'' . $_POST['source'] . '\',
					type=\'' . $_POST['type'] . '\',
					bdate=\'' . date('Y-m-d H:i:s', strtotime(trim($_POST['bdate']))) . '\',
					edate=\'' . date('Y-m-d H:i:s', strtotime(trim($_POST['edate']))) . '\'
				WHERE id=' . $_POST['id'] . '
			';
        }
        DB::exec($sql);
    }
示例#2
0
 function __construct()
 {
     if ($_POST) {
         DB::escapePost();
         News::setSubscribers();
         if ($_SERVER['HTTP_REFERER']) {
             $this->redirect($_SERVER['HTTP_REFERER']);
         } else {
             $this->redirect('/media/news/');
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         if (Funcs::$uri[2] == '') {
             $tree['pic'] = $tree['fields']['files_gal1'][0]['path'];
             $tree['list'] = News::getList($tree['id']);
             //$tree['tags']=News::getTagList($tree['id']);
             View::render('news/list', $tree);
         } else {
             //$tree['tags']=News::getTags($tree['id']);
             $tree['next'] = News::getNext($tree['id'], $tree['parent'], $tree['udate']);
             $tree['prev'] = News::getPrev($tree['id'], $tree['parent'], $tree['udate']);
             if (isset($_GET['print'])) {
                 View::render('news/print', $tree);
             } else {
                 View::render('news/one', $tree);
             }
         }
     }
 }
示例#3
0
    function forgot()
    {
        if ($_POST) {
            DB::escapePost();
            $sql = '
				SELECT * FROM {{users}} WHERE login=\'' . $_POST['login'] . '\'
			';
            $return = DB::getRow($sql);
            if ($return) {
                $pass = Funcs::generate_password(8);
                $sql = '
					UPDATE {{users}}
					SET pass=MD5(\'' . $pass . '\')
					WHERE login=\'' . $_POST['login'] . '\'
				';
                DB::exec($sql);
                $text = '
					Здравствуйте, ' . $return["login"] . '.<br />
					Ваш новый пароль ' . $pass . '.<br />
					Сменить пароль Вы можете в личном кабинете. 
				';
                $mail = new Email();
                $mail->To($return['email']);
                $mail->Subject('Восстановление пароля на сайте www.' . str_replace("www.", "", $_SERVER["HTTP_HOST"]));
                $mail->Text($text);
                $mail->Send();
            }
            $this->redirect('/');
        } else {
            View::$layout = 'empty';
            View::render('site/forgot');
        }
    }
示例#4
0
    public static function SaveCard()
    {
        Funcs::escapePost();
        $tree = array('name' => $_SESSION['card']['title']);
        $id = Tree::addTree(100, $tree, 'cards');
        $sql = '
			INSERT INTO {{catalog}}
			SET 
				tree=' . $id . ',
				description=\'' . $_SESSION['card']['message'] . '\',
				price=' . $_SESSION['card']['price'] . ',
				vendor=' . $_SESSION['iuser']['id'] . '
		';
        DB::exec($sql);
        $mrh_login = Cards::$mrh_login;
        $mrh_pass1 = Cards::$mrh_pass1;
        $inv_id = $id;
        $_SESSION['card']['id'] = $id;
        $out_summ = $_SESSION['card']['price'];
        $shp_item = Cards::$shp_item;
        $inv_desc = "Подарочная карта, на сумму " . $_SESSION['card']['price'];
        $in_curr = "";
        $culture = "ru";
        $encoding = "utf-8";
        $crc = md5("{$mrh_login}:{$out_summ}:{$inv_id}:{$mrh_pass1}:Shp_item={$shp_item}");
        /*print "<html><script language=JavaScript ". 
        		"src='https://merchant.roboxchange.com/Handler/MrchSumPreview.ashx?". 
        		"MrchLogin=$mrh_login&OutSum=$out_summ&InvId=$inv_id&IncCurrLabel=$in_curr". 
        		"&Desc=$inv_desc&SignatureValue=$crc&Shp_item=$shp_item". 
        		"&Culture=$culture&Encoding=$encoding'></script></html>";*/
        print "<html><script>" . "document.location.href='http://test.robokassa.ru/index.aspx?" . "MrchLogin={$mrh_login}&OutSum={$out_summ}&InvId={$inv_id}&IncCurrLabel={$in_curr}" . "&Desc={$inv_desc}&SignatureValue={$crc}&Shp_item={$shp_item}" . "&Culture={$culture}&Encoding={$encoding}';</script></html>";
    }
示例#5
0
    function run($row)
    {
        $row['slideshowGroup'] = GalleryWidget::$slideshowGroup;
        GalleryWidget::$slideshowGroup++;
        $row['files'] = array();
        if (is_numeric($row['tree'])) {
            $sql = '
				SELECT id FROM {{data}}
				WHERE tree=' . $row['tree'] . ' AND path=\'' . $row['path'] . '\' AND type=\'gallery\'
			';
            $dataId = DB::getOne($sql);
            if ($dataId) {
                $sql = '
					SELECT id2 FROM {{relations}}
					WHERE modul1=\'data\' AND modul2=\'files\' AND id1=' . $dataId . '
				';
                $fileId = DB::getAll($sql, 'id2');
                if (count($fileId) > 0) {
                    $sql = '
						SELECT * FROM {{files}}
						WHERE id IN (' . implode(',', $fileId) . ')
						ORDER BY num
					';
                    $temp = DB::getAll($sql);
                    foreach ($temp as $item) {
                        $item['file'] = Funcs::getFileInfo($item['path']);
                        $row['files'][$item['mime']][] = $item;
                    }
                }
            }
        }
        GalleryWidget::$files = $row['files'];
        return View::getWidget('galleryWidget', $row);
    }
示例#6
0
 function __construct()
 {
     $tree = Tree::getTreeByUrl();
     Funcs::setMeta($tree);
     $list = Search::getResult();
     View::render('site/search', array('list' => $list));
 }
示例#7
0
 public static function render($templ, $row = array())
 {
     if ($row['mdate']) {
         $LastModified_unix = Funcs::MakeTime($row['mdate']);
         $LastModified = gmdate("D, d M Y H:i:s \\G\\M\\T", $LastModified_unix);
         $IfModifiedSince = false;
         if (isset($_ENV['HTTP_IF_MODIFIED_SINCE'])) {
             $IfModifiedSince = strtotime(substr($_ENV['HTTP_IF_MODIFIED_SINCE'], 5));
         }
         if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) {
             $IfModifiedSince = strtotime(substr($_SERVER['HTTP_IF_MODIFIED_SINCE'], 5));
         }
         if ($IfModifiedSince && $IfModifiedSince >= $LastModified_unix) {
             header($_SERVER['SERVER_PROTOCOL'] . ' 304 Not Modified');
         } else {
             header('Last-Modified: ' . $LastModified);
         }
     }
     print View::getRender($templ, $row);
     if (DEBUG == 4) {
         print '<pre style="background:#FF9999;border:2px solid #000000">';
         print_r($row);
         print '</pre>';
     }
 }
示例#8
0
 function __construct()
 {
     if (Funcs::$uri[1] == '') {
         $tree = Tree::getTreeByUrl(Funcs::$uri[0]);
         Funcs::setMeta($tree);
         $tree['list'] = Compare::getCompare();
         View::render('compare/list', $tree);
     }
 }
示例#9
0
 public function upload()
 {
     if ($_SESSION['iuser']['id']) {
         if ($_POST['act'] == 'step1') {
             $model = new Upload();
             $model->step1();
             $this->redirect('/fotobook/upload/step2/');
         } elseif ($_POST['act'] == 'step2') {
             $model = new Upload();
             $model->step2();
             $this->redirect('/fotobook/upload/step3/');
         } elseif ($_POST['act'] == 'step3') {
             $model = new Upload();
             $model->step3();
             View::$layout = 'empty';
             View::render('fotobook/upload/step3done');
         } elseif ($_POST['act'] == 'step3return') {
             $model = new Upload();
             $model->step3return();
             //$this->redirect('/fotobook/upload/step4/');
         } elseif ($_POST['act'] == 'step4') {
             $model = new Upload();
             $data = $model->step4();
             $this->redirect('/fotobook/upload/thanks/', $data);
         } elseif (Funcs::$uri[2] == '') {
             $this->redirect('/fotobook/upload/step1/');
         } elseif (Funcs::$uri[2] == 'step1') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step1', $tree);
         } elseif (Funcs::$uri[2] == 'step2') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step2', $tree);
         } elseif (Funcs::$uri[2] == 'step3') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step3', $tree);
         } elseif (Funcs::$uri[2] == 'step3show') {
             View::$layout = 'empty';
             View::render('fotobook/upload/step3show');
         } elseif (Funcs::$uri[2] == 'step4') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/step4', $tree);
         } elseif (Funcs::$uri[2] == 'thanks') {
             $tree = Tree::getTreeByUrl('wide');
             Funcs::setMeta($tree);
             View::render('fotobook/upload/thanks', $tree);
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         View::render('fotobook/upload/page', $tree);
     }
 }
示例#10
0
 function __construct()
 {
     if (Funcs::$uri[1] == '') {
         $tree = Tree::getTreeByUrl(Funcs::$uri[0]);
         Funcs::setMeta($tree);
         $tree['list'] = Catalog::getFavorite();
         //$tree['recommended']=Catalog::getRecommended();
         View::render('favorite/list', $tree);
     }
 }
示例#11
0
 function __construct()
 {
     $seo = array();
     $seo['seo_title'] = 'Пользователи';
     Funcs::setMeta($seo);
     if (is_numeric(Funcs::$uri[1]) && !Funcs::$uri[2]) {
         $data = User::getOne(Funcs::$uri[1]);
         $data['list'] = Catalog::getUserBooksList(Funcs::$uri[1]);
         View::render('user/one', $data);
     }
 }
示例#12
0
 public function properties()
 {
     if ($_POST) {
         Tools::saveProperties();
         Funcs::getProperties();
         $this->redirect('/tools/properties/');
     } else {
         $data['list'] = Tools::getPropertiesList();
         View::render('tools/properties/list', $data);
     }
 }
示例#13
0
 public function orders()
 {
     $data = array();
     $seo['seo_title'] = 'Управления заказами';
     Funcs::setMeta($seo);
     if (Funcs::$uri[2] == '') {
         $data['list'] = Manager::getManagerOrders();
         View::render('manager/orders', $data);
     } else {
         $data = Orders::getOne(Funcs::$uri[2]);
         $data['avatar'] = User::getAvatar($data['iuser']);
         View::render('manager/order', $data);
     }
 }
示例#14
0
 function __construct()
 {
     $tree = Tree::getTreeByUrl('wide');
     Funcs::setMeta($tree);
     if ($_POST) {
         if (Online::send($tree['id'])) {
             $this->redirect('/online/thanks/');
         }
     }
     if (Funcs::$uri[1] == '') {
         View::render('online/form', $tree);
     } else {
         View::render('site/page', $tree);
     }
 }
示例#15
0
 public function message()
 {
     if ($_POST) {
         $error = Feedback::sendMessage();
         if ($error) {
             View::render('faq/list', $tree);
         } else {
             $this->redirect('/feedback/message/?done');
         }
     } else {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         View::render('feedback/message', $tree);
     }
 }
示例#16
0
    public function ask($tree)
    {
        foreach ($_POST as $key => $value) {
            $_POST[$key] = htmlspecialchars(trim(strip_tags($value)));
        }
        if ($_POST['kcaptcha'] == $_SESSION['captcha_keystring'] && $_POST['kcaptcha'] != '' && $_SESSION['captcha_keystring'] != '') {
            $sql = '
				INSERT INTO {{tree}}
				SET
					parent=' . $tree . ',
					name=\'' . trim($_POST['question']) . '\',
					path=\'' . Funcs::Transliterate(trim($_POST['question'])) . '\',
					seo_title=\'' . trim($_POST['question']) . '\',
					seo_keywords=\'' . trim($_POST['question']) . '\',
					seo_description=\'' . trim($_POST['question']) . '\',
					udate=NOW(),
					cdate=NOW(),
					visible=0,
					site=' . $_SESSION['site'] . ',
					num=0
			';
            $id = DB::exec($sql);
            $sql = '
				INSERT INTO {{relations}}
				SET
					modul1=\'tree\',
					modul2=\'faq\',
					id1=\'' . $id . '\',
					id2=1,
					cdate=NOW()
			';
            DB::exec($sql);
            //Fields::insertField($id,'answer',$_POST['message']);
            //Fields::insertField($id,'phone',$_POST['phone']);
            $text = '
				<b>Email:</b> <a href="mailto:' . trim($_POST['email']) . '">' . trim($_POST['email']) . '</a><br />
				<b>Вопрос:</b> ' . trim($_POST['question']) . '<br />
			';
            $mail = new Email();
            $mail->To(Funcs::$conf['email']['faq']);
            $mail->Subject('Задан вопрос на сайте ' . $_SERVER['HTTP_HOST']);
            $mail->Text($text);
            $mail->Send();
            return false;
        } else {
            return true;
        }
    }
示例#17
0
 function catalogOne($from, $to)
 {
     $data = array();
     $i = 0;
     $sql = 'SELECT * FROM model WHERE parent=\'' . $from . '\'';
     $items = DB::getAll($sql);
     foreach ($items as $item) {
         if (!$temp) {
             $data = array('parent' => $to, 'name' => $item['name'], 'seo_title' => $item['title'] == '' ? $item['name'] : $item['title'], 'seo_keywords' => $item['kw'] == '' ? $item['name'] : $item['kw'], 'seo_description' => $item['descr'] == '' ? $item['name'] : $item['descr'], 'description' => $item['small_descr'], 'fulltext' => $item['full_descr'], 'model' => $item['model'], 'market' => $item['market'], 'price' => $item['price'], 'visible' => $item['visible'], 'available' => $item['sale'], 'udate' => date('Y-m-d H:i'), 'path' => Funcs::Transliterate($item['name']), 'oldid' => $item['ID']);
             $id = site::setPage($data, $i);
             $i++;
         }
     }
     //print '<pre>';
     //print_r($data);
 }
示例#18
0
 function __construct()
 {
     $tree = Tree::getTreeByUrl('gal');
     Funcs::setMeta($tree);
     if (Funcs::$uri[2] == '') {
         $tree['list'] = Specials::getList($tree['id']);
         View::render('specials/list', $tree);
     } else {
         //$parents=Tree::getParents($tree['id']);
         //$parentTree=Tree::getTreeById($parents[count($parents)-3],'gal');
         //$tree['pic']=$parentTree['fields']['files_gal1'][0]['path'];
         $tree = Specials::getOne($tree['id']);
         //$tree['tags']=Articles::getTags($tree['id']);
         View::render('specials/one', $tree);
     }
 }
示例#19
0
 function __construct()
 {
     if (!in_array(Funcs::$uri[1], get_class_methods(__CLASS__))) {
         $tree = Tree::getTreeByUrl('wide');
         Funcs::setMeta($tree);
         $tree['list'] = Faq::getList($tree['id']);
         if ($_POST) {
             $error = Faq::ask($tree['id']);
             if ($error) {
                 View::render('faq/list', $tree);
             } else {
                 $this->redirect('/help/faq/');
             }
         } else {
             View::render('faq/list', $tree);
         }
     }
 }
示例#20
0
 function __construct()
 {
     if ($_GET['act'] == 'del') {
         Forum::del();
         $this->redirect('/' . implode('/', Funcs::$uri) . '/');
     }
     if (Funcs::$uri[2] == '') {
         $tree = Tree::getTreeByUrl('wide', array('help', 'forum'));
         Funcs::setMeta($tree);
         $tree['list'] = Forum::getForum();
         View::render('forum/forum', $tree);
     } elseif (Funcs::$uri[3] == '') {
         if ($_POST) {
             $error = Forum::add();
             if ($error) {
                 $tree = Forum::getItems();
                 Funcs::setMeta($tree);
                 View::render('forum/items', $tree);
             } else {
                 $this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/');
             }
         } else {
             $tree = Forum::getItems();
             Funcs::setMeta($tree);
             View::render('forum/items', $tree);
         }
     } else {
         if ($_POST) {
             $error = Forum::add();
             if ($error) {
                 $tree = Forum::getList();
                 Funcs::setMeta($tree);
                 View::render('forum/list', $tree);
             } else {
                 $this->redirect('/' . Funcs::$uri[0] . '/' . Funcs::$uri[1] . '/' . Funcs::$uri[2] . '/' . Funcs::$uri[3] . '/');
             }
         } else {
             $tree = Forum::getList();
             Funcs::setMeta($tree);
             View::render('forum/list', $tree);
         }
     }
 }
示例#21
0
    public function sendMessage()
    {
        Funcs::escapePost();
        //if($_POST['kcaptcha']==$_SESSION['captcha_keystring'] && $_POST['kcaptcha']!='' && $_SESSION['captcha_keystring']!=''){
        $text = '
				<b>ФИО:</b> ' . $_POST['fio'] . '<br />
				<b>Телефон:</b> ' . $_POST['tel'] . '<br />
				<b>Email:</b> <a href="mailto:' . $_POST['email'] . '">' . $_POST['email'] . '</a><br />
				<b>Тема:</b> ' . $_POST['theme'] . '<br />
				<b>Сообщение:</b><br />' . nl2br($_POST['quest']) . '<br />
			';
        $mail = new Email();
        $mail->To(Funcs::$conf['email']['feedback']);
        $mail->Subject('Обратная связь на сайте ' . $_SERVER['HTTP_HOST']);
        $mail->Text($text);
        $mail->Send();
        return false;
        /*}else{
        			return true;
        		}*/
    }
示例#22
0
 public static function getBanners()
 {
     $data = array();
     foreach (Funcs::$infoblockNum['mainbanners'] as $item) {
         if ($item['path'] == 1) {
             $item['action'] = round((Funcs::MakeTime($item['edate']) - Funcs::MakeTime($item['bdate'])) / 86400) + 1;
             $item['end-days'] = round((Funcs::MakeTime($item['edate']) - Funcs::MakeTime(date('d.m.Y H:i'))) / 86400) + 1;
             //print $item['end-days'];
             if ($item['end-days'] >= 0) {
                 if (is_numeric($item['source'])) {
                     $item['model'] = Catalog::getOne($item['source']);
                 }
                 $data[$item['path']][] = $item;
             }
             //print ' = '.$item['action'].'-'.$item['end-days'].'<br>';
             //$data[$item['path']][]=$item['description'];
         } else {
             $data[$item['path']][] = $item['description'];
         }
     }
     return $data;
 }
示例#23
0
 function messages()
 {
     if ($_POST) {
         Funcs::escapePost();
         Message::addMessage(Funcs::$uri[2], $_POST['message']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if ($_GET['del']) {
         Funcs::escapeGet();
         Message::delMessage($_GET['del']);
         $this->redirect('/cabinet/messages/' . Funcs::$uri[2] . '/');
     }
     if (is_numeric(Funcs::$uri[2])) {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data = Message::getList(Funcs::$uri[2]);
         View::render('cabinet/messagesOne', $data);
     } else {
         $seo['seo_title'] = 'Сообщения';
         Funcs::setMeta($seo);
         $data['list'] = Message::getUsers();
         View::render('cabinet/messages', $data);
     }
 }
示例#24
0
<span class="icon_sort_up"></span><?php 
}
?>
										<?php 
if ($_GET['sort'] == 'iuser' && isset($_GET['desc'])) {
    ?>
<span class="icon_sort_down"></span><?php 
}
?>
									</span>
									<span class="sections_table_caption jsIcon"><a href="?sort=iuser<?php 
if ($_GET['sort'] == 'iuser' && !isset($_GET['desc'])) {
    ?>
&desc=on<?php 
}
echo Funcs::getFG(array('sort', 'desc'), '&');
?>
" class="icon_sort"></a></span>
								</div>
							</th>
						</tr>
						<?php 
foreach ($list as $item) {
    ?>
							<tr class="sections_table_row jsMoveElement" id="row<?php 
    echo $item['id'];
    ?>
">
								<td class="sections_table_cell"><?php 
    echo $item['id'];
    ?>
 function confirm()
 {
     $model = new User();
     $model->setConfirm();
     $tree = Tree::getTreeByUrl();
     Funcs::setMeta($tree);
     View::render('registration/thanks', $tree);
 }
示例#26
0
    public function step4()
    {
        $tree = array('name' => $_SESSION['iuser']['upload']['title']);
        $id = Tree::addTree($_SESSION['iuser']['upload']['spec'], $tree, 'catalog');
        if (file_exists($_SESSION['iuser']['upload']['filecover']['path']) && file_exists($_SESSION['iuser']['upload']['filepages']['path'])) {
            $dir = $_SERVER['DOCUMENT_ROOT'] . IUSER_DIR . md5('fotouser' . $_SESSION['iuser']['id']) . '/';
            if (!file_exists($dir)) {
                mkdir($dir, 0777);
            }
            $dir = $dir . md5('fotobook' . $id) . '/';
            mkdir($dir, 0777);
            for ($file2i = 0; $file2i < 2; $file2i++) {
                if ($file2i == 0) {
                    $filename = explode('.', $_SESSION['iuser']['upload']['filecover']['name']);
                    $filesource = $_SESSION['iuser']['upload']['filecover']['path'];
                } else {
                    $filename = explode('.', $_SESSION['iuser']['upload']['filepages']['name']);
                    $filesource = $_SESSION['iuser']['upload']['filepages']['path'];
                }
                $raz = $filename[count($filename) - 1];
                unset($filename[count($filename) - 1]);
                $filename = implode('', $filename);
                $filenameraz = Funcs::Transliterate($filename) . '.' . $raz;
                $dirfile = $dir . $filenameraz;
                $x = 0;
                $i = 1;
                while ($x == 0) {
                    if (file_exists($dirfile)) {
                        $filenameraz = Funcs::Transliterate($filename) . $i . '.' . $raz;
                        $dirfile = $dir . md5($filename) . '/' . $filenameraz;
                    } else {
                        $x = 1;
                    }
                    $i++;
                }
                copy($filesource, $dirfile);
                chmod($dirfile, 0777);
                unlink($filesource);
                if ($file2i == 0) {
                    $filename1 = $filenameraz;
                } else {
                    $filename2 = $filenameraz;
                }
            }
        }
        $price = Basket::getPrice('session');
        $sql = '
			INSERT INTO {{catalog}}
			SET
				tree=' . $id . ',
				description=\'' . $_SESSION['iuser']['upload']['description'] . '\',
				phrase=\'' . $_SESSION['iuser']['upload']['phrase'] . '\',
				author=\'' . $_SESSION['iuser']['upload']['author'] . '\',
				private=' . $_SESSION['iuser']['upload']['private'] . ',
				booksize=' . $_SESSION['iuser']['upload']['booksize'] . ',
				countpage=' . $_SESSION['iuser']['upload']['countpage'] . ',
				binding=' . $_SESSION['iuser']['upload']['binding'] . ',
				paper=' . $_SESSION['iuser']['upload']['paper'] . ',
				price=' . $price . ',
				filecover=\'' . $filename1 . '\',
				filepages=\'' . $filename2 . '\',
				vendor=' . $_SESSION['iuser']['id'] . '
		';
        DB::exec($sql);
        unset($_SESSION['iuser']['upload']);
        $_SESSION['iuser']['upload']['id'] = $id;
        $_SESSION['iuser']['upload']['price'] = $price;
        Upload::addGallery($id, $filename1, $filename2, $dir);
        Email::uploadSend();
    }
示例#27
0
	<div class="cell_page-content_control-panel">		
		<div class="jsTabs">
			<form>
				Поиск пользователя
				<div class="input_text_label"><input type="text" name="q" placeholder="Имя" class="input_text" value="<?php 
echo $_GET['q'];
?>
" /></div>
				Сумма покупок
				<div class="input_text_label"><input type="text" name="from" placeholder="от" class="input_text" value="<?php 
echo $_GET['from'];
?>
" /></div>
				<div class="input_text_label"><input type="text" name="to" placeholder="до" class="input_text" value="<?php 
echo $_GET['to'];
?>
" /></div>
				<span class="button-white"onClick="$(this).parent().submit();">Показать</span>
			</form>
			<a class="button" href="/<?php 
echo Funcs::$cdir;
?>
/orders/export/<?php 
echo Funcs::getFG(NULL, '?');
?>
">Экспорт</a>
		</div>
	</div>
</div>

示例#28
0
    public static function getFieldsByTree($id, $option = '')
    {
        $gal = 0;
        $data = array();
        $return = array();
        $sql = 'SELECT * FROM {{data}} WHERE tree=' . $id . ' AND field=0 ORDER BY num';
        $additional = DB::getAll($sql);
        foreach ($additional as $item) {
            if ($item['type'] == 'editor' || $item['type'] == 'text') {
                if ($_SESSION['user']['panel']['edit'] == 'on') {
                    $item['value'] = $item['value_text'];
                    $item['field'] = 'value_text';
                    $data[$item['path']] = View::getRenderEmpty('../' . ONESSA_DIR . '/views/onessa/field', $item);
                } else {
                    $data[$item['path']] = $item['value_text'];
                }
            } elseif ($item['type'] == 'string') {
                if ($_SESSION['user']['panel']['edit'] == 'on') {
                    $item['value'] = $item['value_string'];
                    $item['field'] = 'value_string';
                    $data[$item['path']] = View::getRenderEmpty('../' . ONESSA_DIR . '/views/onessa/field', $item);
                } else {
                    $data[$item['path']] = $item['value_string'];
                }
            } elseif ($item['type'] == 'integer') {
                $data[$item['path']] = $item['value_int'];
            } elseif ($item['type'] == 'radio') {
                //$data[$item['path']]=$item['value_int'];
                $data[$item['path']] = $item['value_int'] == 1 ? 'Да' : 'Нет';
            } elseif ($item['type'] == 'float') {
                $data[$item['path']] = $item['value_float'];
            } elseif ($item['type'] == 'select') {
                $data[$item['path']] = $item['value_text'];
            } elseif ($item['type'] == 'gallery') {
                $galname = $item['path'];
                if ($option == 'gal') {
                    $gal++;
                    $galname = 'gal' . $gal;
                }
                if (class_exists(GalleryWidget)) {
                    $data[$galname] = GalleryWidget::run($item);
                    if ($option == 'wide' || $option == 'gal') {
                        $data['files_' . $galname] = GalleryWidget::$files;
                    }
                } else {
                    $sql = '
						SELECT id FROM {{data}}
						WHERE tree=' . $item['tree'] . ' AND path=\'' . $item['path'] . '\' AND type=\'gallery\'
					';
                    $dataId = DB::getOne($sql);
                    if ($dataId) {
                        $sql = '
							SELECT id2 FROM {{relations}}
							WHERE modul1=\'data\' AND modul2=\'files\' AND id1=' . $dataId . '
						';
                        $fileId = DB::getAll($sql, 'id2');
                        if (count($fileId) > 0) {
                            $sql = '
								SELECT * FROM {{files}}
								WHERE id IN (' . implode(',', $fileId) . ')
								ORDER BY num
							';
                            $temp = DB::getAll($sql);
                            foreach ($temp as $item) {
                                $item['file'] = Funcs::getFileInfo($item['path']);
                                $data['files_' . $galname][$item['mime']][] = $item;
                            }
                        }
                    }
                }
            } elseif ($item['type'] != 'multival' && $item['type'] != 'multiselect' && $item['type'] != 'treeselectval' && $item['type'] != 'treeselect' && $item['type'] != 'select' && $item['type'] != 'fstring' && $item['type'] != 'fnumber' && $item['type'] != 'fcheckbox' && $item['type'] != 'fgroup') {
                $data[$item['type']] = FormWidget::run($item['type']);
            }
        }
        if ($option != 'wide') {
            foreach ($data as $key => $item) {
                if (is_numeric($key)) {
                    $return['additional'] .= $item;
                } else {
                    $return[$key] = $item;
                }
            }
            return $return;
        } else {
            return $data;
        }
    }
示例#29
0
 private static function hasIP($isCheckDate)
 {
     $where = $isCheckDate ? ' AND datetime > "' . Funcs::getYesterday() . '"' : '';
     return self::hasID('loginhistories', 'ip = "' . Funcs::getIP() . '"' . $where);
 }
示例#30
0
文件: one.php 项目: sov-20-07/billing
						<?php 
}
?>
						<?php 
if (!$reportme || count($_SESSION['user']) > 0) {
    ?>
							<?php 
    foreach ($reports as $item) {
        ?>
								<div class="review">
									<span class="stars st<?php 
        echo $item['stars'];
        ?>
"></span>
									<span class="r_date"><?php 
        echo Funcs::convertDate($item['create_date']);
        ?>
										<?php 
        if (count($_SESSION['user']) > 0) {
            ?>
<a href="/catalog/delreport/?id=<?php 
            echo $item['id'];
            ?>
&tree=<?php 
            echo $id;
            ?>
" title="Удалить" onclick="return confirm('Удалить отзыв?');">[x]</a><?php 
        }
        ?>
									</span>
									<h5><?php