本文整理汇总了PHP中Template::set_block方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::set_block方法的具体用法?PHP Template::set_block怎么用?PHP Template::set_block使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Template
的用法示例。
在下文中一共展示了Template::set_block方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: disp
function disp()
{
$t = new Template('../template/system');
$t->set_file('f', 'loginfo.html');
$t->set_block('f', 'row', 'r');
$rs = $this->dbObj->GetArray('select lt.logtypename,l.* from ' . WEB_ADMIN_TABPOX . 'log l,' . WEB_ADMIN_TABPOX . 'logtype lt where l.logtypeid=lt.logtypeid and l.srcuserid=' . $this->getUid());
foreach ($rs as $v) {
$t->set_var($v);
$ok = $this->loginObj->_superid ? false : true;
$t->set_var('del', $this->getDelStr($this->getUid(), $v['logid'], 'a', 'loginfo.php?deltype=log', $ok));
$t->parse('r', 'row', true);
}
$t->set_block('f', 'row2', 'r2');
$rs = $this->dbObj->GetArray("select u.username,m.* from " . WEB_ADMIN_TABPOX . "message m," . WEB_ADMIN_TABPOX . "user u where m.userid = u.userid and msgtitle='组长登录' and sendtoids like '" . $this->getUid() . "'");
foreach ($rs as $v) {
if (!$v['hadratify']) {
if (!$this->loginObj->_superid) {
$v['accept'] = '<a href="loginfo.php?action=accept&id=' . $v['msgid'] . '">认可</a>';
} else {
$v['accept'] = '认可';
}
} else {
$v['accept'] = '已认可';
}
$t->set_var($v);
$ok = $this->loginObj->_superid ? false : true;
$t->set_var('del', $this->getDelStr($this->getUid(), $v['msgid'], 'a', 'loginfo.php?deltype=msg', $ok));
$t->parse('r2', 'row2', true);
}
$t->parse('out', 'f');
$t->p('out');
}
示例2: goDispAppend
function goDispAppend()
{
$t = new Template('../template/system');
$t->set_file('f', 'customerdetail.html');
//$t -> set_block('f','customer','c');
$t->set_block('f', 'area', 'a');
$t->set_block('f', 'sale', 's');
if ($this->isAppend) {
$t->set_var('action', 'add');
$t->set_var('actionName', '增加');
} else {
$updid = $_GET[MODIFY . 'id'] + 0;
$t->set_var($this->dbObj->GetRow('SELECT * FROM ' . WEB_ADMIN_TABPOX . 'customer WHERE customerid = ' . $updid));
$t->set_var('updid', $updid);
$t->set_var('action', 'upd');
$t->set_var('actionName', '修改');
}
$t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
//$this->PPClass();
$t->set_var('area');
$t->set_var('area', $this->PPClass());
$t->parse('a', 'area', true);
$t->set_var('sale', $this->PPClass_sale());
$t->parse('s', 'sale', true);
$t->parse('out', 'f');
$t->p('out');
}
示例3: derive_menu_titles
function derive_menu_titles($page)
{
if (!class_exists("Template")) {
require_once "./classes/template.inc";
}
global $language;
$menu_tpl = new Template("./templates/{$language}", "keep");
$menu_tpl->set_file("menu", "menu.ihtml");
$menu_tpl->set_block("menu", $page);
$menu_tpl->set_block($page, "menu_1");
$menu_tpl->set_block($page, "menu_2");
return array($menu_tpl->get_var("menu_1"), $menu_tpl->get_var("menu_2"));
}
示例4: goDispAppend
function goDispAppend()
{
$t = new Template('../template/basic');
$t->set_file('f', 'tb_produre_b_detail.html');
$t->set_block('f', 'gender', 'g');
if ($this->isAppend) {
$t->set_var('action', 'add');
$t->set_var('actionName', '增加');
$t->set_var('createtime', date("Y-m-d H:i:s"));
$t->set_var('userid', $this->getUid());
} else {
$updid = $_GET[MODIFY . 'id'] + 0;
$t->set_var($this->dbObj->GetRow('SELECT * FROM ' . WEB_ADMIN_TABPOX . 'produre WHERE produre_id = ' . $updid));
$t->set_var('updid', $updid);
$t->set_var('action', 'upd');
$t->set_var('actionName', '修改');
echo 'SELECT * FROM ' . WEB_ADMIN_TABPOX . 'produre WHERE produre_id = ' . $updid;
$inrs =& $this->dbObj->Execute('SELECT * FROM ' . WEB_ADMIN_TABPOX . 'produre WHERE produre_id = ' . $updid);
while ($inrrs =& $inrs->FetchRow()) {
$t->set_var($inrrs);
}
$inrs->Close();
}
$t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
$t->parse('out', 'f');
$t->p('out');
}
示例5: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('Containers.Content.View');
$this->load->model('containers_model', null, true);
$this->load->model(array('purchase_orders/purchase_orders_model', 'countries_model', 'product/product_model', 'uom/uom_model'));
$this->lang->load('containers');
Assets::add_css('flick/jquery-ui-1.8.13.custom.css');
Assets::add_js('jquery-ui-1.8.13.min.js');
Template::set_block('sub_nav', 'content/_sub_nav');
Assets::add_module_js('containers', 'containers.js');
$po_refs_select = $this->purchase_orders_model->get_po_ref_select();
Template::set('po_refs_select', $po_refs_select);
$po_refs = $this->purchase_orders_model->get_po_refs();
Template::set('po_refs', $po_refs);
$countries_select = $this->countries_model->get_countries_select();
Template::set('countries_select', $countries_select);
$countries = $this->countries_model->get_countries();
Template::set('countries', $countries);
$uoms_select = $this->uom_model->get_uoms_select();
Template::set('uoms_select', $uoms_select);
$uoms = $this->uom_model->get_uoms();
Template::set('uoms', $uoms);
$products_select = $this->product_model->get_products_select();
Template::set('products_select', $products_select);
$products = $this->product_model->get_products();
Template::set('products', $products);
}
示例6: disp
function disp()
{
//定义模板
$t = new Template('../template/basic');
$t->set_file('f', 'upmorefile.html');
$t->unknowns = "remove";
$t->left_delimiter = "[#";
//修改左边界符为[#
$t->right_delimiter = "#]";
//修改右边界符#]
$t->set_block('f', 'mainlist', 'ml');
//设置分类
$t->set_var('ml');
$inrs =& $this->dbObj->Execute('select * from ' . WEB_ADMIN_TABPOX . 'apparatus where agencyid =' . $_SESSION["currentorgan"]);
//echo 'select * from '.WEB_ADMIN_TABPOX.'roomgroup where agencyid ='.$_SESSION["currentorgan"];
while ($inrrs =& $inrs->FetchRow()) {
$t->set_var($inrrs);
$t->parse('ml', 'mainlist', true);
}
$inrs->Close();
$t->set_var('add', $this->getAddStr('img'));
$t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
$t->parse('out', 'f');
$t->p('out');
}
示例7: MG_selectUsers
function MG_selectUsers($page)
{
global $glversion, $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01;
$retval = '';
$T = new Template($_MG_CONF['template_path']);
$T->set_file('admin', 'createmembers.thtml');
$T->set_var(array('site_admin_url' => $_CONF['site_admin_url'], 'site_url' => $_CONF['site_url'], 'xhtml' => XHTML));
$T->set_block('admin', 'UserRow', 'uRow');
$start = $page * 50;
$end = 50;
$sql = "SELECT COUNT(gl.uid) AS count " . "FROM {$_TABLES['users']} AS gl " . "LEFT JOIN {$_TABLES['mg_userprefs']} AS mg ON gl.uid=mg.uid " . "WHERE gl.status = 3 AND gl.uid > 2 AND (mg.member_gallery IS NULL OR mg.member_gallery < 1)";
$result = DB_query($sql);
list($total_records) = DB_fetchArray($result);
$sql = "SELECT gl.uid, gl.status, gl.username, gl.fullname, mg.member_gallery " . "FROM {$_TABLES['users']} AS gl " . "LEFT JOIN {$_TABLES['mg_userprefs']} AS mg ON gl.uid=mg.uid " . "WHERE gl.status = 3 AND gl.uid > 2 AND (mg.member_gallery IS NULL OR mg.member_gallery < 1) " . "ORDER BY gl.username ASC LIMIT {$start},{$end}";
$result = DB_query($sql);
while ($row = DB_fetchArray($result)) {
if ($glversion[1] < 4) {
$row['status'] = 3;
}
$uid = $row['uid'];
$remote = SEC_inGroup("Remote Users", $uid) ? '(r)' : '';
$username = $row['username'];
$member_gallery = $row['member_gallery'];
$T->set_var(array('uid' => $uid, 'username' => $username . ' ' . $remote . ' - ' . $row['fullname'], 'select' => '<input type="checkbox" name="user[]" value="' . $uid . '"' . XHTML . '>'));
$T->parse('uRow', 'UserRow', true);
}
$T->set_var(array('lang_userid' => $LANG_MG01['userid'], 'lang_username' => $LANG_MG01['username'], 'lang_select' => $LANG_MG01['select'], 'lang_checkall' => $LANG_MG01['check_all'], 'lang_uncheckall' => $LANG_MG01['uncheck_all'], 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_reset' => $LANG_MG01['reset'], 's_form_action' => $_MG_CONF['admin_url'] . 'createmembers.php', 'pagenav' => COM_printPageNavigation($_MG_CONF['admin_url'] . 'createmembers.php', $page + 1, ceil($total_records / 50))));
$retval .= $T->finish($T->parse('output', 'admin'));
return $retval;
}
示例8: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('PO_Fulfillment.Content.View');
$this->load->model('po_fulfillment_model', null, true);
$this->load->model(array('uom/uom_model', 'vendor_profile/vendor_profile_model', 'product/product_model', 'purchase_orders/purchase_orders_model'));
$this->lang->load('po_fulfillment');
Template::set_block('sub_nav', 'content/_sub_nav');
Assets::add_module_js('po_fulfillment', 'po_fulfillment.js');
$uoms_select = $this->uom_model->get_uoms_select();
Template::set('uoms_select', $uoms_select);
$uoms = $this->uom_model->get_uoms();
Template::set('uoms', $uoms);
$vendors_select = $this->vendor_profile_model->get_vendors_select();
Template::set('vendors_select', $vendors_select);
$vendors = $this->vendor_profile_model->get_vendors();
Template::set('vendors', $vendors);
$products_select = $this->product_model->get_products_select();
Template::set('products_select', $products_select);
$products = $this->product_model->get_products();
Template::set('products', $products);
$pos_select = $this->purchase_orders_model->get_pos_select();
Template::set('pos_select', $pos_select);
$pos = $this->purchase_orders_model->get_pos();
Template::set('pos', $pos);
}
示例9: disp
function disp()
{
//定义模板
$t = new Template('../template/getdata');
$t->set_file('f', 'getstockproduce.html');
$t->unknowns = "keep";
$t->left_delimiter = "[#";
//修改左边界符为[#
$t->right_delimiter = "#]";
//修改右边界符#]
$t->set_block('f', 'mainlist', 'ml');
$category = $_GET["category"];
$keywords = $_GET["keywords"];
$ftable = $_GET["ftable"];
$condition = '';
if ($category != '' && $keywords != '') {
if ($ftable == '') {
$condition = $category . ' like "%' . $keywords . '%"';
} else {
$condition = $category . ' like " %' . $keywords . '%"';
}
}
$pageid = $_GET[pageid];
$pageid = $pageid ? $pageid : 1;
$pageid = intval($pageid);
$psize = $this->getValue('pagesize');
$psize = $psize ? $psize : 20;
$offset = $pageid > 0 ? ($pageid - 1) * $psize : 0;
//设置分类
$t->set_var('ml');
if ($condition != '' && $ftable == '') {
$sql = 'select * from ' . WEB_ADMIN_TABPOX . 'stock where agencyid =' . $_SESSION["currentorgan"] . ' and ' . $condition;
} else {
if ($ftable != '') {
$sql = 'select * from ' . WEB_ADMIN_TABPOX . 'stock p INNER JOIN ' . WEB_ADMIN_TABPOX . $ftable . " f on p." . $ftable . "_id =f." . $ftable . "_id where f." . $category . " like '%" . $keywords . "%' and p.agencyid =" . $_SESSION["currentorgan"];
} else {
$sql = 'select * from ' . WEB_ADMIN_TABPOX . 'stock where agencyid =' . $_SESSION["currentorgan"];
}
}
$inrs =& $this->dbObj->Execute($sql . " ORDER BY stock_id DESC LIMIT " . $offset . " , " . $psize);
$result =& $this->dbObj->Execute($sql);
$count = $result->RecordCount();
$t->set_var('pagelist', $this->page("?category=" . $category . "&keywords=" . urlencode($keywords) . "&ftable=" . $ftable, $count, $psize, $pageid));
$t->set_var('recordcount', $count);
while ($inrrs =& $inrs->FetchRow()) {
$t->set_var($inrrs);
$produce = $this->dbObj->Getrow('select * from ' . WEB_ADMIN_TABPOX . 'produce where produce_id =' . $inrrs["produce_id"]);
$t->set_var($produce);
$t->set_var('warehouse_name', $this->dbObj->getone('select warehouse_name from ' . WEB_ADMIN_TABPOX . 'warehouse where warehouse_id =' . $inrrs["warehouse_id"]));
$t->set_var('brand_name', $this->dbObj->getone('select brand_name from ' . WEB_ADMIN_TABPOX . 'brand where brand_id =' . $produce["brandid"]));
$t->set_var('standardunit', $this->dbObj->getone('select unit_name from ' . WEB_ADMIN_TABPOX . 'unit where unit_id =' . $produce["standardunit"]));
$t->set_var('category_name', $this->dbObj->getone('select category_name from ' . WEB_ADMIN_TABPOX . 'procatalog where category_id =' . $produce["categoryid"]));
$t->parse('ml', 'mainlist', true);
}
$inrs->Close();
$t->set_var('warehouselist', $this->selectlist('warehouse', 'warehouse_id', 'warehouse_name', $_GET['keywords']));
$t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
$t->parse('out', 'f');
$t->p('out');
}
示例10: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
parent::__construct();
$this->auth->restrict('Quotes.Content.View');
$this->load->model('quotes_model', null, true);
$this->load->model(array('uom/uom_model', 'product/product_model', 'vendor_profile/vendor_profile_model'));
$this->lang->load('quotes');
Assets::add_css('flick/jquery-ui-1.8.13.custom.css');
Assets::add_js('jquery-ui-1.8.13.min.js');
Template::set_block('sub_nav', 'content/_sub_nav');
Assets::add_module_js('quotes', 'quotes.js');
$uoms_select = $this->uom_model->get_uoms_select();
Template::set('uoms_select', $uoms_select);
$uoms = $this->uom_model->get_uoms();
Template::set('uoms', $uoms);
$products_select = $this->product_model->get_products_select();
Template::set('products_select', $products_select);
$products = $this->product_model->get_products();
Template::set('products', $products);
/*
$vendors_select = $this->vendors_model->get_vendors_select();
Template::set('vendors_select', $vendors_select);
$vendors = $this->vendors_model->get_vendors();
Template::set('vendors', $vendors);
*/
$vendors_select = $this->vendor_profile_model->get_vendors_select();
Template::set('vendors_select', $vendors_select);
$vendors = $this->vendor_profile_model->get_vendors();
Template::set('vendors', $vendors);
}
示例11: MG_displaySessions
function MG_displaySessions()
{
global $_CONF, $_MG_CONF, $_TABLES, $LANG_MG01;
$retval = '';
$T = new Template($_MG_CONF['template_path']);
$T->set_file('sessions', 'sessions.thtml');
$T->set_var(array('site_url' => $_CONF['site_url'], 'xhtml' => XHTML, 's_form_action' => $_MG_CONF['admin_url'] . 'sessions.php', 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_delete' => $LANG_MG01['delete'], 'lang_select' => $LANG_MG01['select'], 'lang_checkall' => $LANG_MG01['check_all'], 'lang_uncheckall' => $LANG_MG01['uncheck_all'], 'lang_session_description' => $LANG_MG01['description'], 'lang_session_owner' => $LANG_MG01['owner'], 'lang_session_count' => $LANG_MG01['count'], 'lang_action' => $LANG_MG01['action']));
$T->set_block('sessions', 'sessItems', 'sItems');
$sql = "SELECT * FROM {$_TABLES['mg_sessions']} WHERE session_status=1";
$result = DB_query($sql);
$numRows = DB_numRows($result);
$rowclass = 0;
if ($numRows == 0) {
// we have no active sessions
$T->set_var('lang_no_sessions', $LANG_MG01['no_sessions']);
$T->set_var('noitems', true);
$T->set_var('sItems', '');
} else {
$totalSess = $numRows;
$T->set_block('sessions', 'sessRow', 'sRow');
for ($x = 0; $x < $numRows; $x++) {
$row = DB_fetchArray($result);
$res2 = DB_query("SELECT COUNT(id) FROM {$_TABLES['mg_session_items']} " . "WHERE session_id='" . $row['session_id'] . "' AND status=0");
list($count) = DB_fetchArray($res2);
$T->set_var(array('row_class' => $rowclass % 2 ? '2' : '1', 'session_id' => $row['session_id'], 'session_owner' => DB_getItem($_TABLES['users'], 'username', "uid={$row['session_uid']}"), 'session_description' => $row['session_description'], 'session_continue' => $_MG_CONF['site_url'] . '/batch.php?mode=continue&sid=' . $row['session_id'] . '&limit=0', 'count' => $count));
$T->parse('sRow', 'sessRow', true);
$rowclass++;
}
$T->parse('sItems', 'sessItems');
}
$retval .= $T->finish($T->parse('output', 'sessions'));
return $retval;
}
示例12: MG_adminEXIF
function MG_adminEXIF()
{
global $_TABLES, $_MG_CONF, $_CONF, $LANG_MG01, $LANG_MG04;
$retval = '';
$T = new Template($_MG_CONF['template_path'] . '/admin/');
$T->set_file('admin', 'exif_tags.thtml');
$T->set_var('site_url', $_CONF['site_url']);
$T->set_var('site_admin_url', $_CONF['site_admin_url']);
$T->set_block('admin', 'exifRow', 'eRow');
$sql = "SELECT * FROM {$_TABLES['mg_exif_tags']}";
$result = DB_query($sql);
$nRows = DB_numRows($result);
for ($i = 0; $i < $nRows; $i++) {
$row = DB_fetchArray($result);
$properties[] = $row['name'];
$tag[$row['name']][] = $row['selected'];
}
$exifKeys = getExifKeys();
$x = 0;
foreach ($properties as $property) {
$title = $exifKeys[$property][0];
$T->set_var(array('exif_tag' => $title, 'selected' => $tag[$property][0] ? ' checked="checked"' : '', 'tag' => $property, 'rowcounter' => $x % 2));
$T->parse('eRow', 'exifRow', true);
$x++;
}
$T->set_var(array('lang_select' => $LANG_MG01['select'], 'lang_exiftag' => $LANG_MG01['exiftag'], 'lang_exif_admin_help' => $LANG_MG01['exif_admin_help'], 'lang_check_all' => $LANG_MG01['check_all'], 'lang_uncheck_all' => $LANG_MG01['uncheck_all'], 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 's_form_action' => $_MG_CONF['admin_url'] . 'exif_admin.php'));
$T->parse('output', 'admin');
$retval .= $T->finish($T->get_var('output'));
return $retval;
}
示例13: disp
function disp()
{
//定义模板
$t = new Template('../template/basic');
$t->set_file('f', 'select_produce.html');
$t->unknowns = "remove";
$t->left_delimiter = "[#";
//修改左边界符为[#
$t->right_delimiter = "#]";
//修改右边界符#]
$t->set_block('f', 'mainlist', 'ml');
//设置分类
$t->set_var('ml');
$inrs =& $this->dbObj->Execute('select * from ' . WEB_ADMIN_TABPOX . 'produce where agencyid =' . $_SESSION["currentorgan"]);
//echo 'select * from '.WEB_ADMIN_TABPOX.'roomgroup where agencyid ='.$_SESSION["currentorgan"];
while ($inrrs =& $inrs->FetchRow()) {
$t->set_var($inrrs);
$t->set_var('viceunit', $this->dbObj->getone('select unit_name from ' . WEB_ADMIN_TABPOX . 'unit where unit_id =' . $inrrs["viceunit"]));
$t->set_var('standardunit', $this->dbObj->getone('select unit_name from ' . WEB_ADMIN_TABPOX . 'unit where unit_id =' . $inrrs["standardunit"]));
$t->set_var('brand_name', $this->dbObj->getone('select brand_name from ' . WEB_ADMIN_TABPOX . 'brand where brand_id =' . $inrrs["brandid"]));
$t->set_var('category_name', $this->dbObj->getone('select category_name from ' . WEB_ADMIN_TABPOX . 'procatalog where category_id =' . $inrrs["categoryid"]));
$t->parse('ml', 'mainlist', true);
}
$inrs->Close();
$t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
$t->parse('out', 'f');
$t->p('out');
}
示例14: __construct
public function __construct()
{
parent::__construct();
$this->auth->restrict('Simplenews.Developer.View');
$this->lang->load('simplenews');
Template::set_block('sub_nav', 'developer/_sub_nav');
}
示例15: disp
function disp()
{
//定义模板
$t = new Template('../template/system');
$t->unknowns = "keep";
$t->left_delimiter = "[#";
//修改左边界符为[##
$t->right_delimiter = "#]";
//修改右边界符##]
$t->set_file('f', 'agency.html');
$t->set_block('f', 'agency', 'a');
$t->set_var('add', $this->getAddStr('img'));
//设置机构
$t->set_var('a');
$inrs =& $this->dbObj->Execute("select * from " . WEB_ADMIN_TABPOX . "agency");
while ($inrrs =& $inrs->FetchRow()) {
$t->set_var($inrrs);
$t->set_var('upd', $this->getUpdStr($inrrs['agency_id'], $inrrs['agency_id'], 'img'));
$t->set_var('del', $this->getDelStr($inrrs['agency_id'], $inrrs['agency_id'], 'img'));
$t->set_var('agencytype_name', $this->dbObj->getone('select agencytype_name from ' . WEB_ADMIN_TABPOX . 'agencytype where agencytype_id=' . $inrrs["agencytype_id"]));
$t->parse('a', 'agency', true);
}
$inrs->Close();
$t->set_var('pagelist', $this->page("agent.php?qgtype=" . $_GET[qgtype] . "&Sale_ID=" . $_GET[Sale_ID], $count, $psize, $pageid));
$t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
$t->parse('out', 'f');
$t->p('out');
}