function indexAction()
 {
     // товары
     $this->catalog_status = mysql::query_findpole('select status from menu where id=59', 'status');
     $this->catalog_inctive = dbh::get_count_status_off('catalog');
     // заказы
     $this->order_inctive = dbh::get_count_status_off('order_number');
     // отзывы
     $this->gb_status = mysql::query_findpole('select status from menu where id=8', 'status');
     $this->gb_inctive = dbh::get_count_status_off('guestbook');
     // новости
     $this->news_status = mysql::query_findpole('select status from menu where id=1', 'status');
     $this->news_inctive = dbh::get_count_status_off('news');
     // комментарии к новостям
     $this->news_gb_status = mysql::query_findpole('select status from menu where id=232', 'status');
     $this->news_gb_inctive = dbh::get_count_status_off('news_gb');
     // пользователи
     $this->users_status = mysql::query_findpole('select status from menu where id=26', 'status');
     $this->users_inctive = dbh::get_count_status_off('users');
     // контентовые разделы
     $this->content_status = mysql::query_findpole('select status from menu where id=89', 'status');
     // галерея
     $this->gallery_status = mysql::query_findpole('select status from menu where id=3', 'status');
     // голосование
     $this->voting_status = mysql::query_findpole('select status from menu where id=102', 'status');
     // настройки
     $this->config_status = mysql::query_findpole('select status from menu where id=80', 'status');
     // CEO
     $this->ceo_status = mysql::query_findpole('select status from menu where id=11', 'status');
     return system::show_tpl((array) $this, 'mainmenu/mainpage.php');
 }
 /**
  * отображаем весь список материалов
  */
 function indexAction()
 {
     if (isset($_POST['status'])) {
         $_SESSION['status'] = $_POST['status'];
     }
     if (isset($_POST['status'])) {
         $limit = 1000;
     } else {
         $_total_news = dbh::news_get_total_count();
         $limit = pager::pager_limit($_total_news, ADMIN_NEWS_AT_PAGE);
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' order by created_at desc, sort limit ' . $limit;
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 3);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'tpl_folder' => $this->tpl_folder, '_total_news' => $_total_news), $this->tpl_folder . '/index.php');
 }
 /**
  * добавляем новый материал
  */
 function addAction()
 {
     global $_sklad;
     if ($_POST) {
         // проверяем на checkbox
         forms::check_box(array('status'));
         //for($i=0; $i<50; $i++) {
         // записываем в базу
         forms::multy_insert_form($this->tablename, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
         //}
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 order by sort desc';
     // выполняем запрос + при необходимости выводим сам запрос
     $select = mysql::query($_sql, 0);
     return system::show_tpl(array('city' => dbh::get_city(), 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
 }
 /**
  * отображаем весь список материалов
  */
 function indexAction()
 {
     // только для СуперАдмина
     if (!general::sadmin()) {
         return general::messages(0, v::getI18n('backend_orror_access'));
     }
     if ($_POST) {
         // проверяем на checkbox
         forms::check_box(dbh::menu_get_id());
         // записываем в базу
         forms::multy_update_form_all_records($this->tablename, 'status', 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id_parent=0 order by zindex';
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 0);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg), $this->tpl_folder . '/index.php');
 }
 /**
  * отображаем весь список материалов
  */
 function indexAction()
 {
     if (isset($_POST['status'])) {
         $_SESSION['status'] = $_POST['status'];
     }
     if (isset($_POST['id_parent']) and $_POST['id_parent'] > 0) {
         $limit = 1000;
     } else {
         // get limit
         // всего в каталоге
         $_total_gallery = dbh::gallery_get_total_count();
         $limit = pager::pager_limit($_total_gallery, ADMIN_GALLERY_AT_PAGE);
     }
     // строим запрос
     $_sql = 'SELECT * FROM ' . $this->tablename . ' where id>0 ' . general::get_status_for_filter($this->tablename) . ' ' . general::get_for_filter($this->tablename, 'id_parent') . ' order by sort  limit ' . $limit;
     // выполняем запрос + при необходимости выводим сам запрос
     $result = mysql::query($_sql, 0);
     // выбираем фотоальбомы
     $_sql = 'SELECT * FROM gallery_grupa where status=1 and id_parent=0 order by pole';
     $gallery_grupa = mysql::query($_sql, 0);
     return system::show_tpl(array('result' => $result, 'msg' => $this->msg, '_status' => isset($_POST['status']) ? $_POST['status'] : 2, 'gallery_grupa' => $gallery_grupa, 'tpl_folder' => $this->tpl_folder, '_total_gallery' => $_total_gallery), $this->tpl_folder . '/index.php');
 }
 <?php 
die('<p style="font-size:36px;color:black;font-weight:bold;">404!</p>');
/***************************************************************************************
 * определяем title, keywords, description, h1		
 ***************************************************************************************/
// получаем метатеги для текущего контроллера
$_arr = dbh::get_title();
// инициализируем класс
$title = new title();
if ($_arr) {
    // устанавливаем свойства
    $title->title = NAME_FIRMS . ' - ' . $_arr['title'];
    $_arr['keywords'] != '' ? $title->keywords = $_arr['keywords'] : ($title->keywords = $_arr['title']);
    $_arr['description'] != '' ? $title->description = $_arr['description'] : ($title->description = $_arr['title']);
    $_arr['h1'] != '' ? $title->h1 = $_arr['h1'] : ($title->h1 = $_arr['title']);
}
/***************************************************************************************
 ***************************************************************************************/
global $_str;
// check for crack!
if (isset($_GET['page'])) {
    system::count_parametr(4);
    system::isset_numeric($_GET['page']);
} else {
    system::count_parametr(3);
    $_GET['page'] = 1;
}
// добавление новости
if (system::IsPost()) {
    if (!captcha::check_captcha()) {
        //выводим сообщение
Exemple #7
0
		<?php 
foreach ($select as $obj) {
    ?>
			<?php 
    $children = dbh::gallery_grupa_get_child($obj->id);
    ?>
			
			<?php 
    if (count($children)) {
        ?>
				<optgroup label="<?php 
        echo $level . $obj->pole;
        ?>
">
					<?php 
        echo system::show_tpl(array('select' => $children, 'level' => $level . '&nbsp;', 'curent_id_parent' => $curent_id_parent, 'tpl_folder' => $tpl_folder), $tpl_folder . '/select.php');
        ?>
				</optgroup>
			<?php 
    } else {
        ?>
				<option value="<?php 
        echo $obj->id;
        ?>
"<?php 
        echo $obj->id == $curent_id_parent ? ' selected' : '';
        ?>
><?php 
        echo $obj->pole;
        ?>
</option>
Exemple #8
0
    if (file_exists(HOST . IMG_CATALOG_TREE_PATH . '/' . $obj->id . '.jpg')) {
        ?>
						<span class="trigger_thumb"><img src="<?php 
        echo IMG_CATALOG_TREE_PATH . '/' . $obj->id . '.jpg';
        ?>
"></span>
					<?php 
    } else {
        ?>
						<span style="color:red;">Нет</span>
					<?php 
    }
    ?>
				</td>		
				<td><?php 
    echo general::link_to($tpl_folder . '/new/id/' . $obj->id, 'Редактировать');
    ?>
</td>
			</tr>

			
			<?php 
    echo system::show_tpl(array('result' => dbh::catalog_tree_get_child($obj->id), 'level' => $level . '&nbsp;', 'tpl_folder' => $tpl_folder), $tpl_folder . '/menu.php');
    ?>
			
			<!--</li>-->
			
		<?php 
}
?>
		<!--</ul>-->
Exemple #9
0
    // парсим данные
    $message = parsing_data($mass_element_for_parsing, $mass_result_for_parsing, nl2br($_arr['text']));
    // парсим заголовок письма
    $subject = replace_data($_arr['zag'], '%site%', ADRESS_SITE);
    $subject = replace_data($subject, '%number_order%', '' . $_number_order);
    // отправляем мыло
    sent_email_new($_user->email, $message, "", $subject, $GLOBALS["mailadmin"]);
    //---------------------------------------------------------//
    //---------------------------------------------------------//
    //---------------------------------------------------------//
    // очищаем корзину
    basket::clear_Basket();
    $_str .= v::getI18n('message_after_oformleniya_basket');
    echo "<meta http-equiv='refresh' content='5;URL=/index.php'>";
} else {
    // выводим содержимое корзины
    if (basket::show_Basket()) {
        $_str .= system::show_tpl(array('result' => basket::show_Basket()), 'frontend/basket/list.php');
        if (basket::show_Basket()) {
            if (!registration::is_Autorize()) {
                // новый пользователь
                $_str .= system::show_tpl(array('city' => dbh::get_city()), '/frontend/basket/new_user.php');
            } else {
                //авторизованный пользователь
                $_str .= system::show_tpl(array(), '/frontend/basket/autorize_user.php');
            }
        }
    } else {
        $_str .= 'Товары в корзине отсутствуют!';
    }
}
Exemple #10
0
		<?php 
foreach ($select as $obj) {
    ?>
			<option value="<?php 
    echo $obj->id;
    ?>
"<?php 
    echo $obj->id == $curent_id_parent ? 'selected' : '';
    ?>
><?php 
    echo $level . $obj->pole;
    ?>
</option>		
			<?php 
    echo system::show_tpl(array('select' => dbh::gallery_grupa_get_child($obj->id), 'level' => $level . '&nbsp;', 'curent_id_parent' => $curent_id_parent, 'tpl_folder' => $tpl_folder), $tpl_folder . '/select.php');
    ?>
		<?php 
}
Exemple #11
0
				    <?else:?>
                        <span class="ps_coll"></span>
                    <?endif?>
                </span>
                <span class="name"><?php 
    echo $obj->name_ru;
    ?>
				<br />
				<!--<strong>URL страницы</strong>: <input  value="<?php 
    // echo $obj->action;
    ?>
" class="red"></input>-->
				</span>
            </span>
			
			<?php 
    echo dbh::content_count_child($obj->id) > 0 ? '<ul>' : '';
    ?>
				<?php 
    echo system::show_tpl(array('result' => dbh::content_get_child($obj->id), 'tpl_folder' => $tpl_folder), $tpl_folder . '/menu.php');
    ?>
			<?php 
    echo dbh::content_count_child($obj->id) > 0 ? '</ul>' : '';
    ?>
			
		</li>
		
	<?php 
}
?>
	
Exemple #12
0
$deps = checkForDependencies();
if ($deps !== true) {
    die((string) $deps);
}
//Check PHP Version
$version = explode(".", phpversion());
//Grab DB First
require INC . "/instances/class_db.php";
if (file_exists(INC . "/conf.inc.php")) {
    include INC . "/conf.inc.php";
}
//Is THT installed?
if ($sql['install']) {
    define("INSTALL", 1);
}
$dbh = new dbh();
global $dbh;
include INC . "/instances/class_instance.php";
$instance = new instance();
global $instance;
$folder = INC . "/classes";
if ($handle = opendir($folder)) {
    while (false !== ($file = readdir($handle))) {
        if ($file != "." && $file != "..") {
            $base = explode(".", $file);
            if ($base[1] == "php") {
                $base2 = explode("_", $base[0]);
                if ($base2[0] == "class") {
                    require $folder . "/" . $file;
                    new $base2[1]();
                    //Even though these aren't instances being used right now, they do store instance data in class instance.
Exemple #13
0
    ?>
">
		<td><input type="checkbox" name="kt_where[]" value="<?php 
    echo $obj->id;
    ?>
" /></td>
		<td><?php 
    echo general::link_to($tpl_folder . '/delete/id/' . $obj->id, 'Удалить?', 'onclick="return confirm(\'Вы уверены?\')"');
    ?>
</td>
		<td><?php 
    echo strip_tags($obj->name);
    ?>
</td>
		<td><?php 
    echo dbh::catalog_tree_name($obj->id_parent);
    ?>
</td>
		<td><?php 
    echo $obj->cost;
    ?>
</td>
		<td><?php 
    echo $obj->kolvoview;
    ?>
</td>		
		<td><?php 
    echo system::show_data($obj->created_at);
    ?>
</td>
		<td><a href="#" data-id="<?php 
 /**
  * 	get count of news
  */
 static function count_gallery()
 {
     // получаем группу галереи
     $_id_gallery_grupa = dbh::get_gallery_grupa_id($_GET['url']);
     if ($_id_gallery_grupa) {
         $_sql = 'SELECT count(*) as count FROM gallery where status=1 and id_parent=' . $_id_gallery_grupa;
         // выполняем запрос + при необходимости выводим сам запрос
         return mysql::query_findpole($_sql, 'count', 0);
     }
 }
Exemple #15
0
    echo dbh::voting_count_child($obj->id) == 0 || $obj->id_parent != 0 ? general::link_to($tpl_folder . '/delete/id/' . $obj->id, 'Удалить?', 'onclick="return confirm(\'Вы уверены?\')"') : '<a href=""></a>';
    ?>
</span>
				</span>
                <span class="name"><?php 
    echo $obj->text;
    ?>
				<br />
				<!--<strong>URL страницы</strong>: <input  value="<?php 
    // echo $obj->action;
    ?>
" class="red"></input>-->
				</span>
            </span>
			
			<?php 
    echo dbh::voting_count_child($obj->id) > 0 ? '<ul>' : '';
    ?>
				<?php 
    echo system::show_tpl(array('result' => dbh::voting_get_child($obj->id), 'tpl_folder' => $tpl_folder), $tpl_folder . '/menu.php');
    ?>
			<?php 
    echo dbh::voting_count_child($obj->id) > 0 ? '</ul>' : '';
    ?>
			
		</li>
		
	<?php 
}
?>
	
                    $mass_result_for_parsing = array($_user->login, $_user->pasword, ADRESS_SITE, $_user->name, 'http://' . ADRESS_SITE . '/registration/formregistration/enter/id/' . $_user->hash);
                    // парсим данные
                    $message = parsing_data($mass_element_for_parsing, $mass_result_for_parsing, $_arr['text']);
                    // парсим заголовок письма
                    $subject = replace_data($_arr['zag'], '%site%', ADRESS_SITE);
                    // отправляем мыло
                    sent_email_new($_user->email, nl2br($message), "", $subject, $GLOBALS["mailadmin"]);
                    //---------------------------------------------------------//
                    //---------------------------------------------------------//
                    //---------------------------------------------------------//
                    // выводим мообщение
                    Message::GetMessage(1, v::getI18n('message_after_edit_data'));
                    // форма регистрации
                    $_str = system::show_tpl(array('text' => v::getI18n('message_text_after_edit_data')), "frontend/registration/welcome.php");
                    // очищаем POST
                    unset($_POST);
                    echo "<meta http-equiv='refresh' content='5;URL=/registration/formregistration/edit'>";
                }
            } else {
                // проверка на авторизованного юзера
                if (!registration::is_Autorize()) {
                    system::error(404);
                }
                // получаем данные пользователя
                $_user = registration::get_User($_SESSION['log']);
                // форма регистрации
                $_str = system::show_tpl(array('obj' => $_user, 'city' => dbh::get_city()), "frontend/registration/edit.php");
            }
            break;
    }
}
Exemple #17
0
    }
    ?>
				</select>
			<?php 
}
?>
	
		</span>
	</div>
		
	</form>
</div>
<?php 
echo $msg ? $msg : '';
?>
	
<table class="table1" width="100%" border="0" cellspacing="0" cellpadding="0">
  <thead>
	<tr>
		<th>Название</th>
		<?php 
if (TYPE_BANNER == 1) {
    ?>
			<th>Позиция</th>
		<?php 
}
?>
	
		<th>Хиты</th>
		<th>Диаграмма</th>
		<th>Опубликован?</th>
Exemple #18
0
		<?php 
foreach ($result as $obj) {
    ?>
				<?php 
    if ($obj->id_parent) {
        ?>
					<?php 
        echo system::show_tpl(array('result' => dbh::catalog_tree_get_parent($obj->id_parent)), '/frontend/catalog/bread.php');
        ?>
				<?php 
    }
    ?>
				<?php 
    echo isset($ls) ? $obj->pole : general::link_to('catalog/grupa/' . $obj->id, ' ' . $obj->pole);
    ?>
				
		<?php 
}
Exemple #19
0
<table class="table1" width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<th>Удаление</th>
		<th>Наименование</th>
		<th>Опубликован?</th>
		<th>Операции</th>
	</tR>

	
<?php 
foreach ($result as $obj) {
    ?>
	
	<tr>
		<td><?php 
    echo dbh::content_count_child($obj->id) == 0 ? general::link_to($tpl_folder . '/delete/id/' . $obj->id . '/tablename/' . $_GET['tablename'], 'Удалить?', 'onclick="return confirm(\'Вы уверены?\')"') : '';
    ?>
</td>
		<td><?php 
    echo $obj->pole;
    ?>
</td>
		<td><a href="#" data-id="<?php 
    echo $obj->id;
    ?>
" class="setStatus"><?php 
    echo $obj->status == 1 ? '<span style="color:#39C;">Да</span>' : '<span style="color:red;">Нет</span>';
    ?>
</a></td>		
		<td><?php 
    echo general::link_to($tpl_folder . '/new/id/' . $obj->id . '/tablename/' . $_GET['tablename'], 'Редактировать');
Exemple #20
0
			<tr>
				<td><b style="color:red"><?php 
    echo $obj->name_menu;
    ?>
<b></td>
				<td><?php 
    echo $obj->link_menu;
    ?>
</td>
				<td><?php 
    echo $obj->status == 1 ? 'Да' : '<span style="color:red;">Нет</span>';
    ?>
</td>
				<td><input name="FORM[<?php 
    echo $obj->id;
    ?>
]" type="checkbox" <?php 
    echo $obj->status == 1 ? checked : '';
    ?>
 id="<?php 
    echo $obj->id;
    ?>
"></td>
			</tr>
			
			<?php 
    echo system::show_tpl(array('result' => dbh::menu_get_child($obj->id)), 'adm/menu.php');
    ?>

		<?php 
}
function get_navigator()
{
    // если каталог!!!
    if ($_GET['action'] == 'catalog') {
        return get_navigator_catalog();
    }
    global $zag_radel;
    global $dbname;
    $_res = '';
    if (isset($_GET['action']) and $_GET['action'] != 'index') {
        $_res = '<a href="/">Главная</a> ';
    }
    if (isset($_GET['action']) and $_GET['action'] == 'news' and isset($_GET['url'])) {
        if (TYPE_NEWS) {
            $curr_type = isset($_GET['type']) ? (int) $_GET['type'] : 0;
            $_res .= ' <a href="/news/type/' . $curr_type . '">' . $_type_news[$curr_type] . '</a> ';
        } else {
            $_res .= ' <a href="/news">Новости</a> ';
        }
    }
    if (isset($_GET['action']) and $_GET['action'] == 'gallery') {
        if (isset($_GET['url'])) {
            $_res .= ' <a href="/gallery">Галерея</a> ';
            $_id_gallery_grupa = dbh::get_gallery_grupa_id_parent($_GET['url']);
            // строим запрос
            $_sql = 'SELECT * FROM gallery_grupa where id=' . $_id_gallery_grupa . ' and status=1 order by sort';
            $result = mysql::query($_sql, 0);
            if ($result) {
                // выводим группы товаров
                $_res .= system::show_tpl(array('result' => $result), 'frontend/gallery/bread.php');
            }
        }
    }
    if ($_GET['action'] == 'voting') {
        if (isset($_GET['arhiv'])) {
            $_res .= ' <a href="/voting">Голосование</a> ';
        }
    }
    /*
     * проверяем на разделы
     * если они есть, то выводим родительский  раздел
     */
    // проверяем на наличие подразделов данного раздела
    $_sql = "select id_parent, name\n\t\t\t\t from content\n\t\t\t\t where action='" . $_GET['action'] . "' and id_parent!=0";
    //echo $_sql."<br>";
    $result = mysql_db_query($dbname, $_sql);
    $_res_n = array();
    if (mysql_numrows($result) > 0) {
        // это дочерний раздел, т.е. у него есть родитель, ищем его имя и ссылку
        $find = mysql_fetch_array($result);
        //findpole_universal_full($poisk,$table,$name_field,$nomerpole,$whatdoing)
        $_id_parent_name = findpole_universal_full($find['id_parent'], "content", "id", 1, "return");
        $_id_parent_action = findpole_universal_full($find['id_parent'], "content", "id", 2, "return");
        //$_res='<a href="'.MAIN_PATH.'/'.$_id_parent_action.'.php">'.$_id_parent_name.'</a> / '.$_res;
        $_res_n[0] = '<a href="' . MAIN_PATH . '/' . $_id_parent_action . '">' . $_id_parent_name . '</a> ';
        for ($i = 1; $i < 20; $i++) {
            // ищем следующий уровень
            $_sql = "select id_parent, name\n\t\t\t\t\t from content\n\t\t\t\t\t where action='" . $_id_parent_action . "' and id_parent!=0";
            //echo $_sql."<br>";
            $result = mysql_db_query($dbname, $_sql);
            if (mysql_numrows($result) > 0) {
                // это дочерний раздел, т.е. у него есть родитель, ищем его имя и ссылку
                $find = mysql_fetch_array($result);
                //findpole_universal_full($poisk,$table,$name_field,$nomerpole,$whatdoing)
                $_id_parent_name = findpole_universal_full($find['id_parent'], "content", "id", 1, "return");
                $_id_parent_action = findpole_universal_full($find['id_parent'], "content", "id", 2, "return");
                //$_res='<a href="'.MAIN_PATH.'/'.$_id_parent_action.'.php">'.$_id_parent_name.'</a> / '.$_res;
                $_res_n[$i] = '<a href="' . MAIN_PATH . '/' . $_id_parent_action . '">' . $_id_parent_name . '</a> ';
            } else {
                break;
            }
        }
    }
    // строим в нужном порядке и выводим
    $_res_n = array_reverse($_res_n);
    for ($i = 0; $i < count($_res_n); $i++) {
        $_res .= $_res_n[$i];
    }
    if (isset($_GET['action']) and $_GET['action'] != 'index') {
        return $_res . ' ' . get_h1();
    }
}
Exemple #22
0
 <?php 
die('<p style="font-size:36px;color:black;font-weight:bold;">404!</p>');
global $_str;
// check for crack!
if (isset($_GET['page'])) {
    system::count_parametr(5);
    system::isset_numeric($_GET['page']);
} else {
    system::count_parametr(3);
    $_GET['page'] = 1;
}
if (isset($_GET['url'])) {
    // получаем группу галереи
    $_id_gallery_grupa = dbh::get_gallery_grupa_id($_GET['url']);
    // проверяеим есть ли дети
    $children = dbh::gallery_grupa_get_child($_id_gallery_grupa);
    if (count($children)) {
        // выводим группы
        $_str .= gallery::get_group_gallery('/frontend/gallery/list.php');
    } else {
        // check for count gallery at page
        gallery::count_gallery_at_page();
        // get limit
        $limit = pager::pager_limit(gallery::count_gallery(), GALLERY_AT_PAGE);
        // выводим фото
        $_str .= gallery::get_gallery($limit, '/frontend/gallery/show.php');
    }
} else {
    $_str .= gallery::get_group_gallery('/frontend/gallery/list.php');
}
Exemple #23
0
					<?php 
        echo general::link_to($tpl_folder . '/delete/id/' . $obj->id, 'Удалить?', 'onclick="return confirm(\'Вы уверены?\')"');
        ?>
					<?php 
    }
    ?>
</span>
					
				</span>
                <span class="name"><?php 
    echo $level . $obj->pole;
    ?>
</span>
            </span>
			
			<?php 
    echo dbh::catalog_tree_count_child($obj->id) > 0 ? '<ul>' : '';
    ?>
				<?php 
    echo system::show_tpl(array('result' => dbh::catalog_tree_get_child($obj->id), 'tpl_folder' => $tpl_folder), $tpl_folder . '/menu.php');
    ?>
			<?php 
    echo dbh::catalog_tree_count_child($obj->id) > 0 ? '</ul>' : '';
    ?>
			
		</li>						
			
		<?php 
}
?>
		
Exemple #24
0
<div class="thumbnails">

	<?php 
foreach ($gallery_grupa as $gallery_grupa) {
    ?>

	
		<div align="center"><?php 
    echo $gallery_grupa->pole;
    ?>
</div>

		<?php 
    // получаем потомков галереи
    $gallery = dbh::get_gallery($gallery_grupa->id_gallerygrupa);
    ?>
		
			<?php 
    foreach ($gallery as $gallery) {
        ?>
				
					<ins class="thumbnail">
                			<div class="r">
				
					<?php 
        if (file_exists(HOST . IMG_GALLERY_PATH . '/' . $gallery->id . '.jpg')) {
            ?>
						<a href="<?php 
            echo IMG_GALLERY_PATH;
            ?>
Exemple #25
0
		<?php 
foreach ($result as $obj) {
    ?>
				<?php 
    if ($obj->id_parent) {
        ?>
					<?php 
        echo system::show_tpl(array('result' => dbh::gallery_grupa_get_parent($obj->id_parent)), '/frontend/gallery/bread.php');
        ?>
				<?php 
    }
    ?>
				<?php 
    echo general::link_to('gallery/' . $obj->url, ' ' . $obj->pole);
    ?>
				
		<?php 
}
 /**
  * добавляем новый материал
  */
 function addAction()
 {
     if ($_POST) {
         // проверяем на существование такого action, если есть - добавляем несколько символов
         $_sql = 'SELECT count(*) as count FROM ' . $this->tablename . ' where url="' . $_POST['FORM']['url'] . '"';
         // выполняем запрос + при необходимости выводим сам запрос
         if (mysql::query_findpole($_sql, 'count', 0) > 0) {
             $_POST['FORM']['url'] .= '_' . rand(0, 99999);
         }
         $this->_width = mysql::query_findpole('select zna from config where id=21', 'zna');
         $this->_height = mysql::query_findpole('select zna from config where id=22', 'zna');
         $this->_width_b = mysql::query_findpole('select zna from config where id=21', 'zna');
         $this->_height_b = mysql::query_findpole('select zna from config where id=22', 'zna');
         // проверяем на checkbox
         forms::check_box(array('status'));
         // записываем в базу
         forms::multy_insert_form($this->tablename, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
         // загружаем фото
         forms::multy_update_photo(HOST . IMG_GALLERY_GRUPA_PATH, 1, mysql_insert_id(), $this->_width, $this->_height, $this->_width_b, $this->_height_b);
         header('Location: /backend/' . $this->tpl_folder . '/index');
     }
     return system::show_tpl(array('select' => dbh::get_gallery_grupa_tree(), 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
 }
 function SetSetting($name, $value)
 {
     $link = dbh::connect();
     $sql = "UPDATE `settings` SET value='" . $value . "' WHERE setting='" . $name . "' limit 1";
     mysql_query($sql);
     dbh::disconnect($link);
 }
 /**
  * добавляем новый материал
  */
 function addAction()
 {
     if ($_POST) {
         $this->_width = mysql::query_findpole('select zna from config where id=27', 'zna');
         $this->_height = mysql::query_findpole('select zna from config where id=28', 'zna');
         $this->_width_b = mysql::query_findpole('select zna from config where id=27', 'zna');
         $this->_height_b = mysql::query_findpole('select zna from config where id=28', 'zna');
         // проверяем на checkbox
         forms::check_box(array('status'));
         // записываем в базу
         forms::multy_insert_form($this->tablename, 0);
         $this->msg = general::messages(1, v::getI18n('backend_after_save'));
         // загружаем фото
         forms::multy_update_photo(HOST . IMG_CATALOG_TREE_PATH, 1, mysql_insert_id(), $this->_width, $this->_height, $this->_width_b, $this->_height_b);
     }
     return system::show_tpl(array('select' => dbh::get_catolog_tree(), 'msg' => $this->msg, 'tpl_folder' => $this->tpl_folder), $this->tpl_folder . '/add.php');
 }
Exemple #29
0
			<li>
				<?php 
    if (isset($_GET['grupa']) and $obj->id == intval($_GET['grupa'])) {
        $_cur = 'class="cur"';
    }
    ?>
 
			
				<?php 
    echo general::link_to('catalog/grupa/' . $obj->id . '/brand/0', $level . $obj->pole, $_cur);
    ?>
				
				
				<?php 
    $children = dbh::catalog_tree_get_child($obj->id);
    ?>
			
				<?php 
    if (count($children)) {
        ?>
				
					<ul><?php 
        echo system::show_tpl(array('result' => dbh::catalog_tree_get_child($obj->id), 'level' => $level . ''), '/frontend/catalog/menu_ind.php');
        ?>
</ul>
				<?php 
    }
    ?>
			</li>
		<?php 
}
Exemple #30
0
    ?>
	
	<tr id="listItem_<?php 
    echo $obj->id;
    ?>
">
		<td><input type="checkbox" name="kt_where[]" value="<?php 
    echo $obj->id;
    ?>
" /></td>
		<td><?php 
    echo general::link_to($tpl_folder . '/delete/id/' . $obj->id, 'Удалить?', 'onclick="return confirm(\'Вы уверены?\')"');
    ?>
</td>		
		<td><?php 
    echo dbh::gallery_gb_parent_name($obj->id_parent);
    ?>
</td>
		<td><?php 
    echo $obj->pole;
    ?>
</td>
		<td>
			<?php 
    if (file_exists(HOST . IMG_GALLERY_PATH . '/' . $obj->id . '.jpg')) {
        ?>
				<span class="trigger_thumb"><img src="<?php 
        echo IMG_GALLERY_PATH . '/_' . $obj->id . '.jpg';
        ?>
"></span>
			<?php