Example #1
0
 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');
 }
Example #2
0
 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');
 }
Example #3
0
 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');
 }
Example #4
0
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;
}
Example #5
0
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");
}
Example #6
0
 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');
 }
Example #7
0
 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');
 }
Example #8
0
 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');
 }
Example #9
0
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'));
}
Example #10
0
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;
}
Example #11
0
 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');
 }
 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');
 }
Example #13
0
 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');
 }
Example #14
0
 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');
 }
Example #15
0
    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') . '|';
    }
Example #16
0
 function goDispAppend()
 {
     $t = new Template('../template/system');
     $t->set_file('f', 'userdetail.html');
     $t->set_block('f', 'group', 'g');
     $groupArr = array();
     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 . 'user WHERE userid = ' . $updid));
         $t->set_var('updid', $updid);
         $t->set_var('action', 'upd');
         $t->set_var('actionName', '修改');
         $gs = $this->dbObj->GetArray('SELECT groupid FROM ' . WEB_ADMIN_TABPOX . 'usergroup WHERE userid = ' . $updid);
         foreach ($gs as $v) {
             $groupArr[] = $v['groupid'];
         }
     }
     //当前用户所管理的组
     $umgs = '0';
     //echo 'select agency_type id from '.WEB_ADMIN_TABPOX.'agency a  inner join '.WEB_ADMIN_TABPOX.'user u on a.agency_id=u.agencyid where u.userid='.$this->getUid();
     $agency_type_id =& $this->dbObj->GetOne('select agencytype id from ' . WEB_ADMIN_TABPOX . 'agency a  inner join ' . WEB_ADMIN_TABPOX . 'user u on a.agency_id=u.agencyid where u.userid=' . $this->getUid());
     //echo  $agency_type_id;
     //'select g.groupid from '.WEB_ADMIN_TABPOX.'groupmanager g  inner join '.WEB_ADMIN_TABPOX.'user u on g.userid=u.userid where u.agencyid='.$_SESSION["currentorgan"]
     if ($agency_type_id == 1) {
         $mgs =& $this->dbObj->Execute('select groupid from ' . WEB_ADMIN_TABPOX . 'group where agencyid=' . $_SESSION["currentorgan"]);
     } else {
         $mgs =& $this->dbObj->Execute('select groupid from ' . WEB_ADMIN_TABPOX . 'groupmanager where userid=' . $this->getUid());
     }
     while (!$mgs->EOF) {
         $umgs .= ',' . $mgs->fields['groupid'];
         $mgs->MoveNext();
     }
     //设置组列表
     $rs =& $this->dbObj->Execute("select * from " . WEB_ADMIN_TABPOX . 'group where groupid in(' . $umgs . ')');
     while ($rrs =& $rs->FetchRow()) {
         $t->set_var($rrs);
         if (in_array($rrs['groupid'], $groupArr)) {
             $t->set_var('gchecked', ' checked');
         } else {
             $t->set_var('gchecked', '');
         }
         $t->parse('g', 'group', true);
     }
     $t->set_var('path', WEB_ADMIN_HTTPPATH . '/common/');
     $t->parse('out', 'f');
     $t->p('out');
 }
Example #17
0
 public static function Selection($order_id, $showlog = 0, $selected = '')
 {
     global $LANG_PP, $_PP_CONF;
     self::Init();
     $T = new Template(PAYPAL_PI_PATH . '/templates');
     $T->set_file('ordstat', 'orderstatus.thtml');
     $T->set_var(array('order_id' => $order_id, 'oldvalue' => $selected, 'showlog' => $showlog == 1 ? 1 : 0));
     $T->set_block('ordstat', 'StatusSelect', 'Sel');
     foreach ($_PP_CONF['orderstatus'] as $key => $data) {
         $T->set_var(array('selected' => $key == $selected ? 'selected="selected"' : '', 'stat_key' => $key, 'stat_descr' => isset($LANG_PP['orderstatus'][$key]) ? $LANG_PP['orderstatus'][$key] : $key));
         $T->parse('Sel', 'StatusSelect', true);
     }
     $T->parse('output', 'ordstat');
     return $T->finish($T->get_var('output'));
 }
Example #18
0
function getSidebarNotifications() {
    global $modules, $admin_modules, $theme_settings, $urlAppend;

    $notifications_html = array();
    if (isset($_GET['courseIDs']) and count($_GET['courseIDs'])) {
        $t = new Template();
        $t->set_var('sideBarCourseNotifyBlock', $_SESSION['template']['sideBarCourseNotifyBlock']);
        foreach ($_GET['courseIDs'] as $id) {
            $t->set_var('sideBarCourseNotify', '');
            $notifications = get_course_notifications($id);
            $course_code = course_id_to_code($id);
            foreach ($notifications as $n) {
                $modules_array = (isset($modules[$n->module_id]))? $modules: $admin_modules;
                if (isset($modules_array[$n->module_id]) &&
                    isset($modules_array[$n->module_id]['image']) &&
                    isset($theme_settings['icon_map'][$modules_array[$n->module_id]['image']])) {
                    $t->set_var('sideBarCourseNotifyIcon', $theme_settings['icon_map'][$modules_array[$n->module_id]['image']]);
                    $t->set_var('sideBarCourseNotifyCount', $n->notcount);
                    $t->set_var('sideBarCourseNotifyTitle', q($modules_array[$n->module_id]['title']));
                    $t->set_var('sideBarCourseNotifyURL', $urlAppend . 'modules/' . $modules_array[$n->module_id]['link'] .
                                                    '/?course=' . $course_code);
                    $t->parse('sideBarCourseNotify', 'sideBarCourseNotifyBlock', true);
                }
            }
            $notifications_html[$id] = $t->get_var('sideBarCourseNotify');
        }
    }
    return $notifications_html;
}
Example #19
0
function MG_editUser($uid)
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01;
    $retval = '';
    $active = 0;
    $quota = 0;
    $username = DB_getItem($_TABLES['users'], 'username', "uid=" . $uid);
    $result = DB_query("SELECT active,quota FROM {$_TABLES['mg_userprefs']} WHERE uid=" . $uid);
    $nRows = DB_numRows($result);
    if ($nRows > 0) {
        $row = DB_fetchArray($result);
        $active = $row['active'];
        $quota = $row['quota'] / 1048576;
    } else {
        $active = 1;
        $quota = $_MG_CONF['member_quota'] / 1048576;
    }
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file('admin', 'useredit.thtml');
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    $active_select = '<input type="checkbox" name="active" value="1" ' . ($active ? ' CHECKED' : '') . '/>';
    $T->set_var(array('s_form_action' => $_MG_CONF['admin_url'] . 'edituser.php', 'lang_user_edit' => $LANG_MG01['edit_user'], 'lang_username' => $LANG_MG01['username'], 'lang_active' => $LANG_MG01['active'], 'lang_quota' => $LANG_MG01['quota'], 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_reset' => $LANG_MG01['reset'], 'lang_unlimited' => $LANG_MG01['zero_unlimited'], 'uid' => $uid, 'active' => $active_select, 'quota' => $quota, 'username' => $username));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
Example #20
0
function fncview($uid, $template)
{
    $pi_name = "userbox";
    global $_CONF;
    global $LANG_USERBOX_ADMIN;
    //template フォルダ
    $tmplfld = DATABOX_templatePath('admin', 'default', $pi_name);
    $tmpl = new Template($tmplfld);
    $tmpl->set_file(array('view' => 'view.thtml'));
    //--
    $tmpl->set_var('site_admin_url', $_CONF['site_admin_url']);
    if ($template === "") {
        $tmpl->set_var('about_thispage', $LANG_USERBOX_ADMIN['about_admin_view']);
    } else {
        $tmpl->set_var('about_thispage', "");
    }
    $tmpl->parse('output', 'view');
    $view = $tmpl->finish($tmpl->get_var('output'));
    $information = array();
    $retval = userbox_profile($uid, $template, "", "view");
    $layout = $retval['layout'];
    $information['headercode'] = $retval['headercode'];
    $information['pagetitle'] = $retval['title'];
    $display = $view;
    $display .= $retval['display'];
    $display = DATABOX_displaypage($pi_name, $layout, $display, $information);
    COM_output($display);
}
Example #21
0
 /**
  * Display SSO options.
  *
  * @since 141111 First documented version.
  */
 public function maybeDisplaySsoOps()
 {
     if (!$this->plugin->options['sso_enable']) {
         return;
         // Disabled currently.
     }
     if (!$this->plugin->options['login_form_sso_template_enable']) {
         return;
         // Disabled currently.
     }
     foreach ($sso_services = SsoActions::$valid_services as $_key => $_service) {
         if (!$this->plugin->options['sso_' . $_service . '_key'] || !$this->plugin->options['sso_' . $_service . '_secret']) {
             unset($sso_services[$_key]);
             // Remove from the array.
         }
     }
     unset($_key, $_service);
     // Housekeeping.
     if (!$sso_services) {
         return;
         // No configured services.
     }
     $template_vars = get_defined_vars();
     // Everything above.
     $template = new Template('site/login-form/sso-ops.php');
     echo $template->parse($template_vars);
 }
Example #22
0
function MG_enroll()
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG03;
    // let's make sure this user does not already have a member album
    if ($_MG_CONF['member_albums'] != 1) {
        echo COM_refresh($_MG_CONF['site_url'] . '/index.php');
        exit;
    }
    $sql = "SELECT album_id FROM {$_TABLES['mg_albums']} WHERE owner_id=" . (int) $_USER['uid'] . " AND album_parent=" . $_MG_CONF['member_album_root'];
    $result = DB_query($sql);
    $nRows = DB_numRows($result);
    if ($nRows > 0) {
        $display = MG_siteHeader();
        $display .= COM_showMessageText($LANG_MG03['existing_member_album'], '', true);
        $display .= MG_siteFooter();
        echo $display;
        exit;
    }
    $T = new Template(MG_getTemplatePath(0));
    $T->set_file('enroll', 'enroll.thtml');
    $T->set_var(array('s_form_action' => $_MG_CONF['site_url'] . '/enroll.php', 'lang_title' => $LANG_MG03['enroll_title'], 'lang_overview' => $LANG_MG03['overview'], 'lang_terms' => $LANG_MG03['terms'], 'lang_member_album_overview' => $LANG_MG03['member_album_overview'], 'lang_member_album_terms' => $LANG_MG03['member_album_terms'], 'lang_agree' => $LANG_MG03['agree'], 'lang_cancel' => $LANG_MG03['cancel']));
    $T->parse('output', 'enroll');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
Example #23
0
 function view()
 {
     global $_CONF, $_TABLES;
     $body = '';
     $T = new Template($_CONF['path'] . 'plugins/tag/templates');
     $T->set_file('badword', 'admin_badword.thtml');
     $T->set_var('xhtml', XHTML);
     $T->set_var('this_script', COM_buildURL($_CONF['site_admin_url'] . '/plugins/tag/index.php'));
     $T->set_var('lang_desc_admin_badword', TAG_str('desc_admin_badword'));
     $T->set_var('lang_add', TAG_str('add'));
     $T->set_var('lang_lbl_tag', TAG_str('lbl_tag'));
     $T->set_var('lang_delete_checked', TAG_str('delete_checked'));
     $sql = "SELECT * FROM {$_TABLES['tag_badwords']}";
     $result = DB_query($sql);
     if (DB_error()) {
         return $retval . '<p>' . TAG_str('db_error') . '</p>';
     } else {
         if (DB_numRows($result) == 0) {
             $T->set_var('msg', '<p>' . TAG_str('no_badword') . '</p>');
         } else {
             $sw = 1;
             while (($A = DB_fetchArray($result)) !== false) {
                 $word = TAG_escape($A['badword']);
                 $body .= '<tr><td>' . '<input id="' . $word . '" name="words[]" type="checkbox" ' . 'value="' . $word . '"><label for="' . $word . '">' . $word . '</label></td></tr>' . LB;
                 $sw = $sw == 1 ? 2 : 1;
             }
         }
     }
     $T->set_var('body', $body);
     $T->parse('output', 'badword');
     $retval = $T->finish($T->get_var('output'));
     return $retval;
 }
Example #24
0
 public function __construct($esxman, $database, $username = '', $error = null)
 {
     $this->esxman = $esxman;
     $this->database = $database;
     $this->username = $username;
     $this->html = array('footer' => '&nbsp;', 'menu' => '&nbsp;', 'tree' => '&nbsp;', 'user' => '&nbsp;', 'content' => '&nbsp;');
     $this->commands = array();
     $this->title = _('Login');
     if (request('form_name') == 'login') {
         if ($this->database->authenticate_user(request('username'), request('password'))) {
             session_destroy();
             session_start();
             $_SESSION['username'] = request('username');
             $_SESSION['key'] = md5($_SESSION['username'] . getenv('REMOTE_ADDR') . getenv('X-FORWARDED-FOR'));
             debug('User ' . request('username') . ' logging in!');
             $this->commands[] = "\$('#dialog').html('" . _('Populating inventory...') . "');";
             $this->commands[] = js_command('get', 'action=populate_inventory');
             return;
         }
         $error = _('Authentication failed');
     }
     $tpl = new Template('dialog_login.html');
     if ($error) {
         $tpl->setVar('error', $error);
         $tpl->parse('error_message');
     }
     $this->commands[] = js_command('display_dialog', _('Login'), $tpl->get(), _('Login'));
 }
Example #25
0
/**
*   Create the payment buttons for an external item.
*   Creates the requested buy_now button type and, if requested,
*   an add_cart button.
*
*   All gateways that have the 'external' service enabled as well as the
*   requested button type will provide a button.
*
*   $args['btn_type'] can be empty or not set, to create only an Add to Cart
*   button.  $args['add_cart'] must still be set in this case.  If neither
*   button type is requested, an empty array is returned.
*
*   Provided $args should include at least:
*       'item_number', 'item_name', 'price', 'quantity', and 'item_type'
*   $args['btn_type'] should reflect the type of immediate-purchase button
*   desired.  $args['add_cart'] simply needs to be set to get an add-to-cart
*   button.
*
*   @uses   PaymentGw::ExternalButton()
*   @param  array   $args       Array of item information
*   @param  array   &$output    Pointer to output array
*   @param  array   &$svc_msg   Unused
*   @return integer             Status code
*/
function service_genButton_paypal($args, &$output, &$svc_msg)
{
    global $_CONF, $_PP_CONF;
    $btn_type = isset($args['btn_type']) ? $args['btn_type'] : '';
    $output = array();
    // Create the immediate purchase button, if requested.  As soon as a
    // gateway supplies the requested button type, break from the loop.
    if (!empty($btn_type)) {
        PAYPAL_loadGateways();
        // load all gateways
        if (!empty($_PP_CONF['gateways'])) {
            // Should be at least one
            // Get the first gateway that supports the button type
            foreach ($_PP_CONF['gateways'] as $gw_info) {
                if (PaymentGw::Supports($btn_type, $gw_info) && PaymentGw::Supports('external', $gw_info) && class_exists($gw_info['id'])) {
                    $gw = new $gw_info['id']();
                    $output[] = $gw->ExternalButton($args, $btn_type);
                }
            }
        }
    }
    // Now create an add-to-cart button, if requested.
    if (isset($args['add_cart']) && $_PP_CONF['ena_cart'] == 1) {
        if (!isset($args['item_type'])) {
            $args['item_type'] = PP_PROD_VIRTUAL;
        }
        $T = new Template(PAYPAL_PI_PATH . '/templates');
        $T->set_file('cart', 'buttons/btn_add_cart.thtml');
        $T->set_var(array('item_name' => $args['item_name'], 'item_number' => $args['item_number'], 'short_description' => $args['short_description'], 'amount' => $args['amount'], 'pi_url' => PAYPAL_URL, 'item_type' => $args['item_type'], 'have_tax' => isset($args['tax']) ? 'true' : '', 'tax' => isset($args['tax']) ? $args['tax'] : 0, 'quantity' => isset($args['quantity']) ? $args['quantity'] : '', '_ret_url' => isset($args['_ret_url']) ? $args['_ret_url'] : ''));
        $output['add_cart'] = $T->parse('', 'cart');
    }
    return PLG_RET_OK;
}
Example #26
0
function lateral_menu()
{
    global $LANG, $CONFIG;
    $tpl = new Template('admin/menus/panel.tpl');
    $tpl->assign_vars(array('L_MENUS_MANAGEMENT' => $LANG['menus_management'], 'L_ADD_CONTENT_MENUS' => $LANG['menus_content_add'], 'L_ADD_LINKS_MENUS' => $LANG['menus_links_add'], 'L_ADD_FEED_MENUS' => $LANG['menus_feed_add'], 'L_MANAGE_THEME_COLUMNS' => $LANG['manage_theme_columns'], 'THEME_NAME' => get_utheme()));
    $tpl->parse();
}
Example #27
0
 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');
 }
Example #28
0
/**
* Shows all polls in system
*
* List all the polls on the system if no $pid is provided
*
* @return   string          HTML for poll listing
*
*/
function polllist()
{
    global $_CONF, $_TABLES, $_USER, $_PO_CONF, $LANG25, $LANG_LOGIN, $LANG_POLLS;
    $retval = '';
    if (empty($_USER['username']) && ($_CONF['loginrequired'] == 1 || $_PO_CONF['pollsloginrequired'] == 1)) {
        $retval = COM_startBlock($LANG_LOGIN[1], '', COM_getBlockTemplate('_msg_block', 'header'));
        $login = new Template($_CONF['path_layout'] . 'submit');
        $login->set_file(array('login' => 'submitloginrequired.thtml'));
        $login->set_var('xhtml', XHTML);
        $login->set_var('login_message', $LANG_LOGIN[2]);
        $login->set_var('site_url', $_CONF['site_url']);
        $login->set_var('lang_login', $LANG_LOGIN[3]);
        $login->set_var('lang_newuser', $LANG_LOGIN[4]);
        $login->parse('output', 'login');
        $retval .= $login->finish($login->get_var('output'));
        $retval .= COM_endBlock(COM_getBlockTemplate('_msg_block', 'footer'));
    } else {
        require_once $_CONF['path_system'] . 'lib-admin.php';
        $header_arr = array(array('text' => $LANG25[9], 'field' => 'topic', 'sort' => true), array('text' => $LANG25[20], 'field' => 'voters', 'sort' => true), array('text' => $LANG25[3], 'field' => 'unixdate', 'sort' => true), array('text' => $LANG_POLLS['open_poll'], 'field' => 'is_open', 'sort' => true));
        $defsort_arr = array('field' => 'unixdate', 'direction' => 'desc');
        $text_arr = array('has_menu' => false, 'title' => $LANG_POLLS['pollstitle'], 'instructions' => "", 'icon' => '', 'form_url' => '');
        $query_arr = array('table' => 'polltopics', 'sql' => $sql = "SELECT *,UNIX_TIMESTAMP(date) AS unixdate, display " . "FROM {$_TABLES['polltopics']} WHERE 1=1", 'query_fields' => array('topic'), 'default_filter' => COM_getPermSQL(), 'query' => '', 'query_limit' => 0);
        $retval .= ADMIN_list('polls', 'plugin_getListField_polls', $header_arr, $text_arr, $query_arr, $defsort_arr);
    }
    return $retval;
}
Example #29
0
function MG_editRSS()
{
    global $_CONF, $_MG_CONF, $_TABLES, $_USER, $LANG_MG00, $LANG_MG01;
    $retval = '';
    $T = new Template($_MG_CONF['template_path'] . '/admin');
    $T->set_file('admin', 'rssedit.thtml');
    $T->set_var('site_url', $_CONF['site_url']);
    $T->set_var('site_admin_url', $_CONF['site_admin_url']);
    $rss_full_select = '<input type="checkbox" name="rss_full_enabled" value="1" ' . ($_MG_CONF['rss_full_enabled'] ? ' checked="checked"' : '') . '/>';
    $rss_type_select = "<select name='rss_feed_type'>";
    $rss_type_select .= "<option value='RSS-2.0'" . ($_MG_CONF['rss_feed_type'] == "RSS-2.0" ? ' selected="selected"' : "") . ">RSS2.0</option>";
    $rss_type_select .= "<option value='RSS-1.0'" . ($_MG_CONF['rss_feed_type'] == "RSS-1.0" ? ' selected="selected"' : "") . ">RSS1.0</option>";
    $rss_type_select .= "<option value='RSS-0.91'" . ($_MG_CONF['rss_feed_type'] == "RSS-0.91" ? ' selected="selected"' : "") . ">RSS0.91</option>";
    $rss_type_select .= "<option value='PIE-0.1'" . ($_MG_CONF['rss_feed_type'] == "PIE-0.1" ? ' selected="selected"' : "") . ">PIE0.1</option>";
    $rss_type_select .= "<option value='ATOM-1.0'" . ($_MG_CONF['rss_feed_type'] == "ATOM-1.0" ? ' selected="selected"' : "") . ">ATOM</option>";
    $rss_type_select .= "<option value='ATOM-0.3'" . ($_MG_CONF['rss_feed_type'] == "ATOM-0.3" ? ' selected="selected"' : "") . ">ATOM0.3</option>";
    $rss_type_select .= "</select>";
    $hide_email_select = '<input type="checkbox" name="hide_email" value="1" ' . ($_MG_CONF['hide_author_email'] ? ' checked="checked"' : '') . '/>';
    $rss_ignore_empty_select = '<input type="checkbox" name="rss_ignore_empty" value="1" ' . ($_MG_CONF['rss_ignore_empty'] ? ' checked="checked"' : '') . '/>';
    $rss_anonymous_only_select = '<input type="checkbox" name="rss_anonymous_only" value="1" ' . ($_MG_CONF['rss_anonymous_only'] ? ' checked="checked"' : '') . '/>';
    $T->set_var(array('lang_rss_options' => $LANG_MG01['rss_options'], 'lang_rss_full' => $LANG_MG01['rss_full'], 'lang_rss_type' => $LANG_MG01['rss_type'], 'lang_rss_ignore_empty' => $LANG_MG01['rss_ignore_empty'], 'lang_rss_anonymous_only' => $LANG_MG01['rss_anonymous_only'], 'lang_rss_feed_name' => $LANG_MG01['rss_feed_name'], 'lang_save' => $LANG_MG01['save'], 'lang_cancel' => $LANG_MG01['cancel'], 'lang_reset' => $LANG_MG01['reset'], 'rss_full_select' => $rss_full_select, 'rss_type_select' => $rss_type_select, 'hide_email_select' => $hide_email_select, 'lang_hide_email' => $LANG_MG01['hide_email'], 'rss_ignore_empty_select' => $rss_ignore_empty_select, 'rss_anonymous_only_select' => $rss_anonymous_only_select, 'rss_feed_name' => $_MG_CONF['rss_feed_name'], 's_form_action' => $_MG_CONF['admin_url'] . 'rss.php'));
    $T->parse('output', 'admin');
    $retval .= $T->finish($T->get_var('output'));
    return $retval;
}
 /**
  * Return a sidebox menu item
  *
  * @internal PHP5 protected
  * @param string $item_link
  * @param string $item_text
  * @return string
  */
 function _sidebox_menu_item($item_link = '', $item_text = '')
 {
     if ($item_text === '_NewLine_' || $item_link === '_NewLine_') {
         return $this->tpl->parse('out', 'extra_block_spacer');
     }
     if (strtolower($item_text) == 'grant access' && $GLOBALS['egw_info']['server']['deny_user_grants_access']) {
         return;
     }
     $var['icon_or_star'] = '<img class="sideboxstar" src="' . $GLOBALS['egw_info']['server']['webserver_url'] . '/phpgwapi/templates/' . $this->template . '/images' . '/orange-ball.png" width="9" height="9" alt="ball"/>';
     $var['target'] = '';
     if (is_array($item_link)) {
         if (isset($item_link['icon'])) {
             $app = isset($item_link['app']) ? $item_link['app'] : $GLOBALS['egw_info']['flags']['currentapp'];
             $var['icon_or_star'] = $item_link['icon'] ? '<img style="margin:0px 2px 0px 2px; height: 16px;" src="' . common::image($app, $item_link['icon']) . '"/>' : False;
         }
         $var['lang_item'] = isset($item_link['no_lang']) && $item_link['no_lang'] ? $item_link['text'] : lang($item_link['text']);
         $var['item_link'] = $item_link['link'];
         if ($item_link['target']) {
             if (strpos($item_link['target'], 'target=') !== false) {
                 $var['target'] = $item_link['target'];
             } else {
                 $var['target'] = ' target="' . $item_link['target'] . '"';
             }
         }
     } else {
         $var['lang_item'] = lang($item_text);
         $var['item_link'] = $item_link;
     }
     $this->tpl->set_var($var);
     $block = 'extra_block_row';
     if ($var['item_link'] === False) {
         $block .= $var['icon_or_star'] === False ? '_raw' : '_no_link';
     }
     return $this->tpl->parse('out', $block);
 }