function info_list($kind = 0, $ord = 0, $page = 0, $limit = 0, $top = 0, $search = array(), $special = array()) { global $DB_URI; $inst = DBConnection::getConnection($DB_URI); $join = ""; $where = ""; if ($kind) { $k = INFO_ITEM + intval($kind); $where = " and info.kind={$k}"; // プロパティ $propaty = get_info_propaty($inst, $kind); } // トップページ用一覧 if ($top) { if ($top == 1) { // new $join = " left join info_item i2 on info.info_id=i2.info_id"; $where .= " and i2.kind='new' and i2.value=1"; } if ($top == 2) { // オススメ $join = " left join info_item i2 on info.info_id=i2.info_id"; $where .= " and i2.kind='recommend' and i2.value=1"; } if (intval($top) > 10) { // オススメ $join = " left join info_item i2 on info.info_id=i2.info_id"; $v = intval($top) - 10; $where .= " and i2.kind='recommend' and i2.value={$v}"; } } // 条件検索 if ($search) { $no = 11; foreach ($search as $key => $val) { $val = mb_convert_encoding($val, INTERNAL_ENCODING, SCRIPT_ENCODING); $join .= " left join info_item i{$no} on info.info_id=i{$no}.info_id"; $where .= " and i{$no}.value like '%{$val}%' and i{$no}.kind='{$key}'"; // $where .= " and i$no.value='$val' and i$no.kind='$key'"; $no++; } } // こだわり条件検索 if ($special) { $no = 21; foreach ($special as $key => $val) { $join .= " left join info_item i{$no} on info.info_id=i{$no}.info_id"; $where .= " and i{$no}.value={$val} and i{$no}.kind='special'"; $no++; } } // $sql = " from info" . " left join info_item i1 on info.info_id=i1.info_id {$join}" . " where info.open=1 and i1.kind='price' {$where}"; if ($page && $limit) { $ret = $inst->search_sql("select count(info.info_id) as num" . $sql); $count = $ret["data"][0]["num"]; $pages = intval(($count + $limit - 1) / $limit); $pager = array(); if ($pages > 1) { $pager = page_index($page, $pages); } } if ($ord == 1) { $sql .= " order by price desc"; // 高い順 } else { if ($ord == 2) { $sql .= " order by price"; // 安い順 } else { $sql .= " order by info.reg_date desc"; // 新着 } } if ($page && $limit) { $p["offset"] = ($page - 1) * $limit; $p["limit"] = $limit; } else { $p["offset"] = 0; $p["limit"] = $limit; } $ret = $inst->search_sql("select info.info_id as info_id,i1.value+0 as price" . $sql, false, $p); $list = array(); if ($ret["count"]) { foreach ($ret["data"] as $val) { $list[] = get_info($val["info_id"], $propaty); } } if ($page && $limit) { return array($list, $pager); } return $list; }
LDAP_SYNCPROV_SAVE(); exit; } if (isset($_GET["ldapDelNet"])) { LDAP_CONFIG_NET_DEL(); exit; } if (isset($_GET["mysql-audit"])) { MYSQL_AUDIT(); exit; } if (isset($_GET["server_swap"])) { MYSQL_AUDIT_PERFORM(); exit; } page_index(); function js() { $usersmenus = new usersMenus(); if ($usersmenus->AsArticaAdministrator == false) { echo "alert('no privileges');"; exit; } $addon = file_get_contents("js/artica_settings.js"); $tpl = new templates(); $SMTP_NOTIFICATIONS_ADD_CC = $tpl->javascript_parse_text('{SMTP_NOTIFICATIONS_ADD_CC}'); $title = $tpl->_ENGINE_parse_body('{global settings}'); $ldap_title = $tpl->_ENGINE_parse_body('{APP_OPENLDAP}'); $global_admin_account = $tpl->_ENGINE_parse_body('{global_admin_account}'); $global_proxy = $tpl->_ENGINE_parse_body('{global_proxy}'); $start = "GlobalSettingsPage();";
<?php include_once('ressources/class.users.menus.inc'); include_once ("ressources/class.templates.inc"); include_once ("ressources/class.user.inc"); include_once ("ressources/class.fetchmail.inc"); session_start(); if(isset($_GET["script"])){start_js();exit;} if(isset($_GET["page-index"])){page_index();exit;} if(isset($_GET["page-display"])){page_list();exit;} if(isset($_GET["page-right-button"])){page_list_buttons();exit;} if(isset($_GET["page-modify"])){page_modify_rule();exit;} if(isset($_GET["fetchmail_rule_id"])){page_save();exit;} if(isset($_GET["DeleteFetchAccount"])){page_del();exit;} if(isset($_GET["page-fetchmail-aliases"])){page_fetchmail_aliases_index();exit;} if(isset($_GET["page-fetchmail-aliases-list"])){echo page_fetchmail_aliases_list($_GET["page-fetchmail-aliases-list"]);exit;} if(isset($_GET["FetchmailAddAliase"])){page_fetchmail_aliases_add();exit;} if(isset($_GET["FetchmailDeleteAliase"])){page_fetchmail_aliases_del();exit;} if(isset($_GET["enable-js-rule"])){page_list_js_enable();exit;} if(isset($_GET["enable-fetch-rule"])){page_list_js_save();exit;} if(isset($_GET["find-isp-popup"])){find_isp_popup();exit;} if(isset($_GET["isp-choose-proto"])){find_isp_proto();exit;} if(isset($_GET["isp-end"])){find_isp_end();exit;} function start_js(){ $page=CurrentPageName(); if($_GET["uid"]){$uid=$_GET["uid"];}else{$uid=$_SESSION["uid"];}