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


PHP Base::_getMenu方法代码示例

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


在下文中一共展示了Base::_getMenu方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: icView

 public function icView($id)
 {
     /*
      * Loading libraries and helpers
      */
     $this->load->library(array('rb', 'session'));
     $this->load->helper(array('form'));
     /*
      * User has auth to do this?
      */
     if (!parent::_hasAuth('view_ic', $this->session->userdata('user_ic'))) {
         echo "Você não tem permissão para realizar este procedimento.";
         exit;
     }
     /*
      * Retrieving the IC
      */
     $g = R::findOne('ic', 'id=? AND active!="no" ', array($id));
     /*
      * Can user access this IC?
      */
     $tmp = R::findOne('ic', 'id=?', array($this->session->userdata('user_ic')));
     if ($tmp->master != 'yes') {
         if ($this->session->userdata('user_ic') != $id) {
             $this->session->set_flashdata('error', 'Você não tem autorização realizar esta ação neste Centro de Informação');
             redirect('dashboard/ic');
         }
     }
     /*
      * Verifying if ic exists
      */
     if ($g == NULL) {
         $this->session->set_flashdata('error', 'O centro de informação solicitado para visualização não existe.');
         redirect('dashboard/ic');
     }
     /*
      * Loading views
      */
     $this->load->view('dashboard/template/header');
     $this->load->view('dashboard/template/menu', array('menu' => parent::_getMenu(parent::_getIc()->id), 'ics' => parent::_getIcs(), 'ic' => parent::_getIc()));
     $this->load->view('dashboard/ic/view', array('ic' => $g));
     $this->load->view('dashboard/template/footer');
 }
开发者ID:victorschinaider,项目名称:solicitacao-informacao,代码行数:43,代码来源:Ic.php

示例2: userView

 public function userView($id)
 {
     /*
      * Loading libraries and helpers
      */
     $this->load->library(array('rb', 'session'));
     $this->load->helper(array('form'));
     /*
      * User is logged ?
      */
     if (!parent::_isLogged()) {
         redirect('dashboard');
         exit;
     }
     /*
      * User has auth to do this?
      */
     if (!parent::_hasAuth('view_user', $this->session->userdata('user_ic'))) {
         $this->session->set_flashdata('error', 'Você não tem autorização para visualizar um usuário.');
         redirect('dashboard');
         exit;
     }
     /*
      * Finding the user
      */
     $user = R::findOne('user', 'id=? AND active!="no" ', array($id));
     /*
      * Verifying if user exists
      */
     if ($user == NULL) {
         $this->session->set_flashdata('error', 'O usuário solicitado para visualização não existe.');
         redirect('dashboard/user');
         exit;
     }
     /*
      * Verifying if user exists
      */
     $this->load->view('dashboard/template/header');
     $this->load->view('dashboard/template/menu', array('menu' => parent::_getMenu(parent::_getIc()->id), 'ics' => parent::_getIcs(), 'ic' => parent::_getIc()));
     $this->load->view('dashboard/user/view', array('user' => $user));
     $this->load->view('dashboard/template/footer');
 }
开发者ID:victorschinaider,项目名称:solicitacao-informacao,代码行数:42,代码来源:User.php

示例3: answeredView

 public function answeredView($id = NULL)
 {
     /*
      * Loading libraries
      */
     $this->load->library(array('rb', 'session'));
     $this->load->helper(array('form'));
     /*
      * User is logged?
      */
     if (!parent::_isLogged()) {
         redirect('dashboard');
         exit;
     }
     /*
      * Verify if user has autority to view the ic's
      */
     if (!parent::_hasAuth('view_request', $this->session->userdata('user_ic'))) {
         echo "Você não tem permissão para realizar este procedimento.";
         exit;
     }
     /* 
      * If $id is NULL, then load all answered requests. Otherwise, show only the specified request
      */
     if ($id == NULL) {
         /* 
          * Verify if the user is logged in MASTER IC or not. If it's the MASTER IC
          * then it shows all the Requests, otherwise, only show Requests from actual IC.
          */
         $requests = null;
         $isMasterIc = R::count('ic', 'id=? AND master="yes" ', array($this->session->userdata('user_ic')));
         if ($isMasterIc) {
             $rows = R::getAll('
                 SELECT r.* FROM request AS r 
                 JOIN status AS s ON s.request_id = r.id
                 WHERE s.type = "request_replied" AND s.current = "Y"
             ');
             $requests = R::convertToBeans('request', $rows);
         } else {
             $rows = R::getAll('
                 SELECT r.* FROM request AS r 
                 JOIN status AS s ON s.request_id = r.id
                 WHERE s.type = "request_replied" AND s.current = "Y" AND s.ic_id = ?
                 ', array($this->session->userdata('user_ic')));
             $requests = R::convertToBeans('request', $rows);
         }
         /*
          * Loading views
          */
         $this->load->view('dashboard/template/header');
         $this->load->view('dashboard/template/menu', array('menu' => parent::_getMenu(parent::_getIc()->id), 'ics' => parent::_getIcs(), 'ic' => parent::_getIc()));
         $this->load->view('dashboard/request/answered', array('requests' => $requests));
         $this->load->view('dashboard/template/footer');
     } else {
         /* 
          * Loading the request
          */
         $request = R::findOne('request', ' id = ? ', array($id));
         /* 
          * Request exists? 
          */
         if ($request == NULL) {
             $this->session->set_flashdata('success', 'A solicitação não existe.');
             redirect('dashboard/request/answered');
         }
         /* 
          * Getting current status of request
          */
         $status = R::findOne('status', 'request_id = ? AND current = "Y" ', array($request->id));
         /*
          * Can user access the request?
          */
         if (!self::_canAcessRequest($request)) {
             $this->session->set_flashdata('success', 'Você não tem autorização para acessar esta solicitação.');
             redirect('dashboard/request/answered');
         }
         /*
          * Loading views
          */
         $this->load->view('dashboard/template/header');
         $this->load->view('dashboard/template/menu', array('menu' => parent::_getMenu(parent::_getIc()->id), 'ics' => parent::_getIcs(), 'ic' => parent::_getIc()));
         $this->load->view('dashboard/request/answered-select', array('status' => $status, 'request' => $request));
         $this->load->view('dashboard/template/footer');
     }
 }
开发者ID:victorschinaider,项目名称:solicitacao-informacao,代码行数:85,代码来源:Request.php

示例4: manageView

 public function manageView()
 {
     /*
      * Loadings libraries and helpers
      */
     $this->load->library(array('rb'));
     $this->load->helper(array('form'));
     /*
      * User is logged?
      */
     if (!parent::_isLogged()) {
         redirect('dashboard');
     }
     /*
      * General Information
      */
     $openRequestsQry = '
         SELECT r.*
         FROM status AS s
         JOIN request AS r 
         ON r.id = s.request_id 
         WHERE 
             s.current = "Y" 
             AND ( s.type = "waiting-open" 
                 OR s.type = "request_created" 
                 OR s.type = "request_moved" 
                 OR s.type = "request_extended" 
             ) 
     ';
     $openRequests = R::getAll($openRequestsQry);
     $openRequests = R::convertToBeans('request', $openRequests);
     $deadlineRequestsQry = '
         SELECT r.*
         FROM status AS s 
         JOIN request AS r 
         ON r.id = s.request_id 
         WHERE 
             ( 
                 NOW() > DATE_ADD( r.created_at, INTERVAL 20 DAY )
                 AND
                 ( SELECT COUNT(*) FROM status AS ss WHERE request_id = r.id AND type = "request_extended" ) <= 0
             )
             OR
             (
                 NOW() > DATE_ADD( r.created_at, INTERVAL 30 DAY )
                 AND
                 ( SELECT COUNT(*) FROM status AS ss WHERE request_id = r.id AND type = "request_extended" ) > 0
             )
     ';
     $deadlineRequests = R::getAll($deadlineRequestsQry);
     $deadlineRequests = R::convertToBeans('request', $deadlineRequests);
     $repliedRequestsQry = '
         SELECT r.*
         FROM status AS s
         JOIN request AS r 
         ON r.id = s.request_id 
         WHERE 
             s.current = "Y" 
             AND s.type = "request_replied" 
     ';
     $repliedRequests = R::getAll($repliedRequestsQry);
     $repliedRequests = R::convertToBeans('request', $repliedRequests);
     $data = array('ics' => R::find('ic', ' active="yes" '), 'openRequests' => count($openRequests), 'deadlineRequests' => count($deadlineRequests), 'replyRequests' => count($repliedRequests), 'totalRequests' => R::count('request'));
     /*
      * Loading views
      */
     $this->load->view('dashboard/template/header');
     $this->load->view('dashboard/template/menu', array('menu' => parent::_getMenu(parent::_getIc()->id), 'ics' => parent::_getIcs(), 'ic' => parent::_getIc()));
     $this->load->view('dashboard/manage', $data);
     $this->load->view('dashboard/template/footer');
 }
开发者ID:victorschinaider,项目名称:solicitacao-informacao,代码行数:71,代码来源:Dashboard.php

示例5: groupView

 public function groupView($id)
 {
     /*
      * Loading libraries and helpers
      */
     $this->load->library(array('rb', 'session'));
     $this->load->helper(array('form'));
     /*
      * User has auth to do this?
      */
     if (!parent::_hasAuth('view_group', $this->session->userdata('user_ic'))) {
         echo "Você não tem permissão para realizar este procedimento.";
         exit;
     }
     /*
      * Retrieving the IC
      */
     $g = R::findOne('group', 'id=? AND active!="no" ', array($id));
     /*
      * Verifying if group exists
      */
     if ($g == NULL) {
         $this->session->set_flashdata('error', 'O grupo solicitado para visualização não existe.');
         redirect('dashboard/group');
     }
     /*
      * Loading views
      */
     $this->load->view('dashboard/template/header');
     $this->load->view('dashboard/template/menu', array('menu' => parent::_getMenu(parent::_getIc()->id), 'ics' => parent::_getIcs(), 'ic' => parent::_getIc()));
     $this->load->view('dashboard/group/view', array('group' => $g));
     $this->load->view('dashboard/template/footer');
 }
开发者ID:victorschinaider,项目名称:solicitacao-informacao,代码行数:33,代码来源:Group.php


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