本文整理汇总了PHP中URLHelper::getWebBaseURL方法的典型用法代码示例。如果您正苦于以下问题:PHP URLHelper::getWebBaseURL方法的具体用法?PHP URLHelper::getWebBaseURL怎么用?PHP URLHelper::getWebBaseURL使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类URLHelper
的用法示例。
在下文中一共展示了URLHelper::getWebBaseURL方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callMobilePhone
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;
}
示例2: executeList
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"));
}
示例3: executeList
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"));
}
示例4: executeList
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']));
}
示例5: executeList
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;
}
示例6: executeList
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']));
}
示例7: executeTech
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']));
}
示例8: getCallIco
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;
}
示例9: define
<?php
/**
*
* front.php.
*
* @package core
* @author John.meng <arzen1013@gmail.com>
* @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();
示例10: executeList
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']));
}
示例11: I18N_Messages_File
$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));
示例12: executeList
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));
}
示例13: executeList
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']));
}
示例14: renderMonthView
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>
//.........这里部分代码省略.........
示例15: executeList
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']));
}