function callMobilePhone($phone_num) { CellPhone::openSerialPort(); CellPhone::callPhone($phone_num); CellPhone::closeSerialPort(); $msg = 'Calling ' . $phone_num . '...<INPUT TYPE="image" SRC="' . URLHelper::getWebBaseURL() . 'images/hangup.gif" BORDER="0" >'; $data = array("phone_num" => $phone_num, "msg" => $msg); return $data; }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $luadmin, $i18n; include_once $ClassDir . "URLHelper.class.php"; $template->setFile(array("MAIN" => "apf_group_users_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $groups = $luadmin->perm->getGroups(); $category_arr = array("" => $i18n->_("None")); foreach ($groups as $data) { $category_arr[$data['group_id']] = $data['group_define_name']; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "GROUPOPTION" => selectTag("group", $category_arr, "", "onchange=\"remoteGroupUsers.inGroupUsers(this.value);remoteGroupUsers.unInGroupUsers(this.value)\""), "DOACTION" => "groupusersubmit")); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $luadmin, $i18n; // Var_Dump::display($luadmin->perm->getRights()); // $params = array( // 'fields' => array( // 'right_id', // 'right_define_name', // 'group_id' // ), // 'with' => array( // 'group_id' => array( // 'fields' => array( // 'group_id' // ), // ), // ), // 'filters' => array( // 'group_id' => 3 // ), // 'by_group' => true, // ); // $allGroupRights = $luadmin->perm->getRights($params); // // $group_rights = array(); // if (is_array($allGroupRights) && count($allGroupRights)>0) // { // foreach($allGroupRights as $key=>$userdata) // { // $group_rights[$userdata['right_id']] = $userdata['right_define_name']; // } // } // Var_Dump::display($allGroupRights); include_once $ClassDir . "URLHelper.class.php"; $template->setFile(array("MAIN" => "apf_group_rights_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $groups = $luadmin->perm->getGroups(); $category_arr = array("" => $i18n->_("None")); foreach ($groups as $data) { $category_arr[$data['group_id']] = $data['group_define_name']; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "GROUPOPTION" => selectTag("group", $category_arr, "", "onchange=\"remoteGroupRights.inGroupRights(this.value);remoteGroupRights.unInGroupRights(this.value)\""), "DOACTION" => "grouprightsubmit")); }
function executeList($is_related = false) { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $i18n, $WebUploadDir, $CurrencyFormat, $ActiveOption, $userid; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; require_once 'I18N/Currency.php'; $template->setFile(array("MAIN" => $is_related ? "apf_product_related_list.html" : "apf_product_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $currency = new I18N_Currency($CurrencyFormat); $category_arr = array("" => $i18n->_("All")) + $this->getCategory(); $max_row = 30; $apf_product = DB_DataObject::factory('ApfProduct'); $apf_product->orderBy('id desc'); if (($keyword = trim($_REQUEST['q'])) != "") { $apf_product->whereAdd("name LIKE '%" . $apf_product->escape("{$keyword}") . "%' "); } if (($category = trim($_REQUEST['category'])) != "") { $apf_product->whereAdd(" category = '" . $apf_product->escape("{$category}") . "' "); } if (($active = trim($_REQUEST['active'])) != "") { $apf_product->whereAdd(" active = '" . $apf_product->escape("{$active}") . "' "); } $apf_product->setUserid($userid); $ToltalNum = $apf_product->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_product->limit($start_num, $max_row); $apf_product->find(); $myData = array(); while ($apf_product->fetch()) { $myData[] = $apf_product->toArray(); } $params = array('totalItems' => $ToltalNum, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'prevImg' => $i18n->_("PrevPage"), 'nextImg' => $i18n->_("NextPage"), 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "CATEGORY" => $category_arr[$data['category']], "COMPANY_ID" => $data['company_id'], "NAME" => $data['name'], "PRICE" => $currency->format($data['price']), "PHOTO" => imageTag($data['photo']), "MEMO" => $data['memo'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("KEYWORD" => textTag("q", $_REQUEST['q']), "CATEGORYOPTION" => selectTag("category", $category_arr, $_REQUEST['category']), "ACTIVEOPTION" => selectTag("active", $ActiveOption, $_REQUEST['active']), "WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "CURRENT_PAGE" => $current_page, "SELECT_BOX" => $selectBox, "PAGINATION" => $links['all'])); }
function executeList() { global $template, $controller, $WebBaseDir, $WebTemplateDir, $ClassDir, $CurrencyFormat; require_once 'I18N/Currency.php'; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_product_price_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $currency = new I18N_Currency($CurrencyFormat); $apf_product_price = DB_DataObject::factory('ApfProductPrice'); if ($product_id = $controller->getURLParam(0)) { $apf_product_price->whereAdd("apf_product_price.product_id ='" . $apf_product_price->escape($product_id) . "' "); } if ($company_id = $controller->getURLParam(1)) { $apf_product_price->whereAdd("apf_product_price.company_id ='" . $apf_product_price->escape($company_id) . "' "); } $apf_product_price->orderBy('apf_product_price.id desc'); $apf_product_price->buildJoin(); $apf_product_price->selectAs(array("id", "price", "created_at"), 'p_%s'); $apf_product_price->selectAdd('apf_company.name AS company_name,apf_product.name AS product_name '); $max_row = 30; $ToltalNum = $apf_product_price->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_product_price->limit($start_num, $max_row); // $apf_product_price->debugLevel(4); $apf_product_price->find(); while ($apf_product_price->fetch()) { $myData[] = $apf_product_price->toArray(); } $params = array('totalItems' => $ToltalNum, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'prevImg' => $i18n->_("PrevPage"), 'nextImg' => $i18n->_("NextPage"), 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $i = 0; foreach ($myData as $data) { // Var_Dump::display($data); $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['p_id'], "COMPANY_ID" => $data['company_name'], "PRODUCT_ID" => $data['product_name'], "PRICE" => $currency->format($data['p_price']), "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['p_created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "CURRENT_PAGE" => $current_page, "SELECT_BOX" => $selectBox, "PAGINATION" => $links['all'])); $controller->parseTemplateLang(); $template->parse("OUT", array("LAOUT")); $template->p("OUT"); exit; }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $i18n, $ActiveOption, $StateOption, $userid; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_opportunity_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $max_row = 10; $apf_opportunity = DB_DataObject::factory('ApfOpportunity'); $apf_opportunity->orderBy('id desc'); $apf_opportunity->setUserid($userid); $ToltalNum = $apf_opportunity->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_opportunity->limit($start_num, $max_row); $apf_opportunity->find(); $myData = array(); while ($apf_opportunity->fetch()) { $myData[] = $apf_opportunity->toArray(); } $params = array('totalItems' => $ToltalNum, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'prevImg' => $i18n->_("PrevPage"), 'nextImg' => $i18n->_("NextPage"), 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "TITLE" => $data['title'], "ADDREES" => $data['addrees'], "PHONE" => $data['phone'], "FAX" => $data['fax'], "EMAIL" => $data['email'], "HOMEPAGE" => $data['homepage'], "LINK_MAN" => $data['link_man'], "MEMO" => $data['memo'], "STATE" => $StateOption[$data['state']], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "CURRENT_PAGE" => $current_page, "SELECT_BOX" => $selectBox, "PAGINATION" => $links['all'])); }
function executeTech() { global $template, $WebBaseDir, $WebTemplateDir, $controller, $RootDir, $web_base_name; require_once $RootDir . '/connect.php'; require_once 'Pager/Pager.php'; if ($web_base_name == "front_en.php") { $menu_left_category = "main_left_tech_category_en.html"; $category = 6; } else { $menu_left_category = "main_left_tech_category.html"; $category = 1; } $template->setFile(array("MENU_SUB" => $menu_left_category, "MAIN_LEFT" => $this->getMenuLeftTemplate(), "MAIN" => "main_tech.html")); $template->setBlock("MAIN", "main_list", "list_block"); $template->setBlock("MAIN_LEFT", "main_left", "left_block"); if (!in_array($category, array(1, 6))) { $template->setBlock("MENU_SUB", "main_left_sub", "left_sub_block"); } $max_row = 30; $apf_news = DB_DataObject::factory('ApfNews'); $apf_news->orderBy('apf_news.id desc'); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_news->limit($start_num, $max_row); $apf_news->whereAdd(" category_id = '" . $apf_news->escape("{$category}") . "' "); $apf_news->whereAdd(" active='live' "); $ToltalNum = $apf_news->count(); $apf_news->find(); $i = 0; $myData = array(); while ($apf_news->fetch()) { $myData[] = $apf_news->toArray(); $i++; } $tmpData = $ToltalNum > $max_row ? array_pad($myData, $ToltalNum, array()) : $myData; $params = array('itemData' => $tmpData, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $page_data = $pager->getPageData(); $links = $pager->getLinks(); $selectBox = $pager->getPerPageSelectBox(); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "CATEGORY_ID" => $data['category_id'], "TITLE" => $data['title'], "CONTENT" => $data['content'], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("KEYWORD" => textTag("q", $_REQUEST['q']), "WEB_DIR" => $WebBaseDir, "WEB_TEMPLATE_DIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "PAGINATION" => $links['all'])); }
function getCallIco($phone_num, $mobile_phone = false) { global $ClassDir, $WebTemplateDir; include_once $ClassDir . "URLHelper.class.php"; include_once $ClassDir . "StringHelper.class.php"; $phone_num = StringHelper::handleStrNewline($phone_num); $icon = $mobile_phone ? "<A HREF='###' ONCLICK=\"remoteCellPhoneSMS.callMobilePhone('{$phone_num}');\" ><IMG SRC='" . URLHelper::getWebBaseURL() . $WebTemplateDir . "images/cellphone.gif' /></A><A HREF='###' ONCLICK=\"remoteCellPhoneSMS.sendSMS('{$phone_num}');\" ><IMG SRC='" . URLHelper::getWebBaseURL() . $WebTemplateDir . "images/sms.png' /></A><DIV ID=\"{$phone_num}mobile\" style=\"z-index:10; position:absolute;color:#FFFFFF;\" /><DIV ID=\"{$phone_num}sms\" style=\"z-index:10; position:absolute;color:#FFFFFF;\" />" : "<A HREF='###' ONCLICK=\"remoteCellPhoneSMS.callPhone('{$phone_num}');\" ><IMG SRC='" . URLHelper::getWebBaseURL() . $WebTemplateDir . "images/call.png' /></A><DIV ID=\"{$phone_num}phone\" style=\"z-index:10; position:absolute;\" />"; if (trim($phone_num) && SHOW_SMS) { return $icon; } return; }
<?php /** * * front.php. * * @package core * @author John.meng <*****@*****.**> * @author 孟远螓 * @author QQ:3440895 * @version CVS: $Id: front.php,v 1.7 2006/11/28 14:49:42 arzen Exp $ */ define('APF_ROOT_DIR', realpath(dirname(__FILE__) . '/..')); define('APF_DEBUG', false); require_once APF_ROOT_DIR . DIRECTORY_SEPARATOR . 'front_init.php'; $DefaultModule = "default"; $DefaultPage = "index"; $site_menu = array("首页" => "front.php", "下载" => "front.php/default/index/download", "手册文档" => "front.php/default/index/manual", "新闻事件" => "front.php/default/index/tech/4", "开发产品" => "front.php/default/index/develop", "即时反馈" => "front.php/default/index/feedback", "论坛" => "../bbs", "English" => "front_en.php"); $site_menu_str = ""; $bottom_menu_str = ""; foreach ($site_menu as $key => $value) { $site_menu_str .= "<td background=\"" . URLHelper::getWebBaseURL() . $WebTemplateDir . "images/menu_bg.gif\" valign=\"middle\" background=\"{TEMPLATEDIR}images/menu_bg.gif\" height=\"45\" width=\"91\" align=\"center\" > <a href=\"{$WebBaseDirName}{$value}\" title=\"\">{$key}</a></td>"; $bottom_menu_str .= "<a href=\"{$WebBaseDirName}{$value}\" title=\"{$key}\" class=\"active\">{$key}</a> | "; } $template->setVar(array("MAIN_MENU" => $site_menu_str, "BOTTOM_MENU" => rtrim($bottom_menu_str, "| "))); $controller->dispatch();
function executeList() { global $template, $WebBaseDir, $i18n, $WebTemplateDir, $ClassDir, $userid, $ActiveOption, $ReviewwayOption; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_review_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $apf_review = DB_DataObject::factory('ApfReview'); $apf_review->orderBy('id desc'); $max_row = 10; $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_review->limit($start_num, $max_row); $apf_review->whereAdd(" userid = '{$userid}' OR access = 'public' "); $ToltalNum = $apf_review->count(); $apf_review->find(); $myData = array(); while ($apf_review->fetch()) { $myData[] = $apf_review->toArray(); } $params = array('totalItems' => $ToltalNum, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'prevImg' => $i18n->_("PrevPage"), 'nextImg' => $i18n->_("NextPage"), 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "COMPANY" => $data['company'], "LINKMAN" => $data['linkman'], "REVIEWDATE" => $data['reviewdate'], "CATEGORY" => $ReviewwayOption[$data['category']], "CONTENT" => $data['content'], "GROUPID" => $data['groupid'], "USERID" => $data['userid'], "ACCESS" => $data['access'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "PAGINATION" => $links['all'])); }
$lang = "en"; $template->setFile(array("LAOUT" => "front_laout.html", "HEADER" => "header.html", "MENU" => "menu.html", "FOOT" => "footer_en.html")); } else { $lang = "zh"; $template->setFile(array("LAOUT" => "front_laout.html", "HEADER" => "header.html", "MENU" => "menu.html", "FOOT" => "footer.html")); } $i18n = new I18N_Messages_File($lang, $domain, $dir); include_once $ConfigDir . "common.php"; require_once $ClassDir . "SendEmail.php"; require_once "Cache/Lite.php"; $cache_options = array('cacheDir' => $CacheDir, 'lifeTime' => 7200, 'pearErrorMode' => CACHE_LITE_ERROR_DIE); $cache = new Cache_Lite($cache_options); $log_conf = array('mode' => 0777, 'timeFormat' => '%X %x'); $logger =& Log::singleton('file', $LogDir . date("Y_m_d") . '.log', '\\t', $log_conf); if (defined('APF_DEBUG') && APF_DEBUG == true) { include_once 'Benchmark/Timer.php'; include_once 'Var_Dump.php'; Var_Dump::displayInit(array('display_mode' => 'HTML4_Table')); $timer =& new Benchmark_Timer(); $timer->start(); } $UploadDir = $RootDir . "web/" . $Upload_Dir; $WebUploadDir = dirname(getenv("SCRIPT_NAME")) . "/" . $Upload_Dir; $dsn = "{$DB_Type}://{$DB_UserName}:{$DB_PassWord}@{$DB_Host}/{$DB_Name}"; $controller = new Controller(); $template->setBlock("FOOT", "foot"); $template->setBlock("LAOUT", "front_laout"); $template->setBlock("MENU", "menu"); include_once $ClassDir . "URLHelper.class.php"; $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir));
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $luadmin; $groups = $luadmin->perm->getGroups(); // Var_Dump::display($groups); include_once $ClassDir . "URLHelper.class.php"; $template->setFile(array("MAIN" => "apf_groups_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $i = 0; foreach ($groups as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['group_id'], "GROUP_ID" => $data['group_id'], "GROUP_TYPE" => $data['group_type'], "GROUP_DEFINE_NAME" => $data['group_define_name'], "IS_ACTIVE" => $data['is_active'], "OWNER_USER_ID" => $data['owner_user_id'], "OWNER_GROUP_ID" => $data['owner_group_id'])); $template->parse("list_block", "main_list", TRUE); $i++; } $ToltalNum = $i; $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum)); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $GenderOption; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_users_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $apf_users = DB_DataObject::factory('ApfUsers'); $apf_users->orderBy('id desc'); $apf_users->find(); $i = 0; while ($apf_users->fetch()) { $myData[] = $apf_users->toArray(); $i++; } $ToltalNum = $i; $params = array('itemData' => $myData, 'perPage' => 10, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $page_data = $pager->getPageData(); $links = $pager->getLinks(); $selectBox = $pager->getPerPageSelectBox(); $i = 0; foreach ($page_data as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "USER_NAME" => $data['user_name'], "USER_PWD" => $data['user_pwd'], "GENDER" => $GenderOption[$data['gender']], "ADDREES" => $data['addrees'], "PHONE" => $data['phone'], "EMAIL" => $data['email'], "PHOTO" => $data['photo'], "ROLE_ID" => $data['role_id'], "ACTIVE" => $data['active'], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "PAGINATION" => $links['all'])); }
function renderMonthView() { global $TemplateDir, $ClassDir, $WebBaseDir, $WebTemplateDir, $i18n, $userid; require_once 'Calendar' . DIRECTORY_SEPARATOR . 'Month/Weeks.php'; require_once 'Calendar' . DIRECTORY_SEPARATOR . 'Util' . DIRECTORY_SEPARATOR . 'Textual.php'; include_once $ClassDir . "URLHelper.class.php"; // Initialize GET variables if not set if (!isset($_GET['y'])) { $_GET['y'] = date('Y'); } if (!isset($_GET['m'])) { $_GET['m'] = date('m'); } if (!isset($_GET['d'])) { $_GET['d'] = date('d'); } // Build a month object $Month = new Calendar_Month_Weeks($_GET['y'], $_GET['m'], 0); // count select month webcasts $apf_schedule = DB_DataObject::factory('ApfSchedule'); $apf_schedule->selectAdd('publish_date , COUNT(*) AS NUM'); $apf_schedule->whereAdd(" DATE_FORMAT(publish_date,'%Y-%m') = '{$_GET['y']}-{$_GET['m']}' "); // $apf_schedule->whereAdd("userid='{$userid}'"); $apf_schedule->setUserid($userid); $apf_schedule->groupBy('publish_date'); // $apf_schedule->debugLevel(4); $apf_schedule->find(); $month_webcast = array(); while ($apf_schedule->fetch()) { $month_webcast[date("Y-m-j", strtotime($apf_schedule->getPublishDate()))] = $apf_schedule->NUM; } // Var_Dump::display($month_webcast); // Used for Week::build() below $selectedDays = array(new Calendar_Day(date('Y'), date('m'), date('d'))); // Instruct month to build Week objects $Month->build(); // Construct strings for next/previous links $PMonth = $Month->prevMonth('object'); // Get previous month as object $base_url = $WebBaseDir . "/schedule/apf_schedule/list/"; $prev = $base_url . '?y=' . $PMonth->thisYear() . '&m=' . $PMonth->thisMonth() . '&d=' . $PMonth->thisDay(); $NMonth = $Month->nextMonth('object'); $next = $base_url . '?y=' . $NMonth->thisYear() . '&m=' . $NMonth->thisMonth() . '&d=' . $NMonth->thisDay(); $today_link = $base_url . '?y=' . date("Y") . '&m=' . date("m") . '&d=' . date("d"); $calendar_title = date('F Y', $Month->getTimeStamp()); $main_calendar = ""; while ($Week = $Month->fetch()) { $main_calendar .= "<tr valign='top'>\n"; // Build the days in the week, passing the selected days $Week->build($selectedDays); $i = 0; $temp_week_string = ""; $week_days = array(); while ($Day = $Week->fetch()) { // Build a link string for each day $link = $base_url . '?y=' . $Day->thisYear() . '&m=' . $Day->thisMonth() . '&d=' . $Day->thisDay(); $data_string = $Day->thisYear() . "-" . $Day->thisMonth() . "-" . $Day->thisDay(); $apf_schedule_num = $month_webcast["{$data_string}"] ? $month_webcast["{$data_string}"] : 0; $week_days[] = $data_string; // Check to see if day is selected if ($Day->isSelected()) { $temp_week_string .= '<td class="calCellBusy"><div class="dayNumber"><a href="' . $link . '">' . $Day->thisDay() . '</a></div><div class="dayContents">' . $apf_schedule_num . '</div></td>' . "\n"; // Check to see if day is empty } else { if ($Day->isEmpty()) { $temp_week_string .= '<td class="calCellEmpty"><div class="dayNumber">' . $Day->thisDay() . '</div></td>' . "\n"; } else { $temp_week_string .= '<td class="calCell" ><div class="dayNumber"><a href="' . $link . '" >' . $Day->thisDay() . '</a></div><div class="dayContents">' . $apf_schedule_num . '</div></td>' . "\n"; } } $i++; } $WeekNum = date('W', strtotime($week_days[0])); $main_calendar .= '<td class="week"><a href="###" onclick="document.admin_left_cal.act.value=\'ExportWeek\';document.admin_left_cal.weekdays.value=\'' . implode(",", $week_days) . '\';document.admin_left_cal.week.value=\'' . $WeekNum . '\';document.admin_left_cal.submit();" ><img src="' . URLHelper::getWebBaseURL() . $WebTemplateDir . '/images/xls_image_inline.gif" border="0" valign="middle" />' . $WeekNum . '</a></td>' . "\n"; //"-".$Week->thisDay(). $main_calendar .= $temp_week_string; $main_calendar .= '</tr>' . "\n"; } $cal_header_string = ""; $cal_header_string .= '<th class="week">' . $i18n->_("wk") . '</th>'; $week_day_string = array('0' => $i18n->_("Sun"), '1' => $i18n->_("Mon"), '2' => $i18n->_("Tue"), '3' => $i18n->_("Wed"), '4' => $i18n->_("Thu"), '5' => $i18n->_("Fri"), '6' => $i18n->_("Sat")); for ($i = 0; $i <= 6; $i++) { if ($i == 0 || $i == 6) { $head_class = "class=\"calholiday\""; } else { $head_class = ""; } $cal_header_string .= '<th ' . $head_class . '>' . $week_day_string[$i] . '</th>'; } $header_today = $i18n->_("Today"); $calendar_str = <<<EOD <table class="month" cellspacing="0" cellpadding="0"> <caption> <a href="{$prev}" > << </a> <b>{$calendar_title} <A href="{$today_link}" class="calholiday">{$header_today}</a> </b> <a href="{$next}"> >> </a> </caption> <tr class="calheader"> {$cal_header_string} </tr> {$main_calendar} </table> EOD; return $calendar_str; }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $CurrencyFormat, $DebitOption, $ActiveOption, $i18n, $userid; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; require_once 'I18N/Currency.php'; $currency = new I18N_Currency($CurrencyFormat); $category_arr = $this->getCategory(); $template->setFile(array("MAIN" => "apf_finance_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $apf_finance = DB_DataObject::factory('ApfFinance'); $order = $_GET['order'] ? $_GET['order'] : "DESC"; $orderfield = $_GET['orderfield'] ? $_GET['orderfield'] : "id"; $apf_finance->orderBy($apf_finance->escape($orderfield) . " " . $apf_finance->escape($order)); $apf_finance->setUserid($userid); $max_row = 30; $ToltalNum = $apf_finance->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_finance->limit($start_num, $max_row); $apf_finance->find(); $i = 0; $myData = array(); while ($apf_finance->fetch()) { $myData[] = $apf_finance->toArray(); $i++; } $params = array('totalItems' => $ToltalNum, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'prevImg' => $i18n->_("PrevPage"), 'nextImg' => $i18n->_("NextPage"), 'mode' => 'Jumping', 'extraVars' => array('order' => $_REQUEST['order'], 'orderfield' => $_REQUEST['orderfield'])); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $page_exten = str_replace($pager->_url . "?", "", $pager->_getLinkTagUrl(null)); $id_header_url = showHeaderLink("id", $i18n->_("ID"), $_REQUEST['orderfield'], $_GET['order'], $page_exten, $pager->_url); $debit_header_url = showHeaderLink("debit", $i18n->_("Debit"), $_REQUEST['orderfield'], $_GET['order'], $page_exten, $pager->_url); $create_date_header_url = showHeaderLink("create_date", $i18n->_("CreateDate"), $_REQUEST['orderfield'], $_GET['order'], $page_exten, $pager->_url); $money_header_url = showHeaderLink("money", $i18n->_("Money"), $_REQUEST['orderfield'], $_GET['order'], $page_exten, $pager->_url); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "CATEGORY" => $category_arr[$data['category']], "CREATE_DATE" => $data['create_date'], "AMOUNT" => $data['amount'], "DEBIT" => $DebitOption[$data['debit']], "MONEY" => $currency->format($data['money']), "MEMO" => $data['memo'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "CURRENT_PAGE" => $current_page, "SELECT_BOX" => $selectBox, "ID_HEADER_URL" => $id_header_url, "DEBIT_HEADER_URL" => $debit_header_url, "CREATE_DATE_HEADER_URL" => $create_date_header_url, "MONEY_HEADER_URL" => $money_header_url, "PAGINATION" => $links['all'])); }
function executeList() { global $template, $controller, $WebBaseDir, $WebTemplateDir, $WebTemplateFullPath, $userid, $ClassDir, $ActiveOption, $i18n; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_folders_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $params_id = $controller->getID(); $PID = $params_id ? $params_id : 0; // list folder $apf_folders = DB_DataObject::factory('ApfFolders'); $apf_folders->setParent($PID); $apf_folders->whereAdd(" userid = '{$userid}' OR access = 'public' "); $apf_folders->orderBy('id desc'); $apf_folders->find(); $myData = array(); while ($apf_folders->fetch()) { $row = $apf_folders->toArray(); $row['name'] = "<a href=\"{$WebBaseDir}/document/apf_folders/list/{$row['id']}\">" . $this->getFolderIco() . $row['name'] . "</a>"; $row['download_link'] = $this->getFolderDownloadLink($row['id']); $row['edit_link'] = "<a href=\"{$WebBaseDir}/document/apf_folders/update/{$row['id']}\"><img alt=\"" . $i18n->_("Edit") . "\" title=\"" . $i18n->_("Edit") . "\" src=\"{$WebTemplateFullPath}images/edit_icon.png\" /></a>"; $row['del_action'] = "delfolder"; $myData[] = $row; } // lsit files $apf_files = DB_DataObject::factory('ApfFiles'); $apf_files->setParent($PID); $apf_files->whereAdd(" userid = '{$userid}' OR access = 'public' "); $apf_files->orderBy('id desc'); $apf_files->find(); while ($apf_files->fetch()) { $row = $apf_files->toArray(); $row['name'] = $this->getFileIco($row['ext']) . $row['name']; $row['download_link'] = $this->getFileDownloadLink($row['id']); $row['edit_link'] = ""; $row['del_action'] = "delfile"; $myData[] = $row; } $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("DOWNLOAD_LINK" => $data['download_link'], "EDIT_LINK" => $data['edit_link'], "DEL_ACTION" => $data['del_action'], "ID" => $data['id'], "NAME" => $data['name'], "PARENT" => $data['parent'], "DESCRIPTION" => $data['description'], "PASSWORD" => $data['password'], "GROUPID" => $data['groupid'], "USERID" => $data['userid'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $ToltalNum = $i; $template->setVar(array("WEBDIR" => $WebBaseDir, "NAVIGATOR" => $this->getNavigatorByID($PID), "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "PID" => $PID)); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $ActiveOption; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_contact_category_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $apf_contact_category = DB_DataObject::factory('ApfContactCategory'); $apf_contact_category->orderBy('id desc'); $max_row = 30; $ToltalNum = $apf_contact_category->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_contact_category->limit($start_num, $max_row); $apf_contact_category->find(); $myData = array(); while ($apf_contact_category->fetch()) { $myData[] = $apf_contact_category->toArray(); } $params = array('totalItems' => $ToltalNum, 'perPage' => 10, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "CATEGORY_NAME" => $data['category_name'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "CURRENT_PAGE" => $current_page, "SELECT_BOX" => $selectBox, "PAGINATION" => $links['all'])); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $GenderOption, $i18n, $ActiveOption; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_users_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $apf_users = DB_DataObject::factory('ApfUsers'); $apf_users->orderBy('id desc'); $max_row = 30; $ToltalNum = $apf_users->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_users->limit($start_num, $max_row); $apf_users->find(); while ($apf_users->fetch()) { $myData[] = $apf_users->toArray(); } $params = array('totalItems' => $ToltalNum, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'prevImg' => $i18n->_("PrevPage"), 'nextImg' => $i18n->_("NextPage"), 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $user_group = $this->getGroupByUserid($data['id']); $template->setVar(array("ID" => $data['id'], "GROUP_NAME" => $user_group['group_define_name'], "USER_NAME" => $data['user_name'], "REALNAME" => $data['realname'], "USER_PWD" => $data['user_pwd'], "GENDER" => $GenderOption[$data['gender']], "ADDREES" => $data['addrees'], "PHONE" => $data['phone'], "EMAIL" => showEmail($data['email']), "PHOTO" => imageTag($data['photo']), "ROLE_ID" => $data['role_id'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "CURRENT_PAGE" => $current_page, "SELECT_BOX" => $selectBox, "PAGINATION" => $links['all'])); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $ActiveOption, $i18n, $userid; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_company_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $max_row = 30; $apf_company = DB_DataObject::factory('ApfCompany'); $order = $_GET['order'] ? $_GET['order'] : "DESC"; $orderfield = $_GET['orderfield'] ? $_GET['orderfield'] : "id"; $apf_company->orderBy($apf_company->escape($orderfield) . " " . $apf_company->escape($order)); if (($keyword = trim($_REQUEST['q'])) != "") { $apf_company->whereAdd("name LIKE '%" . $apf_company->escape("{$keyword}") . "%' OR addrees LIKE '%" . $apf_company->escape("{$keyword}") . "%' OR phone LIKE '%" . $apf_company->escape("{$keyword}") . "%' OR link_man LIKE '%" . $apf_company->escape("{$keyword}") . "%' "); } if (($active = trim($_REQUEST['active'])) != "") { $apf_company->whereAdd(" active = '" . $apf_company->escape("{$active}") . "' "); } $apf_company->setUserid($userid); $ToltalNum = $apf_company->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_company->limit($start_num, $max_row); $apf_company->find(); $myData = array(); while ($apf_company->fetch()) { $myData[] = $apf_company->toArray(); } $params = array('totalItems' => $ToltalNum, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'prevImg' => $i18n->_("PrevPage"), 'nextImg' => $i18n->_("NextPage"), 'mode' => 'Jumping', 'extraVars' => array('q' => $_REQUEST['q'], 'active' => $_REQUEST['active'], 'order' => $_REQUEST['order'], 'orderfield' => $_REQUEST['orderfield'])); $pager =& Pager::factory($params); $links = $pager->getLinks(); $current_page = $pager->getCurrentPageID(); $selectBox = $pager->getPageSelectBox(array('autoSubmit' => true)); $page_exten = str_replace($pager->_url . "?", "", $pager->_getLinkTagUrl(null)); $id_header_url = showHeaderLink("id", $i18n->_("ID"), $_REQUEST['orderfield'], $_GET['order'], $page_exten, $pager->_url); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "NAME" => "<a href=\"{$WebBaseDir}/company/apf_company/detail/{$data['id']}\" >" . $data['name'] . "</a>", "ADDREES" => $data['addrees'], "PHONE" => $data['phone'], "FAX" => $data['fax'], "EMAIL" => showEmail($data['email']), "PHOTO" => $data['photo'], "HOMEPAGE" => $data['homepage'], "EMPLOYEE" => $data['employee'], "BANKROLL" => $data['bankroll'], "LINK_MAN" => $data['link_man'], "INCORPORATOR" => $data['incorporator'], "INDUSTRY" => $data['industry'], "PRODUCTS" => $data['products'], "MEMO" => $data['memo'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("KEYWORD" => textTag("q", $_REQUEST['q']), "ACTIVEOPTION" => selectTag("active", $ActiveOption, $_REQUEST['active']), "WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "CURRENT_PAGE" => $current_page, "SELECT_BOX" => $selectBox, "ID_HEAD_URL" => $id_header_url, "PAGINATION" => $links['all'])); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $CurrencyFormat, $ActiveOption, $i18n; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; require_once 'I18N/Currency.php'; $template->setFile(array("MAIN" => "apf_news_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $currency = new I18N_Currency($CurrencyFormat); $category_arr = array("" => $i18n->_("All")) + $this->getCategory(); $max_row = 30; $apf_news = DB_DataObject::factory('ApfNews'); $apf_news->orderBy('apf_news.id desc'); if (($keyword = trim($_REQUEST['q'])) != "") { $apf_news->whereAdd("title LIKE '%" . $apf_news->escape("{$keyword}") . "%' OR content LIKE '%" . $apf_news->escape("{$keyword}") . "%' "); } if (($category = trim($_REQUEST['category'])) != "") { $apf_news->whereAdd(" category_id = '" . $apf_news->escape("{$category}") . "' "); } if (($active = trim($_REQUEST['active'])) != "") { $apf_news->whereAdd(" active = '" . $apf_news->escape("{$active}") . "' "); } $ToltalNum = $apf_news->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_news->limit($start_num, $max_row); $apf_news->find(); $i = 0; $myData = array(); while ($apf_news->fetch()) { $myData[] = $apf_news->toArray(); $i++; } $tmpData = $ToltalNum > $max_row ? array_pad($myData, $ToltalNum, array()) : $myData; $params = array('itemData' => $tmpData, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $page_data = $pager->getPageData(); $links = $pager->getLinks(); $selectBox = $pager->getPerPageSelectBox(); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "CATEGORY_ID" => $category_arr[$data['category_id']], "TITLE" => "<a href=\"###\" onclick=\"popOpenWindow('{$WebBaseDir}/news/apf_news/detail/{$data['id']}', '', '', 600, 600, 'yes')\">" . $data['title'] . "</a>", "CONTENT" => $data['content'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("KEYWORD" => textTag("q", $_REQUEST['q']), "CATEGORYOPTION" => selectTag("category", $category_arr, $_REQUEST['category']), "ACTIVEOPTION" => selectTag("active", $ActiveOption, $_REQUEST['active']), "WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "PAGINATION" => $links['all'])); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $ClassDir, $luadmin; $rights = $luadmin->perm->getRights(); include_once $ClassDir . "URLHelper.class.php"; $template->setFile(array("MAIN" => "apf_rights_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $i = 0; foreach ($rights as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['right_id'], "RIGHT_ID" => $data['right_id'], "AREA_ID" => $data['area_id'], "RIGHT_DEFINE_NAME" => $data['right_define_name'], "HAS_IMPLIED" => $data['has_implied'])); $template->parse("list_block", "main_list", TRUE); $i++; } $ToltalNum = $i; $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum)); }
function executeList() { global $template, $WebBaseDir, $WebTemplateDir, $i18n, $ClassDir, $controller, $ActiveOption; include_once $ClassDir . "URLHelper.class.php"; require_once 'Pager/Pager.php'; $template->setFile(array("MAIN" => "apf_news_category_list.html")); $template->setBlock("MAIN", "main_list", "list_block"); $max_row = 10; $apf_news_category = DB_DataObject::factory('ApfNewsCategory'); if (($pid = trim($controller->getID())) != "") { $apf_news_category->whereAdd("pid = '" . $apf_news_category->escape($pid) . "' "); $template->setVar(array("P_ID" => $pid)); } else { $apf_news_category->whereAdd("pid = '0' "); } $apf_news_category->orderBy('orderid ASC'); $ToltalNum = $apf_news_category->count(); $start_num = !isset($_GET['entrant']) ? 0 : ($_GET['entrant'] - 1) * $max_row; $apf_news_category->limit($start_num, $max_row); $apf_news_category->find(); $i = 0; $myData = array(); while ($apf_news_category->fetch()) { $myData[] = $apf_news_category->toArray(); $i++; } $tmpData = $ToltalNum > $max_row ? array_pad($myData, $ToltalNum, array()) : $myData; $params = array('itemData' => $tmpData, 'perPage' => $max_row, 'delta' => 8, 'append' => true, 'separator' => ' | ', 'clearIfVoid' => false, 'urlVar' => 'entrant', 'useSessions' => true, 'closeSession' => true, 'mode' => 'Jumping', 'extraVars' => array()); $pager =& Pager::factory($params); $page_data = $pager->getPageData(); $links = $pager->getLinks(); $selectBox = $pager->getPerPageSelectBox(); $i = 0; foreach ($myData as $data) { $i % 2 == 0 ? $list_td_class = "admin_row_0" : ($list_td_class = "admin_row_1"); $template->setVar(array("LIST_TD_CLASS" => $list_td_class)); $template->setVar(array("ID" => $data['id'], "PID" => $data['pid'], "CATEGORY_NAME" => $data['category_name'], "ORDERID" => $data['orderid'], "ACTIVE" => $ActiveOption[$data['active']], "ADD_IP" => $data['add_ip'], "CREATED_AT" => $data['created_at'], "UPDATE_AT" => $data['update_at'])); $parent_id = $data['pid']; $template->parse("list_block", "main_list", TRUE); $i++; } $template->setVar(array("WEBDIR" => $WebBaseDir, "WEBTEMPLATEDIR" => URLHelper::getWebBaseURL() . $WebTemplateDir, "TOLTAL_NUM" => $ToltalNum, "PAGINATION" => $links['all'])); if ($parent_id) { $apf_news_category = DB_DataObject::factory('ApfNewsCategory'); $apf_news_category->get($parent_id); $template->setVar(array("PARENTLIST" => navButtonTag("parent_id", $i18n->_("Parent Listing"), $WebBaseDir . "/news/apf_news_category/list/" . $apf_news_category->getPid()))); } else { if ($controller->getID()) { $template->setVar(array("PARENTLIST" => navButtonTag("parent_id", $i18n->_("Parent Listing"), $WebBaseDir . "/news/apf_news_category/list"))); } } }