Esempio n. 1
2
 public static function updateModuleTasksAgent()
 {
     if (!class_exists('catalog', false)) {
         require_once $_SERVER['DOCUMENT_ROOT'] . '/bitrix/modules/catalog/install/index.php';
     }
     if (class_exists('catalog', false)) {
         $moduleDescr = new catalog();
         $moduleDescr->InstallTasks();
     }
     return '';
 }
Esempio n. 2
0
 /**
  * 	get count 
  */
 static function get_count()
 {
     // фильтрация
     $_filter = catalog::get_filter();
     // запрос
     $_sql = 'SELECT count(*) as count FROM catalog where id_parent=' . $_GET['grupa'] . ' and status=1 ' . $_filter;
     // выполняем запрос + при необходимости выводим сам запрос
     return mysql::query_findpole($_sql, 'count', 0);
 }
Esempio n. 3
0
function form($A, $rs = array())
{
    $id = $A['field'];
    $rules = $A['rules'];
    $rs && ($v = $rs[$id]);
    if ($A['hidden'] == "1") {
        $FORM['hidden'] = '<input type="hidden" name="mVal[' . $id . ']" id="' . $id . '" value="' . $v . '" />';
    } else {
        //判读是否为特殊字段
        if (in_array($A['field'], array('cid', 'type', 'vlink'))) {
            switch ($A['field']) {
                case "cid":
                    $catalog = new catalog();
                    $cata_option = $catalog->select($v, 0, 1, 'channel=1&list', $rs['mid']);
                    if ($cata_option) {
                        $html = '<select name="mVal[cid]" id="cid" style="width:auto;">';
                        $html .= '<option value="0"> == 请选择所属栏目 == </option>';
                        $html .= $cata_option;
                    } else {
                        $html = '<select name="mVal[cid]" id="cid" onclick="redirect(\'' . __SELF__ . '?do=catalog&operation=add\');">';
                        $html .= '<option value="0"> == 暂无栏目请先添加 == </option>';
                    }
                    $html .= '</select>';
                    break;
                case "type":
                    $html = '<select name="mVal[type][]" size="10" multiple="multiple" id="type">';
                    $html .= '<option value="0">默认属性[type=\'0\']</option>';
                    $html .= contenType("article");
                    $html .= '</select>';
                    $html .= selected($v, 'type', 'js');
                    break;
                case "vlink":
                    $catalog = new catalog();
                    $html = '<select name="mVal[vlink][]" size="10" multiple="multiple" id="vlink">';
                    $html .= $catalog->select(0, 0, 1, 'channel=1&list&page', 'all');
                    $html .= '</select>';
                    $html .= selected($v, 'vlink', 'js');
                    break;
                    //	case in_array($A['field'],array('hits','digg','comments','visible','postype')):	break;
            }
        } else {
            switch ($A['type']) {
                case in_array($A['type'], array('number', 'text', 'email', 'url')):
                    $html = '<input type="text" name="mVal[' . $id . ']" class="txt" id="' . $id . '" value="' . $v . '" />';
                    break;
                case "radio":
                    if ($rules) {
                        foreach ($rules as $value => $text) {
                            $checked = $value == $v ? ' checked="checked"' : '';
                            $html .= ' <input type="radio" name="mVal[' . $id . ']" class="radio" id="' . $id . '" value="' . $value . '" />' . $text;
                        }
                    }
                    break;
                case "checkbox":
                    if ($rules) {
                        foreach ($rules as $value => $text) {
                            $vArray = explode(',', $v);
                            $checked = in_array($value, $vArray) ? ' checked="checked"' : '';
                            $html .= ' <input type="checkbox" name="mVal[' . $id . '][]" class="checkbox" id="' . $id . '.' . $value . '" value="' . $value . '" ' . $checked . '/>' . $text;
                        }
                    }
                    break;
                case "textarea":
                    $html = '<textarea name="mVal[' . $id . ']" id="' . $id . '" onKeyUp="textareasize(this)" class="tarea">' . $v . '</textarea>';
                    break;
                case "editor":
                    $html = '<script type="text/javascript" src="' . $iCMS->dir . 'javascript/editor.js"></script>';
                    $html .= '<textarea name="mVal[' . $id . ']" id="' . $id . '" rows="30" cols="80" class="editor">' . $v . '</textarea>';
                    break;
                case "select":
                    $html = '<select name="mVal[' . $id . ']" id="' . $id . '" style="width:auto;">';
                    $html .= '<option value="0"> == 不选择 == </option>';
                    if ($rules) {
                        foreach ($rules as $value => $text) {
                            $selected = $value == $v ? ' selected="selected"' : '';
                            $html .= '<option value="' . $value . '"' . $selected . '>' . $text . '</option>';
                        }
                    }
                    $html .= '</select>';
                    break;
                case "multiple":
                    $html = '<select name="mVal[' . $id . '][]" id="' . $id . '" style="width:auto;" size="10" multiple="multiple">';
                    $html .= '<option value="0"> == 不选择 == </option>';
                    if ($rules) {
                        foreach ($rules as $value => $text) {
                            $vArray = explode(',', $v);
                            $selected = in_array($value, $vArray) ? ' selected="selected"' : '';
                            $html .= '<option value="' . $value . '"' . $selected . '>' . $text . '</option>';
                        }
                    }
                    $html .= '</select>';
                    break;
                case "calendar":
                    $value = empty($v) ? get_date($v, 'Y-m-d H:i:s') : $v;
                    $html = '<input name="mVal[' . $id . ']" class="txt" value="' . $value . '" id="' . $id . '" type="text" onclick="showcalendar(event, this)"/>';
                    break;
                case "image":
                    $html = '<input name="mVal[' . $id . ']" id="' . $id . '" type="text" value="' . $v . '" class="txt" style="width:450px"/>';
                    $html .= '<button type="button" class="selectdefault" to="pic"><span>选 择</span></button>';
                    $html .= '<div id="picmenu" style="display:none;">';
                    $html .= '<ul>';
                    $html .= '<li onClick="showDialog(\'' . __SELF__ . '.?do=dialog&operation=Aupload\',\'' . $id . '\',600,140);$(\'.close\').click();">本地上传</li>';
                    $html .= '<li onClick="showDialog(\'' . __SELF__ . '?do=dialog&operation=file&hit=file&type=gif,jpg,png,bmp\',\'' . $id . '\',600,500);$(\'.close\').click();">从网站选择</li>';
                    $html .= '<li onClick="showPic(\'' . $id . '\');$(\'.close\').click();">查看缩略图</li><li onClick="cutPic(\'' . $id . '\');$(\'.close\').click();">剪裁</li>';
                    $html .= '</ul></div>';
                    break;
                case "upload":
                    $html = '<input name="' . $id . '" type="file" class="uploadbtn" id="' . $id . '" />';
                    break;
            }
        }
        $FORM['general'] = array('id' => $id, 'label' => $A['name'], 'description' => $A['description'], 'html' => $html);
    }
    if (!in_array($A['field'], getSystemField())) {
        $val = '$("#' . $id . '").val()';
        //验证
        switch ($A['validate']) {
            case "0":
                //不能为空
                if ($A['type'] == "editor") {
                    $js = 'var ' . $id . '_Editor = FCKeditorAPI.GetInstance(\'mVal[' . $id . ']\') ;
					if(' . $id . '_Editor.GetXHTML( true )==""){
						alert("' . $A['name'] . '不能为空!");
						' . $id . '_Editor.focus();
						return false;
					}';
                } else {
                    $js = 'if(' . $val . '==""){
					alert("' . $A['name'] . '不能为空!");
					$("#' . $id . '").focus();
					return false;}';
                }
                break;
            case "2":
                $js = 'var ' . $id . '_val = ' . $val . ';
					var pattern = /^\\d+(\\.\\d+)?$/;
					chkFlag = pattern.test(' . $id . '_val);
					if(!chkFlag){
						alert("' . $A['name'] . '不是数字");
						$("#' . $id . '").focus();
						return false;}';
                break;
            case "4":
                $js = 'var ' . $id . '_val = ' . $val . ';
					var pattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(\\.[a-zA-Z0-9_-])+/;
					if(!pattern.test(' . $id . '_val)){
						alert("邮箱地址的格式不正确!!");
						$("#' . $id . '").focus();
						return false;}';
                break;
            case "5":
                $js = 'var ' . $id . '_val = ' . $val . ';
					var pattern = /^[a-zA-z]+:\\/\\/[^\\s]*/;
					if(!pattern.test(' . $id . '_val)){
						alert("[' . $A['name'] . ']网址格式不正确!!");
						$("#' . $id . '").focus();
						return false;}';
                break;
        }
    }
    $FORM['js'] = $js;
    //	var_dump($FORM);
    //	var_dump($A);
    return $FORM;
}
Esempio n. 4
0
     $rs = array();
     $id && ($rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__{$__TABLE__}` WHERE id='{$id}'", ARRAY_A));
     $rs['cid'] = empty($rs['cid']) ? intval($_GET['cid']) : $rs['cid'];
     $rs['pubdate'] = empty($id) ? get_date('', "Y-m-d H:i:s") : get_date($rs['pubdate'], 'Y-m-d H:i:s');
     empty($rs['editor']) && ($rs['editor'] = empty($Admin->admin->name) ? $Admin->admin->username : $Admin->admin->name);
     empty($rs['userid']) && ($rs['userid'] = $Admin->uId);
     $rs['mid'] = $mid;
     $form = FormArray($mid, $fArray, $rs);
     $fcount = count($form);
     include iCMS_admincp_tpl("content.add");
     break;
 case 'manage':
     //	$Admin->MP(array("menu_article_manage","menu_article_draft","menu_article_user_manage","menu_article_user_draft"));
     $__MODEL__ = $iCMS->cache('model.id', 'include/syscache', 0, true);
     $model = $__MODEL__[$mid];
     $catalog = new catalog();
     $cid = (int) $_GET['cid'];
     $act = $_GET['act'];
     $sql = " where ";
     $sql .= $_GET['type'] == 'draft' ? "`visible` ='0'" : "`visible` ='1'";
     $sql .= $act == 'user' ? " AND `postype`='0'" : " AND `postype`='1'";
     $_GET['title'] && ($sql .= " AND `title` like '%{$_GET['title']}%'");
     $_GET['tag'] && ($sql .= " AND `tags` REGEXP '[[:<:]]" . preg_quote(rawurldecode($_GET['tag']), '/') . "[[:>:]]'");
     isset($_GET['at']) && ($sql .= " AND `type` REGEXP '[[:<:]]" . preg_quote($_GET['at'], '/') . "[[:>:]]'");
     isset($_GET['userid']) && ($sql .= " AND `userid`='" . (int) $_GET['userid'] . "'");
     $cid = $Admin->CP($cid) ? $cid : "0";
     if ($cid) {
         if (isset($_GET['sub'])) {
             $sql .= " AND ( cid IN(" . $catalog->id($cid) . $cid . ")";
         } else {
             $sql .= " AND ( cid ='{$cid}'";
Esempio n. 5
0
 /**
  * Действия
  * @return array
  */
 public function actions()
 {
     $class = catalog::className();
     return ['index' => ['class' => crud\Admin::className(), 'modelClass' => $class], 'create' => ['class' => crud\Create::className(), 'modelClass' => $class], 'update' => ['class' => crud\Update::className(), 'modelClass' => $class], 'view' => ['class' => crud\View::className(), 'modelClass' => $class], 'delete' => ['class' => crud\Delete::className(), 'modelClass' => $class], 'groupdelete' => ['class' => crud\GroupDelete::className(), 'modelClass' => $class], 'editable' => ['class' => crud\XEditable::className(), 'modelClass' => $class]];
 }
Esempio n. 6
0
    $id = $_POST['id'];
}
if ($id) {
    system::isset_numeric($id);
    if (isset($_GET['type_sort'])) {
        system::isset_numeric($_GET['type_sort']);
    }
    if (isset($_GET['at_page'])) {
        system::isset_numeric($_GET['at_page']);
    }
    // check for count news at page
    catalog::count_at_page();
    // get limit
    $limit = pager::pager_limit(brand::get_count(), CATALOG_AT_PAGE);
    // сортировка
    $_sort = catalog::get_sort_at_page();
    // фильтрация
    $_filter = brand::get_filter();
    // строим запрос
    $_sql = 'SELECT catalog.*, brand.pole as brand_name 
					FROM catalog, brand 
					WHERE catalog.brand=brand.id and catalog.status=1 and brand.status=1 ' . $_filter . ' 
					ORDER BY ' . $_sort . ' 
					LIMIT ' . $limit;
    // выполняем запрос + при необходимости выводим сам запрос
    $result = mysql::query($_sql, 0);
    // наименование бренда
    $_brand = ___findpole('select pole from brand where id=' . $id, 'pole');
    if ($result) {
        $_str .= system::show_tpl(array('result' => $result, '_brand' => $_brand), 'frontend/catalog/brand/list.php');
    } else {
Esempio n. 7
0
<?php

require_once 'classes/catalog.class.php';
$catalog = new catalog();
$data = array();
catalog_data_variables::get_vars($data);
$catalog->set_vars($data);
$catalog->fetch();
Esempio n. 8
0
	<?php 
foreach ($result as $obj) {
    ?>
	
		<a <?php 
    echo catalog::get_curent_brand($obj->id);
    ?>
 href="<?php 
    echo general::link('brand/' . $obj->id);
    ?>
"><?php 
    echo $obj->pole;
    ?>
</a>

	<?php 
}
?>
	
Esempio n. 9
0
 $speed = 100;
 //提取速度
 $cids = $_GET['cid'];
 $startid = (int) $_GET['startid'];
 $endid = (int) $_GET['endid'];
 $starttime = $_GET['starttime'];
 $endtime = $_GET['endtime'];
 $totle = isset($_GET['totle']) ? $_GET['totle'] : 0;
 $loop = isset($_GET['loop']) ? $_GET['loop'] : 1;
 $i = isset($_GET['i']) ? $_GET['i'] : 0;
 empty($action) && alert("请选择操作");
 if ($cids) {
     empty($cids) && alert("请选择栏目");
     is_array($cids) && ($cids = implode(",", $cids));
     if (strstr($cids, 'all')) {
         $catalog = new catalog();
         $cids = substr($catalog->id(), 0, -1);
         if (empty($cids)) {
             redirect("提取完毕", __SELF__ . '?do=file&operation=extract');
         } else {
             _header(__SELF__ . '?do=file&operation=extract&cid=' . $cids . $QUERY_STRING);
         }
     } else {
         $cArray = explode(',', $cids);
         $_Ccount = count($cArray);
         $k = isset($_GET['k']) ? $_GET['k'] : 0;
         $rs = $iCMS->db->getArray("SELECT id FROM #iCMS@__article WHERE cid in ({$cids}) and `visible`='1'");
         empty($totle) && ($totle = count($rs));
         $tloop = ceil($totle / $speed);
         if ($loop <= $tloop) {
             $max = $i + $speed > $totle ? $totle : $i + $speed;
Esempio n. 10
0
                    </div><!-- .navigator-->

					
					<?php 
echo $str;
?>

					
					<?php 
if (isset($_GET['action']) and $_GET['action'] == 'index') {
    ?>
                    <a href="/filter/id/2" class="block_title textleft">Спецпредложения »</a>
                    <div class="tovar_list_1">
                    
						<?php 
    echo catalog::get_goods_for_special_block('/frontend/catalog/special_block3.php', $statik['specpredlogenie_at_first'], 'block_spec=1');
    ?>
                    
                    </div><!-- .tovar_list_1-->
					<?php 
}
?>
					
					
                </div><!-- .content-->
            </div><!-- #coll_3 .coll_h .center_coll_poss-->
        </div><!-- .center_coll_wrap-->
    </div><!-- #conteiner-->
</div><!-- #wrapper-->
<div class="footer_bg" id="footer">
	<div class="site_size">
Esempio n. 11
0
 case 'manage':
     $Admin->MP("menu_group_manage");
     include iPATH . 'include/group.class.php';
     $group = new group();
     $type = $_GET['type'];
     include iCMS_admincp_tpl('group.manage');
     break;
 case 'power':
     $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__group` WHERE `gid`='" . intval($_GET['groupid']) . "'");
     include iCMS_admincp_tpl('group.power');
     break;
 case 'cpower':
     include_once iPATH . 'include/catalog.class.php';
     $rs = $iCMS->db->getRow("SELECT * FROM `#iCMS@__group` WHERE `gid`='" . intval($_GET['groupid']) . "'");
     iCMS_admincp_head();
     $catalog = new catalog();
     $catalog->allArray();
     include iCMS_admincp_tpl('group.cpower');
     break;
 case 'del':
     $gid = (int) $_GET['groupid'];
     $gid && $iCMS->db->query("DELETE FROM `#iCMS@__group` WHERE `gid`='{$gid}'");
     alert('已删除!', "url:" . __SELF__ . "?do=group&operation=manage");
     break;
 case 'post':
     if ($action == 'power') {
         $gid = (int) $_POST['gid'];
         $power = @implode(",", $_POST['power']);
         $iCMS->db->query("UPDATE `#iCMS@__group` SET `power` = '{$power}' WHERE `gid` ='{$gid}' LIMIT 1");
         redirect("设置完成!", __SELF__ . '?do=group&operation=manage');
     } elseif ($action == 'cpower') {
Esempio n. 12
0
 public function findByID($params)
 {
     $id_c = isset($params->id_c) ? $params->id_c : "";
     try {
         $st = $this->db->prepare("SELECT building.adress, company.name\n\t\t\t\tFROM  building\n\t\t\t\tINNER JOIN  company ON (building.id_b = company.id_b) where company.id_c=:id_c");
         $st->bindParam(':id_c', $id_c, PDO::PARAM_INT);
         $result_exec = $st->execute();
         $result = $this->createDefaultResponse($st);
     } catch (PDOException $e) {
         $result = $this->createJsonError();
     }
     //Список телефонов
     $phones = new phone($this->db);
     $phones_list = $phones->getList($params);
     if ($phones_list !== false) {
         $result->items[0]->phones = $phones_list;
     }
     //Path Breadcrumbs
     $catalog = new catalog($this->db);
     $path_breadcrumbs = "";
     try {
         $st = $this->db->prepare("SELECT id_ca\n\t\t\t\tFROM catalog_company INNER JOIN company\n\t\t\t\tON (company.id_c = catalog_company.id_c) where company.id_c=:id_c");
         $st->bindParam(':id_c', $id_c, PDO::PARAM_INT);
         $result_exec = $st->execute();
         $st->setFetchMode(PDO::FETCH_OBJ);
         while ($item = $st->fetch()) {
             $path = $catalog->getBreadcrumbs($item);
             if ($path !== false) {
                 $path_breadcrumbs .= $path;
             }
         }
         $result->items[0]->path = $path_breadcrumbs;
     } catch (PDOException $e) {
         $result = $this->createJsonError();
     }
     return $result;
 }
Esempio n. 13
0
* concedee par la societe Ether Création
* Toute utilisation, reproduction, modification ou distribution du present
* fichier source sans contrat de licence ecrit de la part de la SARL Ether Création est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter la SARL Ether Création a l'adresse: contact@ethercreation.com
* ...........................................................................
* @package ec_ecopresto
* @copyright Copyright (c) 2010-2013 S.A.R.L Ether Création (http://www.ethercreation.com)
* @author Arthur R.
* @license Commercial license
*/
include_once dirname(__FILE__) . '/../../config/config.inc.php';
include_once dirname(__FILE__) . '/../../init.php';
include_once dirname(__FILE__) . '/class/send.class.php';
include_once dirname(__FILE__) . '/class/catalog.class.php';
$catalog = new catalog();
if (Tools::getValue('ec_token') != $catalog->getInfoEco('ECO_TOKEN')) {
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Location: ../");
    exit;
}
if (isset($idcS) && $idcS != 0) {
    $idc = $idcS;
} else {
    $idc = Tools::getValue('idc') ? Tools::getValue('idc') : 0;
}
$server = $catalog->getInfoEco('ECO_URL_COM');
Esempio n. 14
0
* expressement interdite.
* Pour obtenir une licence, veuillez contacter la SARL Ether Création a l'adresse: contact@ethercreation.com
* ...........................................................................
* @package ec_ecopresto
* @copyright Copyright (c) 2010-2013 S.A.R.L Ether Création (http://www.ethercreation.com)
* @author Arthur R.
* @license Commercial license
*/
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
include dirname(__FILE__) . '/class/importProduct.class.php';
include dirname(__FILE__) . '/class/reference.class.php';
include dirname(__FILE__) . '/class/catalog.class.php';
include dirname(__FILE__) . '/class/log.class.php';
$import = new importerProduct();
$catalog = new catalog();
if (Tools::getValue('ec_token') != $catalog->getInfoEco('ECO_TOKEN')) {
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Location: ../");
    exit;
}
$time = time();
$etp = (int) Tools::getValue('etp');
$total = (int) Tools::getValue('total');
$typ = (int) Tools::getValue('typ');
$id_shop = $catalog->getInfoEco('ID_SHOP');
$id_lang = $catalog->getInfoEco('ID_LANG');
Esempio n. 15
0
     }
     break;
 case 'del':
     $id = (int) $_GET['id'];
     $Admin->CP($id, 'Permission_Denied', __SELF__ . '?do=catalog');
     $catalog = new catalog();
     if ($id) {
         if (empty($catalog->array[$id])) {
             $iCMS->db->query("DELETE FROM `#iCMS@__catalog` WHERE `id` = '{$id}'");
             $art = $iCMS->db->getArray("SELECT id FROM `#iCMS@__article` WHERE `cid` = '{$id}'");
             if ($art) {
                 foreach ($art as $a) {
                     delArticle($a['id']);
                 }
             }
             $catalog = new catalog();
             $catalog->cache();
             alert("删除成功!", 'url:' . __SELF__ . '?do=catalog');
         } else {
             alert("请先删除本栏目下的子栏目", 'url:' . __SELF__ . '?do=catalog');
         }
     }
     break;
 case 'move':
     alert("暂无此功能!", 'url:' . __SELF__ . '?do=catalog');
     break;
 default:
     $Admin->MP("menu_catalog_manage");
     $catalog = new catalog();
     $operation && set_cookie('selectopt', $operation);
     $operation = get_cookie('selectopt');
Esempio n. 16
0
    if (in_array($output, array('meta', 'html', 'graph'))) {
        $meta = $gdi->get_meta($query, $output);
        if ($output == 'meta') {
            $CONTENT = json_encode($meta);
        }
        $TITLE = $meta['deskripsi'];
        $types = json_decode('{"html":"","meta":"","graph":"","csv":"","json":"","xml":""}', true);
        foreach ($types as $key => $val) {
            $ACTION .= sprintf('<li><a href="./%1$s?q=%2$s&o=%3$s">%4$s</a></li>', $val, $query, $key, $key);
        }
        $ACTION = '<ul class="action">' . $ACTION . '</ul>';
    } else {
        die($CONTENT);
    }
} else {
    $catalog = new catalog();
    $catalog->get_catalog(DATA_DIR);
    $CONTENT = $catalog->render_catalog();
}
// Further process if else
$MENU .= '<li><a href="./?">Katalog</a></li>';
$MENU .= '<li><a href="#">Dataset baru</a></li>';
$MENU = '<ul class="menu">' . $MENU . '</ul>';
$HEADER = sprintf('<h2>%1$s</h2>', $TITLE) . $MENU . $ACTION;
$FOOTER = sprintf('&copy; %1$s <a href="http://id-php.org/GDI">GDI</a>', date('Y'));
$THEME = 'assets/styles/default.css';
if ($output == 'graph') {
    include_once 'graph.php';
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
Esempio n. 17
0
    // строим запрос
    $_sql = 'SELECT * FROM catalog_tree where id_parent=' . $_GET['grupa'] . ' and status=1 order by sort desc';
    // выполняем запрос + при необходимости выводим сам запрос
    $result = mysql::query($_sql, 0);
    if ($result) {
        // выводим группы товаров
        $_str .= system::show_tpl(array('result' => $result), 'frontend/catalog/grupa.php');
    } else {
        // check for count news at page
        catalog::count_at_page();
        // get limit
        $limit = pager::pager_limit(catalog::get_count(), CATALOG_AT_PAGE);
        // сортировка
        $_sort = catalog::get_sort_at_page();
        // фильтрация
        $_filter = catalog::get_filter();
        // строим запрос
        $_sql = 'SELECT catalog.*, brand.pole as brand_name 
					FROM catalog
					LEFT JOIN brand ON catalog.brand=brand.id
					WHERE catalog.id_parent=' . $_GET['grupa'] . ' and catalog.status=1' . $_filter . ' 
					ORDER BY ' . $_sort . ' 
					LIMIT ' . $limit;
        // выполняем запрос + при необходимости выводим сам запрос
        $result = mysql::query($_sql, 0);
        if ($result) {
            $_str .= system::show_tpl(array('result' => $result), 'frontend/catalog/list.php');
        } else {
            $_str .= 'В данной группе товары отсутствуют.';
        }
    }
<?php

$a = $_GET['a'];
$id = $_GET['id'];
$list = false;
$catalog = new catalog();
$catalog->action = $a;
switch ($a) {
    case 'delete':
        $catalog->delete($id);
        break;
    case 'create':
        $ret = $catalog->create($_POST);
        break;
    case 'update':
        $ret = $catalog->update($id, $_POST);
        break;
    default:
        $list = true;
        $ret = $catalog->browse();
}
echo sprintf('<a href="?a=%1$s">%2$s</a>', $list ? 'create' : 'browse', $list ? 'Baru' : 'Daftar');
echo $ret;
/**
 * Perform catalog operation
 */
class catalog
{
    var $path_name;
    // real path name without ending (back)slash
    var $file_name;
Esempio n. 19
0
* fichier source sans contrat de licence ecrit de la part de la SARL Ether Création est
* expressement interdite.
* Pour obtenir une licence, veuillez contacter la SARL Ether Création a l'adresse: contact@ethercreation.com
* ...........................................................................
* @package ec_ecopresto
* @copyright Copyright (c) 2010-2013 S.A.R.L Ether Création (http://www.ethercreation.com)
* @author Arthur R.
* @license Commercial license
*/
include dirname(__FILE__) . '/../../config/config.inc.php';
include dirname(__FILE__) . '/../../init.php';
include dirname(__FILE__) . '/class/importProduct.class.php';
include dirname(__FILE__) . '/class/reference.class.php';
include dirname(__FILE__) . '/class/catalog.class.php';
$import = new importerProduct();
$catalog = new catalog();
if (Tools::getValue('ec_token') != $catalog->getInfoEco('ECO_TOKEN')) {
    header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
    header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
    header("Cache-Control: no-store, no-cache, must-revalidate");
    header("Cache-Control: post-check=0, pre-check=0", false);
    header("Pragma: no-cache");
    header("Location: ../");
    exit;
}
$time = time();
$etp = (int) Tools::getValue('etp');
$total = (int) Tools::getValue('total');
$typ = (int) Tools::getValue('typ');
$id_shop = (int) Tools::getValue('ids');
$maxR = $total - $etp > 20 ? 20 : $total - $etp;
Esempio n. 20
0
<?php

/**
 * @package iCMS V3.1
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
!$iCMS->config['ishtm'] && redirect("未开启生成HTML设置,请到系统设置->静态生成设置", __SELF__ . '?do=setting&operation=html', 5);
include iPATH . 'include/catalog.class.php';
$catalog = new catalog();
switch ($operation) {
    case 'index':
        $Admin->MP(array("menu_html_all", "menu_html_index"));
        include iCMS_admincp_tpl("html.index");
        break;
    case 'all':
        $Admin->MP("menu_html_all");
        include iCMS_admincp_tpl("html.all");
        break;
    case 'catalog':
        $Admin->MP(array("menu_html_all", "menu_html_catalog"));
        include iCMS_admincp_tpl("html.catalog");
        break;
    case 'article':
        $Admin->MP(array("menu_html_all", "menu_html_article"));
        include iCMS_admincp_tpl("html.article");
        break;
    case 'tag':
        $Admin->MP(array("menu_html_all", "menu_html_tag"));
Esempio n. 21
0
?>
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
show LIMIT banner 

<?php 
echo banners::get_banner(1);
?>
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
show LIMIT brand

<?php 
echo catalog::get_brand('/frontend/catalog/brand/brand_list.php', $statik['brand_at_first']);
?>
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
show autorised user data

<?php 
if (isset($_SESSION['user_id'])) {
    ?>
	Добро пожаловать «<?php 
    echo $_SESSION['user_name'];
    ?>
»
	<a href="/registration/formregistration/edit">Личные данные</a><br />
	<a href="/mycabinet/ctrl/myorders">История покупок</a><br />
Esempio n. 22
0
<?php

/**
 * @package iCMS V3.1
 * @copyright 2007-2009, iDreamSoft
 * @license http://www.idreamsoft.cn iDreamSoft
 * @author coolmoo <*****@*****.**>
 */
!defined('iPATH') && exit('What are you doing?');
$action = $_GET['action'];
if (in_array($action, array('message', 'comment'))) {
    $id = intval($_POST['id']);
    $reply = 'admin||' . htmlspecialchars($_POST['replytext']);
    $iCMS->db->update($action, compact('reply'), compact('id')) && exit('1');
} elseif (in_array($action, array('source', 'author', 'editor'))) {
    include_once iPATH . 'include/default.value.php';
    $ul = "";
    if (${$action . "s"}) {
        foreach (${$action . "s"} as $key => $val) {
            $ul .= "{$val}|{$key}\n";
        }
    }
    echo $ul;
} elseif ($action == "getsubcatalog") {
    include_once iPATH . 'include/catalog.class.php';
    $catalog = new catalog();
    echo "{html:'" . addslashes($catalog->row($_POST["cid"], $_POST["level"] + 1)) . "',ids:'" . $catalog->AJAXid($_POST["cid"]) . "'}";
}
Esempio n. 23
0
						&nbsp;&nbsp;&nbsp;&nbsp;
						<a <?php 
echo catalog::get_curent_type_sort(2);
?>
 href="<?php 
echo general::link('catalog/grupa/' . $_GET['grupa'] . '/type_sort/2');
?>
">Я>А</a> </div>
                    </div><!-- .srt_block-->

                    <div class="tovar_list_3">
					
	<?php 
foreach ($result as $obj) {
    ?>
	
				<?php 
    echo system::show_tpl(array('obj' => $obj, 'level' => ''), '/frontend/catalog/list_index.php');
    ?>
	
	<?php 
}
?>
	
                    </div><!-- .tovar_list_3-->	
	
	
	<?php 
// pager
echo catalog::get_count() > CATALOG_AT_PAGE ? pager::pager_J("catalog/grupa/" . $_GET['grupa'], CATALOG_AT_PAGE, catalog::get_count(), intval($_GET['page'])) : '';
Esempio n. 24
0
 href="<?php 
echo isset($_GET['id']) ? general::link('filter/id/' . $_GET['id'] . '/type_sort/4') : general::link('filter/type_sort/4');
?>
">по убыванию</a></div>
						
                        <div class="row">По алфавиту: 
						<a <?php 
echo catalog::get_curent_type_sort(1);
?>
 href="<?php 
echo isset($_GET['id']) ? general::link('filter/id/' . $_GET['id'] . '/type_sort/1') : general::link('filter/type_sort/1');
?>
">А>Я</a>
						&nbsp;&nbsp;&nbsp;&nbsp;
						<a <?php 
echo catalog::get_curent_type_sort(2);
?>
 href="<?php 
echo isset($_GET['id']) ? general::link('filter/id/' . $_GET['id'] . '/type_sort/2') : general::link('filter/type_sort/2');
?>
">Я>А</a> </div>
                    </div><!-- .srt_block-->

                    <div class="tovar_list_3">
					
	<?php 
foreach ($result as $obj) {
    ?>
	
				<?php 
    echo system::show_tpl(array('obj' => $obj, 'level' => ''), '/frontend/catalog/list_index.php');
Esempio n. 25
0
 public function get_content_by_rid()
 {
     $id = intval($this->input['id']);
     if ($id) {
         $need_pages = intval($this->input['need_pages']);
         $need_process = intval($this->input['need_process']);
         $need_separate = intval($this->input['need_separate']);
         $need_child_detail = intval($this->input['need_child_detail']);
         $not_need_content = intval($this->input['not_need_content']);
         $need_special = intval($this->input['need_special']);
         $sql = "SELECT c.*,c.column_id as main_column_id,r.*,r.id as rid,c.id as id FROM " . DB_PREFIX . "content_relation r LEFT JOIN " . DB_PREFIX . "content c ON r.content_id=c.id WHERE r.id =" . $id;
         $info = $this->db->query_first($sql);
         if (empty($info)) {
             $this->errorOutput('此内容已删除');
         }
         if ($info['indexpic']) {
             $info['indexpic'] = unserialize($info['indexpic']);
         }
         if ($info['video']) {
             $info['video'] = unserialize($info['video']);
             $info['video']['filename'] = str_replace('.mp4', '.m3u8', $info['video']['filename']);
         }
         if ($info['childs_data']) {
             $info['childs_data'] = unserialize($info['childs_data']);
         }
         if ($info['catalog']) {
             $info['catalog'] = unserialize($info['catalog']);
         }
         $info['title'] = $info['title'] ? htmlspecialchars_decode($info['title']) : '';
         $info['brief'] = $info['brief'] ? strip_tags(htmlspecialchars_decode($info['brief'])) : '';
         $info['create_time_format'] = date($this->settings['default_time_format'], $info['create_time']);
         $info['publish_time_stamp'] = $info['publish_time'];
         $info['create_time_stamp'] = $info['create_time'];
         $info['publish_time_format'] = date($this->settings['default_time_format'], $info['publish_time']);
         if ($info['column_id']) {
             $column_data = $this->column->get_site_column_first(' id,name,site_id,fid,childdomain,father_domain,column_dir,relate_dir,col_con_maketype ', $info['column_id']);
             $site_data = $column_data['site_data'];
         }
         $result = array();
         if (!$not_need_content) {
             $apiname = get_tablename($info['bundle_id'], $info['module_id'], $info['struct_id']);
             $filedir = $this->settings['get_content_api_path'] . $apiname . '.class' . $this->settings['get_content_api_suffix'];
             $classname = $apiname;
             if (file_exists($filedir)) {
                 $data = array('id' => $info['expand_id'], 'url' => urldecode($this->input['url']), 'dir' => urldecode($this->input['dir']), 'need_pages' => urldecode($this->input['need_pages']), 'need_child_detail' => urldecode($this->input['need_child_detail']), 'need_process' => urldecode($this->input['need_process']), 'need_separate' => urldecode($this->input['need_separate']), 'child_offset' => intval($this->input['child_offset']), 'child_count' => intval($this->input['child_count']), 'indexpic' => empty($info['indexpic']) ? array() : $info['indexpic']);
                 //echo $filedir;echo $classname;exit;
                 include $filedir;
                 $module_get = new $classname();
                 $result = $module_get->get_processed_content($data);
                 $result = is_array($result) ? $result : array();
             }
         }
         $info1 = $info;
         $info1['id'] = $info['id'];
         if ($info['use_maincolumn']) {
             $column_data = $this->column->get_site_column_first(' id,name,site_id,fid,childdomain,father_domain,column_dir,relate_dir,col_con_maketype ', $info['main_column_id']);
             $site_data = $column_data['site_data'];
             $info['content_url'] = $info['outlink'] ? $info['outlink'] : mk_content_url($site_data, $column_data, array('column_id' => $info['main_column_id']) + $info1);
         } else {
             $info['content_url'] = $info['outlink'] ? $info['outlink'] : mk_content_url($site_data, $column_data, $info1);
         }
         $info['column_info'] = $column_data;
         if ($this->input['video2index'] && $result['content_material_list']) {
             foreach ($result['content_material_list'] as $k => $v) {
                 if ($v['app'] == 'livmedia') {
                     $videourl = parse_url($v['video_url']);
                     $info['video'] = array('host' => $videourl['scheme'] . '://' . $videourl['host'], 'dir' => '', 'filepath' => $videourl['path'], 'filename' => '');
                     $info['is_have_video'] = '1';
                     break;
                 }
             }
         }
         if ($this->input['shorturl'] && $this->settings['App_shorturl']) {
             $curl = new curl($this->settings['App_shorturl']['host'], $this->settings['App_shorturl']['dir']);
             $curl->setReturnFormat('str');
             $curl->setSubmitType('post');
             $curl->initPostData();
             $curl->addRequestData('str', $info['content_url']);
             $ret = $curl->request('shorturl.php');
             if ($ret) {
                 $info['content_url'] = $ret;
             }
         }
         if ($this->settings['App_catalog']) {
             //取编目信息
             $catalog_data = array();
             include ROOT_PATH . 'lib/class/catalog.class.php';
             $catalogobj = new catalog();
             $catalog = $catalogobj->get_catalog($info['bundle_id'], $info['module_id'], $info['content_fromid']);
             $result['catalog_new'] = $catalog;
         }
         $result['source'] = isset($result['source']) ? $result['source'] : '';
         $info['source'] = isset($info['source']) ? $info['source'] : $result['source'];
         if ($result) {
             $result = $info + $result;
         } else {
             $result = $info;
         }
         //统计
         if ($this->input['need_access']) {
             include_once ROOT_PATH . 'lib/class/access.class.php';
             $access_obj = new access();
             $fromType = $this->input['fromType'] ? trim($this->input['fromType']) : "";
             $ret = $access_obj->add_access($info['content_id'], $info['column_id'], $info['bundle_id'], $info['module_id'], $info['title'], $info['content_fromid'], $fromType);
         }
         //加广告
         if ($this->input['ad_group']) {
             $r = array();
             $r['id'] = $result['rid'];
             $r['colid'] = $result['column_id'];
             $r['title'] = $result['title'];
             $r['brief'] = $result['brief'];
             $r['keywords'] = $result['keywords'];
             $r['appid'] = $result['appid'];
             $r['appname'] = $result['appname'];
             $r['create_user'] = $result['create_user'];
             $r['publish_user'] = $result['publish_user'];
             $r['group'] = $this->input['ad_group'];
             $result['ad'] = $this->getAds($this->input['ad_group'], $r, $r['colid']);
         }
         //取这条内容发布到的专题
         if ($need_special && $info['content_id']) {
             $sql = "SELECT relation_data FROM " . DB_PREFIX . "content_push WHERE type=1 AND content_id=" . $info['content_id'];
             $content_push = $this->db->query_first($sql);
             if ($content_push) {
                 $special_data = @unserialize($content_push['relation_data']);
                 if ($special_data) {
                     $special_ids = array();
                     foreach ($special_data as $k => $v) {
                         if ($v['special_id'] = intval($v['special_id'])) {
                             $special_ids[] = $v['special_id'];
                         }
                     }
                     if ($special_ids) {
                         include ROOT_PATH . 'lib/class/special.class.php';
                         $special_obj = new special();
                         $special_datas = $special_obj->get_special_by_ids(implode(',', $special_ids));
                         if (is_array($special_datas)) {
                             $result['special_datas'] = $special_datas;
                         }
                     }
                 }
             }
         }
         $this->addItem($result);
         $this->output();
     } else {
         $this->errorOutput('NO_ID');
     }
 }