当前位置: 首页>>代码示例>>PHP>>正文


PHP Template::parse方法代码示例

本文整理汇总了PHP中Template::parse方法的典型用法代码示例。如果您正苦于以下问题:PHP Template::parse方法的具体用法?PHP Template::parse怎么用?PHP Template::parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Template的用法示例。


在下文中一共展示了Template::parse方法的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');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:32,代码来源:loginfo.php

示例2: disp

 function disp()
 {
     //定义模板
     $t = new Template('../template/system');
     $t->unknowns = "keep";
     $t->left_delimiter = "[#";
     //修改左边界符为[##
     $t->right_delimiter = "#]";
     //修改右边界符##]
     $t->set_file('f', 'changloginorgan.html');
     $t->set_block('f', 'agencylist', 'al');
     $t->set_var('add', $this->getAddStr('img'));
     //设置机构
     $t->set_var('al');
     $inrs =& $this->dbObj->Execute("select * from " . WEB_ADMIN_TABPOX . "agency where agencytype_id=4 order by agency_id desc");
     while ($inrrs =& $inrs->FetchRow()) {
         $t->set_var($inrrs);
         $t->set_var('agency_id', $inrrs['agency_id']);
         $t->set_var('agency_easyname', $inrrs['agency_easyname']);
         $t->parse('al', 'agencylist', 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');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:27,代码来源:changloginorgan.php

示例3: 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');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:25,代码来源:upmorefile_equip=.php

示例4: 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;
}
开发者ID:spacequad,项目名称:glfusion,代码行数:30,代码来源:exif_admin.php

示例5: derive_menu

function derive_menu($page, $object, $path = "", $access = 3)
{
    global $language;
    global $treeview;
    global $treeview_mini;
    global $show_hidden;
    global $config_doc_root;
    global $config_webserver_ip;
    global $config_server_ip;
    global $steam;
    if (!class_exists("Template")) {
        require_once "{$config_doc_root}/classes/template.inc";
    }
    if ($access > 1) {
        $block = "menu_spec_write";
    } else {
        $block = "menu_spec_read";
    }
    if ($access == 4) {
        $block = "menu_spec_annotate";
    }
    $menu_tpl = new Template("{$config_doc_root}/templates/{$language}", "keep");
    $menu_tpl->set_file("menu", "menu.ihtml");
    $menu_tpl->set_block("menu", "blueprint");
    $menu_tpl->set_block("menu", $page);
    $menu_tpl->set_block($page, $block);
    $menu_tpl->set_block("menu", "general_menu");
    $menu_tpl->set_var(array("DUMMY" => "", "ROOTDIR" => $config_webserver_ip, "OBJECT_ID" => $object->id, "OBJECT_CLASS" => $object->class, "OBJECT_PATH" => $path, "USER_NAME" => $steam->login_arguments[0], "STEAM_SERVER" => $config_server_ip));
    //parse specific menu
    $menu_tpl->parse("SPECIFIC_MENU", $block, 1);
    $menu_tpl->parse("SPECIFIC_MENU", "general_menu", 1);
    $menu_tpl->parse("OUT", "blueprint");
    return $menu_tpl->get_var("OUT");
}
开发者ID:rolwi,项目名称:koala,代码行数:34,代码来源:derive_menu-old.php

示例6: 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');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:60,代码来源:getstockproduce.php

示例7: disp

 function disp()
 {
     $t = new Template(WEB_ADMIN_TMPPATH);
     $dispObj = new DispAttachRule(&$this->dbObj, $this->getUid());
     $t->set_file('f', 'pageconfig.html');
     $t->set_block('f', 'row', 'r');
     $p = $_GET['pageid'] + 0;
     $sql = "\r\n\t\t\tSELECT c.configvalue AS userdefalut,o.* FROM " . WEB_ADMIN_TABPOX . "otherrule o \r\n\t\t\t\tLEFT OUTER JOIN " . WEB_ADMIN_TABPOX . "config c ON ( (o.otherruleid = c.otherruleid) AND (c.userid = " . $this->getUid() . ") ) \r\n\t\t\tWHERE (o.isrule = 0) AND (o.issystemvar = 0) AND (o.ruleid = {$p})\r\n\t\t";
     $rs = $this->dbObj->GetArray($sql);
     foreach ($rs as $v) {
         $t->set_var($dispObj->disp($v, $v['userdefalut']));
         $t->parse('r', 'row', true);
     }
     $r = '';
     $m = new Menu(&$this->dbObj);
     $s = $m->getRelating($p);
     for ($i = 0; $i < count($s); $i++) {
         if ($i == 0) {
             $r = $s[$i]['rulename'];
         } else {
             $r .= ' > ' . $s[$i]['rulename'];
         }
     }
     $t->set_var('updid', $p);
     $t->set_var('address', $r);
     $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
     $t->parse('out', 'f');
     $t->p('out');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:29,代码来源:pageconfig.php

示例8: goDispAppend

 function goDispAppend()
 {
     $t = new Template('../template/system');
     $t->set_file('f', 'contactdetail.html');
     $t->set_block('f', 'gender', 'g');
     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 . 'contact WHERE contactid = ' . $updid));
         $t->set_var('updid', $updid);
         $t->set_var('action', 'upd');
         $t->set_var('actionName', '修改');
         $inrs2 =& $this->dbObj->Execute("select * from " . WEB_ADMIN_TABPOX . "contact where contactid =" . $updid);
         while ($inrrs2 =& $inrs2->FetchRow()) {
             $sex = $inrrs2['gender'];
         }
         $inrs2->Close();
     }
     $t->set_var('agentid', $_GET['agentid']);
     $t->set_var('shopid', $_GET['shopid']);
     $t->set_var('gender', $this->gender($sex));
     $t->parse('g', 'gender', true);
     $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
     $t->parse('out', 'f');
     $t->p('out');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:28,代码来源:contact.php

示例9: draw

function draw()
{
    global $_TABLES, $_CONF, $LANG_ECOM;
    $T = new Template($_CONF['path'] . 'plugins/ecommerce/templates/admin');
    $T->set_file(array('sales_tax' => 'sales_tax.thtml', 'sales_tax_row' => 'sales_tax_row.thtml'));
    $T->set_var('msg_112', $LANG_ECOM[112]);
    $T->set_var('msg_113', $LANG_ECOM[113]);
    //Get left colunm
    $res = DB_query("SELECT ecom_tax_code, ecom_tax_id FROM {$_TABLES['ecom_tax']} WHERE ecom_tax_enabled = false");
    while ($row = DB_fetchArray($res)) {
        $T->set_var('tax_code', $row['ecom_tax_code']);
        $T->set_var('link', 'index.php?op=tax&add=');
        $T->set_var('tax_id', $row['ecom_tax_id']);
        $T->set_var('display', 'add');
        $T->parse('disabled_tax', 'sales_tax_row', true);
    }
    //Get right colunm
    $T->set_var('msg_114', $LANG_ECOM[114]);
    $res = DB_query("SELECT ecom_tax_code, ecom_tax_id FROM {$_TABLES['ecom_tax']} WHERE ecom_tax_enabled = true");
    while ($row = DB_fetchArray($res)) {
        $T->set_var('tax_code', $row['ecom_tax_code']);
        $T->set_var('link', 'index.php?op=tax&remove=');
        $T->set_var('tax_id', $row['ecom_tax_id']);
        $T->set_var('display', 'remove');
        $T->parse('enabled_tax', 'sales_tax_row', true);
    }
    $T->parse('output', 'sales_tax');
    echo $T->finish($T->get_var('output'));
}
开发者ID:glFusion,项目名称:ecommerce,代码行数:29,代码来源:sales_tax.php

示例10: 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;
}
开发者ID:mistgrass,项目名称:geeklog-ivywe,代码行数:30,代码来源:createmembers.php

示例11: disp

 function disp()
 {
     //定义模板
     $template = $_GET["template"] == '' ? "getstaff" : $_GET["template"];
     $t = new Template('../template/getdata');
     $t->set_file('f', $template . '.html');
     $t->unknowns = "keep";
     $t->left_delimiter = "[#";
     //修改左边界符为[#
     $t->right_delimiter = "#]";
     //修改右边界符#]
     $t->set_block('f', 'mainlist', 'ml');
     $keywords = $_GET["keywords"];
     $parameter = $_GET["parameter"];
     $parameter = explode("@@@", $parameter);
     $keywords = explode("@@@", $keywords);
     $condition = '';
     for ($i = 0; $i < count($parameter); $i++) {
         if ($parameter[$i] != '') {
             $condition = $condition == '' ? 'A.' . $parameter[$i] . ' in (' . $keywords[$i] . ')' : $condition . " and A." . $parameter[$i] . ' in (' . $keywords[$i] . ')';
             $condition1 = $condition == '' ? $parameter[$i] . ' in (' . $keywords[$i] . ')' : $condition . " and " . $parameter[$i] . 'in (' . $keywords[$i] . ')';
         }
     }
     $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 . 'marketingcard A INNER JOIN ' . WEB_ADMIN_TABPOX . 'marketingcardtype B ON A.marketingcardtype_id=B.marketingcardtype_id   where  A.agencyid =' . $_SESSION["currentorgan"] . ' and ' . $condition;
     } else {
         if ($ftable != '') {
             $sql = 'select * from ' . WEB_ADMIN_TABPOX . 'marketingcard  p INNER JOIN ' . WEB_ADMIN_TABPOX . "{$ftable} f on p.categoryid =f.category_id  where f.category_name like '%" . $keywords . "%' and  p.agencyid =" . $_SESSION["currentorgan"];
         } else {
             $sql = 'select * from ' . WEB_ADMIN_TABPOX . 'marketingcard A INNER JOIN ' . WEB_ADMIN_TABPOX . 'marketingcardtype B ON A.marketingcardtype_id=B.marketingcardtype_id   where  A.agencyid =' . $_SESSION["currentorgan"];
         }
     }
     $inrs =& $this->dbObj->Execute($sql . " ORDER BY  price DESC  LIMIT " . $offset . " , " . $psize);
     $result =& $this->dbObj->Execute($sql);
     $count = $result->RecordCount();
     $t->set_var('pagelist', $this->page("?template=" . $template . "&parameter=" . $parameter . "&keywords=" . urlencode($keywords), $count, $psize, $pageid));
     $t->set_var('recordcount', $count);
     while ($inrrs =& $inrs->FetchRow()) {
         $t->set_var($inrrs);
         $t->set_var('employee_id', $inrrs['employee_id']);
         $t->set_var('employee_name', $inrrs['employee_name']);
         $t->set_var('gender', $inrrs["genderid"] == 1 ? '男' : '女');
         $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');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:58,代码来源:getmarketingcard.php

示例12: disp

 function disp()
 {
     //定义模板
     $t = new Template('../template/getdata');
     $t->set_file('f', 'getvisiterecordtemplate.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 . '="' . $keywords . '"';
         } else {
             $condition = $category . '="' . $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 . 'visiterecordtemplate  where  agencyid =' . $_SESSION["currentorgan"] . ' and ' . $condition;
     } else {
         if ($ftable != '') {
             $sql = 'select * from ' . WEB_ADMIN_TABPOX . 'visiterecordtemplate p INNER JOIN ' . WEB_ADMIN_TABPOX . "{$ftable} f on p.categoryid =f.category_id  where f.category_name like '%" . $keywords . "%' and  p.agencyid =" . $_SESSION["currentorgan"];
         } else {
             $sql = 'select * from ' . WEB_ADMIN_TABPOX . 'visiterecordtemplate  where  agencyid =' . $_SESSION["currentorgan"];
         }
     }
     $inrs =& $this->dbObj->Execute($sql . " ORDER BY  visiterecordtemplate_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);
         $t->set_var('gender', $inrrs["genderid"] == 1 ? '男' : '女');
         $t->set_var('category_name', $this->dbObj->getone('select category_name from ' . WEB_ADMIN_TABPOX . 'procatalog where category_id =' . $inrrs["categoryid"]));
         //$t -> set_var('content',str_replace($inrrs["content"],"\r\n", "<br>" );
         $t->set_var('content1', str_replace("\r\n", "<br>", $inrrs["content"]));
         $t->parse('ml', 'mainlist', true);
     }
     $inrs->Close();
     $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
     $t->parse('out', 'f');
     $t->p('out');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:57,代码来源:getvisiterecordtemplate.php

示例13: disp

 function disp()
 {
     $t = new Template('../template/system');
     $t->set_file('f', 'sysconfig.html');
     $t->set_block('f', 'row', 'r');
     if ($this->getModify()) {
         $t->set_var('form', '<form name="form1" method="post" action="sysconfig.php">');
         $t->set_var('endform', '</form>');
     } else {
         $t->set_var('disabled', ' disabled');
     }
     $rs = $this->dbObj->GetArray('select * from ' . WEB_ADMIN_TABPOX . 'otherrule where issystemvar = 1');
     foreach ($rs as $v) {
         $t->set_var('configname', $v['configname']);
         //如果有的话,显示配置值
         $sval = $this->dbObj->GetOne('select configvalue from ' . WEB_ADMIN_TABPOX . 'config where userid=0 and otherruleid=' . $v['otherruleid']);
         if ($sval === false) {
             $sval = $v['configdefault'];
         }
         $configvalue = '';
         switch ($v['configtype']) {
             case 'text':
                 $configvalue = '<input name="' . $v['otherruleid'] . '" id="' . $v['otherruleid'] . '" type="text" value="' . $sval . '" maxlength="' . $v['maxlength'] . '">';
                 break;
             case 'radio':
                 $content = split('#', $v['configvalue']);
                 foreach ($content as $inv) {
                     $val = split('=', $inv);
                     $configvalue .= "<input type='radio' name='{$v['otherruleid']}' id='{$v['otherruleid']}' value='{$val[1]}'" . ($val[1] == $sval ? ' checked' : '') . ">{$val[0]}";
                 }
                 break;
             case 'checkbox':
                 $content = split('#', $v['configvalue']);
                 $dfvs = split('#', $sval);
                 //默认值
                 foreach ($content as $inv) {
                     $val = split('=', $inv);
                     $configvalue .= "<input type='checkbox' name='{$v['otherruleid']}[]' id='{$v['otherruleid']}' value='{$val[1]}'" . (in_array($val[1], $dfvs) ? ' checked' : '') . ">{$val[0]}";
                 }
                 break;
             case 'select':
                 $configvalue = "<select name='{$v['otherruleid']}' id='{$v['otherruleid']}'>";
                 $content = split('#', $v['configvalue']);
                 foreach ($content as $inv) {
                     $val = split('=', $inv);
                     $configvalue .= "<option value='{$val[1]}'" . ($val[1] == $sval ? ' selected' : '') . ">{$val[0]}</option>";
                 }
                 break;
         }
         $t->set_var('configvalue', $configvalue);
         $t->parse('r', 'row', true);
     }
     $t->set_var('configName', '系统');
     $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
     $t->parse('out', 'f');
     $t->p('out');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:57,代码来源:sysconfig.php

示例14: disp

 function disp()
 {
     //定义模板
     $t = new Template('../template/getdata');
     $t->set_file('f', 'getsell.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 . 'sell  where status in(1,4,5,6) and ownstatus in (1,2) and  agencyid =' . $_SESSION["currentorgan"] . ' and ' . $condition;
     } else {
         if ($ftable != '') {
             $sql = 'select * from ' . WEB_ADMIN_TABPOX . 'sell p INNER JOIN ' . WEB_ADMIN_TABPOX . $ftable . " f on p." . $ftable . "_id =f." . $ftable . "_id  where f." . $category . " like '%" . $keywords . "%' and p.status in(1,4,5,6) and p.ownstatus in (1,2) and   p.agencyid =" . $_SESSION["currentorgan"];
         } else {
             $sql = 'select * from ' . WEB_ADMIN_TABPOX . 'sell  where status in(1,4,5,6) and  ownstatus in (1,2) and   agencyid =' . $_SESSION["currentorgan"];
         }
     }
     $inrs =& $this->dbObj->Execute($sql . " ORDER BY  sell_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);
         $t->set_var('customer_name', $this->dbObj->getone('select customer_name from ' . WEB_ADMIN_TABPOX . 'customer  where customer_id =' . $inrrs["customer_id"]));
         $t->set_var('employee_name', $this->dbObj->getone('select employee_name from ' . WEB_ADMIN_TABPOX . 'employee  where employee_id =' . $inrrs["employee_id"]));
         //$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');
 }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:56,代码来源:getownsell.php

示例15: disp

    function disp()
    {
        $this->forAjax();
        $t = new Template('../template/system');
        $t->set_file('f', 'message.html');
        $t->set_var('ajaxstr', $this->xo->getJavascript(WEB_ADMIN_HTTPCOMMON . '/js/'));
        $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
        $t->set_var('curuser', $this->getUid());
        $t->set_var('disabled', $this->getAppend() ? '' : ' disabled');
        $t->set_block('f', 'row', 'r');
        $rs =& $this->dbObj->Execute("select u.username,m.* from " . WEB_ADMIN_TABPOX . "message m," . WEB_ADMIN_TABPOX . "user u where m.userid=u.userid AND sendtoids like '%," . $this->getUid() . ",%'");
        while (!$rs->EOF) {
            //其它接收者
            $otherUserId = substr($rs->fields['sendtoids'], 1, strlen($rs->fields['sendtoids']) - 2);
            $inRs = $this->dbObj->Execute('select distinct username from ' . WEB_ADMIN_TABPOX . 'user where userid <> ' . $this->getUid() . ' and userid in(' . $otherUserId . ')');
            if (!$inRs->EOF) {
                $t->set_var('dispOther', '');
                $oname = '';
                while (!$inRs->EOF) {
                    $oname .= ' ' . $inRs->fields['username'];
                    $inRs->MoveNext();
                }
                $t->set_var('otherName', $oname);
            } else {
                $t->set_var('otherName', '');
                $t->set_var('dispOther', 'none');
            }
            $t->set_var($rs->fields);
            $t->set_var('del', $this->getDelStr($this->getUid(), $rs->fields['msgid'], 'a', 'message.php?srcids=' . $rs->fields['sendtoids']));
            $rs->MoveNext();
            $t->parse('r', 'row', true);
        }
        //查询初始用户
        $defuser = '';
        if (true) {
            $userSql = 'select userid,username from ' . WEB_ADMIN_TABPOX . 'user';
        } else {
            $userSql = 'SELECT DISTINCT u2.userid,u2.username FROM ' . WEB_ADMIN_TABPOX . 'user u 
				INNER JOIN ' . WEB_ADMIN_TABPOX . 'usergroup ug ON (u.userid = ug.userid) AND (u.userid = ' . $this->getUid() . ')
				INNER JOIN ' . WEB_ADMIN_TABPOX . 'usergroup ug2 ON (ug.groupid = ug.groupid)
				INNER JOIN ' . WEB_ADMIN_TABPOX . 'user u2 ON (u2.userid = ug2.userid)
			';
        }
        $rs = $this->dbObj->Execute($userSql);
        while (!$rs->EOF) {
            $defuser .= '<input name="sendtoids[]" type="checkbox" value="' . $rs->fields['userid'] . '" checked>' . $rs->fields['username'] . '&nbsp;';
            $rs->MoveNext();
        }
        $t->set_var('defuser', $defuser);
        $t->parse('out', 'f');
        $t->p('out');
        echo '|' . $this->getValue('loginErrorTimeOut') . '|';
    }
开发者ID:TonyWoo,项目名称:cmlerp,代码行数:53,代码来源:message.php


注:本文中的Template::parse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。