public function indexAction()
 {
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
     $LotoArr = $this->oLoto->getAll();
     include $this->tpl('Loto_list');
 }
Example #2
0
 /**
  * 浏览游戏列表
  * @return unknown_type
  */
 public function indexAction()
 {
     /**
      * 记录日志
      */
     $log = "游戏管理\n\nServerIp:\n" . $this->request->getServer('SERVER_ADDR') . "\n\nGET:\n" . var_export($_GET, true) . "\n\nPOST:\n" . var_export($_POST, true);
     $this->oLogManager->push('log', $log);
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
     /**
      * 游戏类型
      * @var string
      */
     $appType = intval($this->request->appType);
     $oAppArr = array();
     $oGameClaArr = $this->oClass->getAll();
     if ($appType) {
         $oAppArr = $this->oApp->getByClass($appType);
     } else {
         $oAppArr = $this->oApp->getAll();
     }
     if (is_array($oAppArr)) {
         foreach ($oAppArr as $keyApp => $valApp) {
             $oAppArr[$keyApp]['class_name'] = $valApp['ClassId'] ? $oGameClaArr[$valApp['ClassId']]['name'] : "未分类";
             $oAppArr[$keyApp]['comment'] = json_decode($valApp['comment'], true);
         }
     }
     include $this->tpl();
 }
Example #3
0
 public function indexAction()
 {
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
     $SourceTypeArr = $this->oSourceType->getAll();
     include $this->tpl('Config_Source_Type_list');
 }
Example #4
0
 /**
  * 初始化
  * (non-PHPdoc)
  * @see AbstractController#init()
  */
 public function init()
 {
     parent::init();
     $this->oResearch = new Config_Research();
     $this->oQuestion = new Config_Research_Question();
     $this->ResearchList = $this->oResearch->getAll();
     $this->AnswerTypeList = array('text' => '字符串', 'radio' => '单选', 'checkbox' => "多选", 'textarea' => "文本框");
 }
 public function modifyAction()
 {
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
     $VideoId = intval($this->request->VideoId);
     $Video = $this->oVideo->getRow($VideoId, '*');
     $VideoTypeArr = $this->oVideoType->getAll();
     include $this->tpl('Config_Video_Video_modify');
 }
Example #6
0
 function fnDBFetchCon($strSql, $hdlConfDB)
 {
     $arrResult =& $this->hdlDb->getAll($strSql, DB_FETCHMODE_ASSOC);
     if (DB::isError($arrResult)) {
         print $arrResult->getDebugInfo() . "<br>";
         die("Failed: " . $arrResult->getMessage() . "\n");
     }
     return $arrResult;
     //return the result set
 }
Example #7
0
 /**
  * 初始化
  * (non-PHPdoc)
  * @see AbstractController#init()
  */
 public function init()
 {
     parent::init();
     $this->oArea = new Config_Area();
     $this->Abroad = array(1 => '国内', 2 => '国外');
     $totalArea = $this->oArea->getAll();
     foreach ($totalArea as $AreaId => $value) {
         $value['abroad'] = $this->Abroad[$value['is_abroad']];
         $this->AreaList[$AreaId] = $value;
     }
 }
 /**
  * 浏览邮箱后缀列表
  * @return unknown_type
  */
 public function indexAction()
 {
     /**
      * 记录日志
      */
     $log = "邮箱后缀管理\n\nServerIp:\n" . $this->request->getServer('SERVER_ADDR') . "\n\nGET:\n" . var_export($_GET, true) . "\n\nPOST:\n" . var_export($_POST, true);
     $this->oLogManager->push('log', $log);
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
     $MailFixArr = $this->oMailFix->getAll();
     include $this->tpl();
 }
Example #9
0
 public function indexAction()
 {
     $FaqTypeList = $this->oFaqType->getAll('name,FaqTypeId');
     $FaqTypeId = $this->request->FaqTypeId ? abs(intval($this->request->FaqTypeId)) : 0;
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
     $FaqArr = $this->oFaq->getAll($FaqTypeId);
     if ($FaqArr) {
         foreach ($FaqArr as $FaqId => $FaqData) {
             $FaqArr[$FaqId]['FaqTypeName'] = $FaqTypeList[$FaqData['FaqTypeId']]['name'];
         }
     }
     include $this->tpl('Config_Faq_list');
 }
Example #10
0
 /**
  * 从一个表里查询出数据
  * @param $table
  * @param $fileds
  * @param $where
  * @param $primkey
  * @param $key
  * @return array
  */
 protected function getMultiy($table, $fileds, $where)
 {
     $sql = "SELECT {$fileds}  FROM  {$table}   " . $where;
     $finally = array();
     $rows = $this->slaveDB->getAll($sql, $primkey);
     return $finally;
 }
 /**
  *  Method to get a sorted list of nodes with indented spaces
  * @return string
  */
 function getListBox()
 {
     //create dropdown box
     $dropdown = $this->newObject('dropdown', 'htmlelements');
     $dropdown->name = 'sourceId';
     //get the root id
     $contextCode = $this->objDBContext->getContextCode();
     if ($contextCode) {
         $id = $this->objDBContext->getField('id', $contextCode);
     } else {
         $id = Null;
     }
     $rootnodeid = $this->objDBContext->getRootNodeId($id);
     //get the list of nodes for the context
     $nodesArr = $this->objDBContentNodes->getAll("WHERE tbl_context_parentnodes_id='{$rootnodeid}' ORDER BY sortindex");
     //create a root node
     $dropdown->addOption(NULL, '[ROOT]');
     //add the nodes to the dropdown recursively
     foreach ($nodesArr as $node) {
         //start with the nodes that has no parent
         if ($node['parent_Node'] == null) {
             $text = $this->objDBContentNodes->getMenuText($node['id']);
             if ($text == '') {
                 $text = $node['title'];
             }
             $dropdown->addOption($node['id'], $text);
             $this->addNode($nodesArr, $node['id'], $dropdown, '&nbsp;&nbsp;');
         }
     }
     return $dropdown->show();
 }
 /**
  * Method to get a tree for sharing nodes
  * @param string $contextId The Context Id
  * @param string $mode The type of tree , either DHTML or Dropdown
  * @return string 
  * @access public
  */
 function getTree($contextId, $mode = NULL, $modeParams = NULL)
 {
     $icon = 'folder_up.gif';
     $expandedIcon = 'folder-expanded.gif';
     $link = '';
     $rootnodeid = $this->objDBContext->getRootNodeId($contextId);
     $rootlabel = '';
     //Create a new menu
     $menu = new treemenu();
     $contentlink = $this->URI(array('action', 'contenthome'), $this->module);
     //create base node
     $basenode = new treenode(array('text' => $rootlabel, 'link' => $contentlink, 'icon' => 'base.gif', 'expandedIcon' => 'base.gif'));
     $this->objDBContentNodes->resetTable();
     $nodesArr = $this->objDBContentNodes->getAll("WHERE tbl_context_parentnodes_id='{$rootnodeid}'");
     $this->objDBContentNodes->changeTable('tbl_context_nodes_has_tbl_context_page_content');
     foreach ($nodesArr as $node) {
         if ($node['parent_Node'] == null) {
             $basenode->addItem($this->getChildNodes($nodesArr, $node['id'], stripslashes($this->shortenString($node['title']))));
         }
     }
     $this->objDBContentNodes->resetTable();
     $menu->addItem($basenode);
     //$menu->addItem($this->recurTree($rootnodeid,$rootlabel));
     // Create the presentation class
     $treeMenu =& new dhtml($menu, array('images' => $this->objSkin->getSkinURL() . '/treeimages/imagesAlt2', 'defaultClass' => 'treeMenuDefault'));
     if ($mode == 'listbox') {
         $listBox =& new listbox($menu, array('linkTarget' => '_self', 'submitText' => $modeParams['submitText'], 'promoText' => $modeParams['promoText']));
         return $listBox->getMenu();
     }
     return '<h5>' . $this->objDBContext->getTitle() . '</h5>' . $treeMenu->getMenu();
 }
 /**
  * Method to get a paginated
  * list of courses
  *
  * @param unknown_type $start
  * @param unknown_type $limit
  * @return unknown
  */
 public function jsonListContext($start = 0, $limit = 25)
 {
     $start = empty($start) ? 0 : $start;
     $limit = empty($limit) ? 25 : $limit;
     $contexts = $this->objDBContext->getAll("ORDER BY title limit " . $start . ", " . $limit);
     $all = $this->objDBContext->getArray("SELECT count( id ) as cnt FROM tbl_context ORDER BY title");
     $allCount = $all[0]['cnt'];
     $contextCount = count($contexts);
     $courses = array();
     if ($contextCount > 0) {
         foreach ($contexts as $context) {
             $studentCount = "";
             if (strtoupper($this->showStudentCount) == 'TRUE') {
                 $studentCount = '&nbsp;(' . count($this->objUserContext->getContextStudents($context['contextcode'])) . ')';
             }
             $arr = array();
             $arr['contextcode'] = $context['contextcode'];
             $arr['title'] = htmlentities($context['title']) . $studentCount;
             $arr['author'] = htmlentities($this->objUser->fullname($context['userid']));
             $arr['datecreated'] = $context['datecreated'];
             $arr['lastupdated'] = $context['updated'];
             $arr['status'] = $context['status'];
             $arr['expert'] = "";
             $courses[] = $arr;
         }
     }
     return json_encode(array('totalCount' => $allCount, 'courses' => $courses));
 }
Example #14
0
 public function indexAction()
 {
     $AppList = $this->oApp->getAll('name,AppId');
     $AppId = $this->request->AppId ? abs(intval($this->request->AppId)) : 101;
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
     $InstMapArr = $this->oInstMap->getAll($AppId);
     if ($InstMapArr) {
         foreach ($InstMapArr as $App => $AppData) {
             foreach ($AppData as $InstMapId => $InstMapData) {
                 $InstMapArr[$App][$InstMapId]['AppName'] = $AppList[$App]['name'];
             }
         }
     }
     include $this->tpl('Config_InstMap_list');
 }
 function listUsers()
 {
     $err = $this->_prepare();
     if ($err !== true) {
         return PEAR::raiseError($err->getMessage(), $err->getCode());
     }
     $retVal = array();
     // Find if db_fileds contains a *, i so assume all col are selected
     if (strstr($this->options['db_fields'], '*')) {
         $sql_from = "*";
     } else {
         $sql_from = $this->options['usernamecol'] . ", " . $this->options['passwordcol'] . $this->options['db_fields'];
     }
     $query = sprintf("SELECT %s FROM %s", $sql_from, $this->options['table']);
     $res = $this->db->getAll($query, null, DB_FETCHMODE_ASSOC);
     if (DB::isError($res)) {
         return PEAR::raiseError($res->getMessage(), $res->getCode());
     } else {
         foreach ($res as $user) {
             $user['username'] = $user[$this->options['usernamecol']];
             $retVal[] = $user;
         }
     }
     return $retVal;
 }
Example #16
0
 /**
  * Gets all users with handle, passwd, auth_user_id
  * lastlogin, is_active and individual rights.
  *
  * The array will look like this:
  * <code>
  * $userData[0]['auth_user_id'] = 'wujha433gawefawfwfiuj2ou9823r98h';
  *             ['handle']       = 'myLogin';
  *             ['passwd']       = 'd346gs2gwaeiuhaeiuuweijfjuwaefhj';
  *             ['lastlogin']    = 1254801292; (Unix timestamp)
  *             ['is_active']    = 1; (1 = yes, 0 = no)
  *             ['owner_user_id']    = 1;
  *             ['owner_group_id']   = 1;
  * </code>
  *
  * Filters can be either complex or simple.
  *
  * In their simple form you just need to pass an associative array
  * with key/value, the key will be the table field name and value the value
  * you are searching. It will consider that you want an do to do a
  * field=value comparison, every additional filter will be appended with AND
  *
  * The complicated form of filters is to pass an array such as
  *
  * array(
  *     'fieldname' => array('op' => '>', 'value' => 'dummy', 'cond' => ''),
  *     'fieldname' => array('op' => '<', 'value' => 'dummy2', 'cond' => 'OR'),
  * );
  *
  * It can then build relatively complex queries. If you need joins or more
  * complicated queries than that please consider using an alternative
  * solution such as PEAR::DB_DataObject
  *
  * Any aditional field will be returned. The array key will be of the same
  * case it is given.
  *
  *  $cols = array('myField');
  *
  * e.g.: getUsers(null, $cols) will return
  *
  * <code>
  * $userData[0]['auth_user_id'] = 'wujha433gawefawfwfiuj2ou9823r98h';
  *             ['handle']       = 'myLogin';
  *             ['passwd']       = 'd346gs2gwaeiuhaeiuuweijfjuwaefhj';
  *             ['myField']      = 'value';
  * </code>
  *
  * @access  public
  * @param   array  filters to apply to fetched data
  * @param   array  custom fields you want to be returned. If not specified
  *                 the basic set of fields is returned. The keys are the
  *                 names and the values
  * @param   string  if not null 'ORDER BY $order' will be appended to the query
  * @param   boolean will return an associative array with the auth_user_id
  *                  as the key by using DB::getAssoc() instead of DB::getAll()
  * @return  mixed  Array with user data or DB error.
  */
 function getUsers($filters = array(), $addCustomFields = array(), $order = null, $rekey = false)
 {
     if (!$this->init_ok) {
         return false;
     }
     $fields = $where = '';
     if (sizeof($addCustomFields) > 0) {
         foreach ($addCustomFields as $v) {
             $customFields[] = $v;
         }
     }
     if (isset($this->authTableCols['lastlogin'])) {
         $customFields[] = $this->authTableCols['lastlogin'] . ' AS lastlogin';
     }
     if (isset($this->authTableCols['is_active'])) {
         $customFields[] = "CASE {$this->authTableCols['is_active']}\n                                WHEN 'Y' THEN 1\n                                WHEN 'N' THEN 0 END\n                                    AS is_active";
     }
     if (isset($this->authTableCols['owner_user_id'])) {
         $customFields[] = $this->authTableCols['owner_user_id'] . ' AS owner_user_id';
     }
     if (isset($this->authTableCols['owner_group_id'])) {
         $customFields[] = $this->authTableCols['owner_group_id'] . ' AS owner_group_id';
     }
     if (sizeof($customFields) > 0) {
         $fields = ',';
         $fields .= implode(',', $customFields);
     }
     if (sizeof($filters) > 0) {
         $where = ' WHERE';
         foreach ($filters as $f => $v) {
             if (is_array($v)) {
                 $cond = ' ' . $v['cond'];
                 $where .= " {$f}" . $v['op'] . $this->dbc->quoteSmart($v['value']) . $cond;
             } else {
                 $cond = ' AND';
                 $where .= " {$f}={$v}" . $cond;
             }
         }
         $where = substr($where, 0, -strlen($cond));
     }
     if (!is_null($order)) {
         $order = ' ORDER BY ' . $order;
     }
     // First: Get all data from auth table.
     $query = '
         SELECT
             ' . $this->authTableCols['user_id'] . '   AS auth_user_id,
             ' . $this->authTableCols['handle'] . '    AS handle,
             ' . $this->authTableCols['passwd'] . '    AS passwd
             ' . $fields . '
         FROM
             ' . $this->authTable . $where . $order;
     if ($rekey) {
         $res = $this->dbc->getAssoc($query, false, array(), DB_FETCHMODE_ASSOC);
     } else {
         $res = $this->dbc->getAll($query, array(), DB_FETCHMODE_ASSOC);
     }
     return $res;
 }
 /**
  * 合作商列表
  * @return unknown_type
  */
 public function indexAction()
 {
     /**
      * 记录日志
      */
     $log = "合作商管理\n\nServerIp:\n" . $this->request->getServer('SERVER_ADDR') . "\n\nGET:\n" . var_export($_GET, true) . "\n\nPOST:\n" . var_export($_POST, true);
     $this->oLogManager->push('log', $log);
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_SELECT);
     $partner = intval($this->request->partner_type);
     $oPartnerArr = $this->oPartner->getAll();
     $oPartnerArr = $this->oPartner->getPartner($partner, $oPartnerArr);
     foreach ($oPartnerArr as $k => $v) {
         $oPartnerArr[$k]['notes'] = json_decode($v['notes'], true);
     }
     include $this->tpl();
 }
 /**
  * Generate the (X)HTML to display the customised form.
  *
  * @return string The generated (X)HTML.
  */
 function show()
 {
     // Get the parameter description.
     $description = '<p>' . $this->objLanguage->languageText('mod_creativecommons_default', 'creativecommons') . '</p>';
     // Load the radio button class form the htmlelements module.
     $this->loadClass('radio', 'htmlelements');
     // The name of the input field must be "pvalue".
     $objElement = new radio('pvalue');
     // Add the licenses as options.
     foreach ($this->objCC->getAll() as $license) {
         $objElement->addOption($license['code'], $license['title']);
     }
     // Have the current value selected by default.
     $objElement->setSelected($this->defaultValue);
     // Display the radio buttons on separate lines.
     $objElement->setBreakSpace('<br />');
     // Return the output.
     return $description . $objElement->show();
 }
Example #19
0
 /**
  * Renders shortcode 
  * 
  * @param  object $attrs   Attributes collection  
  * @param  string $content Shortcode content
  * @param  string $tag     Shortcode tag
  * @return void
  */
 public function render($attrs, $content = null, $tag)
 {
     if ($attrs->get('id')) {
         // Set video
         $attrs->set('source', 'youtube');
         // Making sure 'url' doesn't exist
         $attrs->remove('url');
         (new View())->render($this->getTemplatePath(), $attrs->getAll());
     }
 }
Example #20
0
 /**
  * 获取机柜列表
  * @return 下拉列表
  */
 public function getCageByDepotction()
 {
     $DepotId = abs(intval($this->request->DepotId));
     $CageArr = $this->oCage->getAll($DepotId);
     if (count($CageArr)) {
         foreach ($CageArr as $CageCode => $CageData) {
             echo "<option value='{$CageCode}'>{CageCode}</option>";
         }
     }
 }
Example #21
0
 public function getMoneyTypeAction()
 {
     $AppId = intval($this->request->AppId) ? intval($this->request->AppId) : 0;
     $MoneyTypeArr = $this->oMoneyType->getAll($AppId);
     echo "<option value=''>全部</option>";
     if (is_array($MoneyTypeArr[$AppId])) {
         foreach ($MoneyTypeArr[$AppId] as $MoneyTypeId => $data) {
             echo "<option value='{$MoneyTypeId}'>{$data['name']}</option>";
         }
     }
 }
Example #22
0
 /**
  * Read a key from the cache
  *
  * @param  string $key Identifier for the data
  * @return mixed  The cached data, or false if the data doesn't exist, has expired, or if there was an error fetching it
  * @access public
  */
 public function read($key)
 {
     $criteria = new CriteriaCompo(new Criteria($this->model->keyname, $key));
     $criteria->add(new Criteria($this->fields[1], time(), '>'));
     $criteria->setLimit(1);
     $data = $this->model->getAll($criteria);
     if (!$data) {
         return null;
     }
     return unserialize($data[0]);
 }
 public function getJobAction()
 {
     $AppId = intval($this->request->AppId) ? intval($this->request->AppId) : 0;
     $JobArr = $this->oJob->getAll($AppId);
     echo "<option value=''>--全部--</option>";
     if (is_array($JobArr[$AppId])) {
         foreach ($JobArr[$AppId] as $job_id => $job) {
             echo "<option value='{$job_id}'>{$job['name']}</option>";
         }
     }
 }
Example #24
0
 public function addDetailAction()
 {
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
     $SourceProjectId = intval($this->request->SourceProjectId);
     $SourceProject = $this->oSourceProject->getRow($SourceProjectId, '*');
     $SourceList = $this->oSource->getAll();
     $SourceDetailList = $this->oSourceDetail->getAll(0);
     $SourceTypeList = $this->SourceTypeList;
     include $this->tpl('Config_Source_Project_Detail_add');
 }
 public function getPrizeAction()
 {
     $LotoId = intval($this->request->LotoId) ? intval($this->request->LotoId) : 0;
     $PrizeArr = $this->oPrize->getAll($LotoId);
     echo "<option value=''>--全部--</option>";
     if (is_array($PrizeArr[$LotoId])) {
         foreach ($PrizeArr[$LotoId] as $job_id => $job) {
             echo "<option value='{$job_id}'>{$job['LotoPrizeName']}</option>";
         }
     }
 }
Example #26
0
 public function getQuestAction()
 {
     $AppId = intval($this->request->AppId) ? intval($this->request->AppId) : 0;
     $QuestArr = $this->oQuest->getAll($AppId);
     echo "<option value=''>全部</option>";
     if (is_array($QuestArr[$AppId])) {
         foreach ($QuestArr[$AppId] as $quest_id => $quest) {
             echo "<option value='{$quest_id}'>{$quest['name']}</option>";
         }
     }
 }
Example #27
0
 /**
  * Gets all of the values from a configuration object
  * All configuration keys are converted to lowercase
  *
  * @param object $source
  * @return bool
  */
 public function load($source)
 {
     if (!$source instanceof Config_base) {
         throw new Config_InvalidObject('unable to load config object, class does not extend "Config_base"');
     }
     $values = $source->getAll();
     if (!is_array($values)) {
         throw new Config_InvalidValue('unable to load config, value given is not an array');
     }
     // Load the values
     return $this->setConfigValues(zula_merge_recursive($this->getAll(), $values));
 }
Example #28
0
 public function modifyAction()
 {
     //检查权限
     $this->manager->checkMenuPermission($this->sign, Widget_Manager::MENU_PURVIEW_UPDATE);
     $SourceDetail = trim($this->request->SourceDetail);
     $SourceTypeList = $this->SourceTypeList;
     $SourceDetailData = $this->oSourceDetail->getRow($SourceDetail, '*');
     $SourceInfo = $this->oSource->getRow($SourceDetailData['SourceId']);
     $SourceDetailData['SourceTypeId'] = $SourceInfo['SourceTypeId'];
     $SourceList = $this->oSource->getAll($SourceDetailData['SourceTypeId']);
     include $this->tpl('Config_Source_Detail_modify');
 }
Example #29
0
 /**
  * Fetch the available langs if they're not cached yet.
  */
 function fetchLangs()
 {
     $query = sprintf('SELECT %s AS id, %s AS name, %s AS meta, %s AS error_text, %s AS encoding FROM %s', $this->options['lang_id_col'], $this->options['lang_name_col'], $this->options['lang_meta_col'], $this->options['lang_errmsg_col'], $this->options['lang_encoding_col'], $this->options['langs_avail_table']);
     ++$this->_queries;
     $res = $this->db->getAll($query, DB_FETCHMODE_ASSOC);
     if (PEAR::isError($res)) {
         return $res;
     }
     foreach ($res as $row) {
         $this->langs[$row['id']] = $row;
     }
 }
Example #30
0
 /**
  * Renders shortcode 
  * 
  * @param  object $attrs   Attributes collection  
  * @param  string $content Shortcode content
  * @param  string $tag     Shortcode tag
  * @return void
  */
 public function render($attrs, $content = null, $tag)
 {
     if ($attrs->get('id') && $attrs->get('size')) {
         $attrs->set('url', null);
         $image_data = wp_get_attachment_image_src($attrs->get('id'), $attrs->get('size'));
         if ($image_data) {
             $attrs->set('url', reset($image_data));
         }
     }
     if ($attrs->get('url')) {
         (new View())->render($this->getTemplatePath(), $attrs->getAll());
     }
 }