Пример #1
0
 function _config_grid()
 {
     $config = parent::_config_grid();
     $config['fields'] = array('sgroup', 'skey', 'svalue', 'lvalue');
     $config['names'] = array('Group', 'Key', 'Short Value', 'Long Value');
     return $config;
 }
 function _check_access()
 {
     if ($this->uri->rsegments[2] == 'report') {
         return true;
     }
     return parent::_check_access();
 }
Пример #3
0
 function _config_grid()
 {
     $config = parent::_config_grid();
     $config['fields'] = array('name', 'address', 'phone', 'email', 'fax', 'website');
     $config['formats'] = array('row_detail', '', '', '', '', 'url');
     return $config;
 }
Пример #4
0
 function _check_access()
 {
     $whitelist = array('fetch');
     if (in_array($this->uri->rsegments[2], $whitelist) && $this->auth->is_login()) {
         return true;
     }
     return parent::_check_access();
 }
Пример #5
0
 function _save($id = null)
 {
     parent::_save($id);
     $provinces = $this->_model()->query('SELECT * FROM province')->result_array();
     $this->_data['province_options'] = array('' => l('(Please select)'));
     foreach ($provinces as $pro) {
         $this->_data['province_options'][$pro['id']] = $pro['name'];
     }
 }
Пример #6
0
 function _save($id = null)
 {
     parent::_save($id);
     $citys = $this->_model()->query('SELECT * FROM city')->result_array();
     $this->_data['city_options'] = array('' => l('(Please select)'));
     foreach ($citys as $ci) {
         $this->_data['city_options'][$ci['id']] = $ci['name'];
     }
 }
Пример #7
0
 function _save($id = null)
 {
     parent::_save($id);
     if (!empty($id)) {
         $this->_data['privileges'] = $this->_model()->get_privileges($id);
         $config = array('fields' => array('uri'), 'actions' => array('delete' => 'role/delete_privilege/' . $id));
         $this->load->library('xgrid', $config, 'grid_privilege');
     }
 }
Пример #8
0
 function _config_grid()
 {
     $config = parent::_config_grid();
     //$config['caption'] = array('name', 'Penilai','Manager','Nilai Rata-rata');
     $config['fields'] = array('id', 'nama', 'penilai', 'manager', 'average');
     $config['format'] = array('row_detail', '', '', '', '');
     $config['actions'] = array('');
     $config['filters'] = array('st.first_name', 'man.first_name', 'us.first_name', 'st.last_name', 'man.last_name', 'us.last_name');
     return $config;
 }
Пример #9
0
 function listing($offset = 0)
 {
     parent::listing($offset);
     foreach ($this->_data['items'] as &$item) {
         $updated = array();
         $this->_model()->status($item['id'], $updated);
         foreach ($updated as $key => $value) {
             $item[$key] = $value;
         }
     }
 }
 function _save($id = null)
 {
     if ($_POST) {
         if (is_array($_POST['address'])) {
             $_POST['address'] = trim(implode("\n", $_POST['address']));
         }
     }
     parent::_save($id);
     if (isset($_POST['address']) && !is_array($_POST['address'])) {
         $_POST['address'] = explode("\n", $_POST['address']);
     }
 }
Пример #11
0
 function _save($id = null)
 {
     if ($_POST) {
         if ($this->_validate()) {
             $CI =& get_instance();
             $user = $CI->_get_user();
             $_POST['user_id'] = $user['id'];
             $id = $this->_model()->save($_POST, $id);
             // redirect(site_url("cust_service/print_receipt/".$id));
         }
     } else {
         if ($id !== null) {
             $this->_data['id'] = $id;
             // $_POST = $this->_model()->getDetail($id);
         }
     }
     return parent::_save($id);
 }
Пример #12
0
 function detail($id)
 {
     parent::detail($id);
     $sql = 'SELECT role_id id, name FROM ' . $this->db->dbprefix . 'user_role ug LEFT JOIN ' . $this->db->dbprefix . 'role g ON ug.role_id = g.id WHERE user_id = ?';
     $this->_data['data']['role'] = $this->db->query($sql, array($id))->result_array();
     $this->load->helper('gravatar');
     $this->_view = 'user/profile';
 }
Пример #13
0
 function _post_controller_constructor()
 {
     if ($_POST) {
         switch ($_POST['_action']) {
             case l('Back'):
                 $this->action_uri = $this->_back_uri();
                 redirect($this->action_uri . '/' . $this->uri->rsegments[3]);
                 break;
             case l('Next'):
                 $this->action_uri = $this->_next_uri();
                 break;
             case l('Summary'):
                 $this->action_uri = $this->_name . '/summary';
                 break;
         }
     }
     if ($this->uri->rsegments[2] == 'summary') {
         $this->_view = 'summary_placeholder';
     }
     parent::_post_controller_constructor();
 }
Пример #14
0
 function detail($id)
 {
     parent::detail($id);
     $this->_manage_organizations($id);
 }
Пример #15
0
 function _check_access()
 {
     $allowed = array('view', 'tag');
     foreach ($allowed as $allow) {
         if ($this->uri->rsegments[2] == $allow) {
             return true;
         }
     }
     return parent::_check_access();
 }
Пример #16
0
 function _check_access()
 {
     $allows = array('activation', 'generate_activation_code', 'profile', 'request_invitation');
     foreach ($allows as $allow) {
         if ($allow == $this->uri->rsegments[2]) {
             return true;
         }
     }
     return parent::_check_access();
 }
Пример #17
0
 function _save($id = null)
 {
     parent::_save($id);
     $menus = $this->_model()->query('SELECT * FROM menu')->result_array();
     $this->_data['parent_options'][0] = 'Top';
     foreach ($menus as $menu) {
         $this->_data['parent_options'][$menu['id']] = $menu['title'] . ' (' . $menu['uri'] . ')';
     }
 }
Пример #18
0
 function _config_grid()
 {
     $config = parent::_config_grid();
     $config['fields'] = array('name');
     return $config;
 }
Пример #19
0
 function _save($id = null)
 {
     parent::_save($id);
     $this->_manage_privileges($id);
 }