function AdminProType()
 {
     parent::MY_Controller();
     if (!$this->auth->isImport()) {
         showError('您无此页面操作权限', '/');
     }
 }
Beispiel #2
0
 function Admin_Controller()
 {
     parent::MY_Controller();
     $allow_access = FALSE;
     // These pages get past permission checks
     $ignored_pages = array('admin/login', 'admin/logout');
     // Check if the current page is to be ignored
     $current_page = $this->uri->segment(1, '') . '/' . $this->uri->segment(2, '');
     $is_ignored_page = in_array($current_page, $ignored_pages);
     // Check the user is an admin
     $is_admin = $this->user_lib->check_role('admin');
     // Login: If not logged in and its not an ignored page, force login
     if (!$this->data->user && !$is_ignored_page) {
         redirect('admin/login');
     } else {
         $allow_access = TRUE;
     }
     // We are looking at the index page. Show it if they have ANY admin access at all
     if (in_array($current_page, array('admin/', 'admin/index')) && $this->permissions_m->hasAdminAccess($this->data->user->role)) {
         $allow_access = TRUE;
     } elseif (!$is_admin && !$is_ignored_page) {
         // Check if the current user can view that page
         $location = array('module' => $this->module, 'controller' => $this->controller, 'method' => $this->method);
         $allow_access = $this->permissions_m->checkRuleByRole($this->data->user->role, $location);
     }
     // Show error and exit if the user does not have sufficient permissions
     if (!$allow_access) {
         show_error('You do not have sufficient permissions to view this page.');
         exit;
     }
     $this->data->toolbar = $this->modules_m->getModuleToolbar($this->module);
     $this->layout->layout_file = 'admin/layout.php';
     //$this->output->enable_profiler(TRUE);
 }
 function Comodos()
 {
     parent::MY_Controller();
     //	Controller internal name
     //		Must be the same as file name (case sensitive!)
     $this->name = 'comodos';
     //	Loads model
     $this->load->model('comodos_model');
     //	links model to controler
     $this->addPersistent(&$this->comodos_model);
     //	Defines the grid properites
     $this->presentation->defineListView('846', '600', 'Cômodos');
     //	Defines the 'Edit window' properties
     $this->presentation->defineEditorWindow(400, 370, 'Editar cômodo', array('labelAlign' => 'right', 'labelPad' => 5));
     //	Defines the 'Search window' properties
     $this->presentation->defineSearchWindow(400, 250, 'Procurar por cômodo');
     //	Creates a new page on editor window
     $this->presentation->addPage('Base info');
     //	Defines a field from model
     $field = new PresentationField();
     $field->name = 'nomeComodo';
     $field->title = 'Cômodo';
     $field->titleGrid = 'Cômodo';
     $field->widthGrid = 100;
     //	Adds a field object to presentation object
     $this->presentation->setField($field);
     $field = new PresentationField();
     $field->name = 'descricao';
     $field->title = 'Descrição';
     $field->titleGrid = 'Descrição';
     $field->widthGrid = 200;
     $this->presentation->setField($field);
     $this->presentation->addPage('Job info');
     $this->renderer->listViewPageSize = 50;
 }
Beispiel #4
0
 function Report()
 {
     parent::MY_Controller();
     $this->fundList = array(1 => '专营店营销基金', 2 => '区域营销基金', 3 => '车展基金', 4 => '巡展基金', 5 => '专项基金');
     $this->reportList = array(1 => array(1 => '项目费用总表', 2 => '线下广宣传播明细表', 3 => '线下营销活动明细表'), 2 => array(1 => '项目费用总表', 2 => '线下广宣传播明细表', 3 => '线下营销活动明细表'), 3 => array(1 => '项目费用总表', 2 => '项目费用明细表'), 4 => array(1 => '项目费用总表', 2 => '项目费用明细表'), 5 => array(1 => '项目费用总表', 2 => '线下广宣传播明细表', 3 => '线下营销活动明细表'));
     $this->load->model('timeUnitModel');
 }
Beispiel #5
0
 function Public_Controller()
 {
     parent::MY_Controller();
     $this->benchmark->mark('public_controller_start');
     // Check the frontend hasnt been disabled by an admin
     if (!$this->settings->item('frontend_enabled')) {
         $error = $this->settings->item('unavailable_message') ? $this->settings->item('unavailable_message') : lang('cms_fatal_error');
         show_error($error);
     }
     // -- Navigation menu -----------------------------------
     $this->load->model('pages/pages_m');
     // Set the theme view folder
     $this->template->set_theme($this->settings->item('default_theme'));
     $this->asset->set_theme($this->settings->item('default_theme'));
     $this->template->set_layout('layout');
     $this->template->append_metadata(js('jquery/jquery.js'))->append_metadata(js('jquery/jquery.fancybox.js'))->append_metadata(css('jquery/jquery.fancybox.css'))->append_metadata(js('front.js'));
     // Make sure whatever page the user loads it by, its telling search robots the correct formatted URL
     $this->template->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
     // If there is a news module, link to its RSS feed in the head
     if (module_exists('news')) {
         $this->template->append_metadata('<link rel="alternate" type="application/rss+xml" title="' . $this->settings->item('site_name') . '" href="' . site_url('news/rss/all|rss') . '" />');
     }
     // Enable profiler on local box
     if (ENV == 'local' && $this->input->get('_debug')) {
         $this->output->enable_profiler(TRUE);
     }
     // Frontend data
     $this->load->library('variables/variables');
     $this->load->vars('variable', $this->variables->get());
     $this->benchmark->mark('public_controller_end');
 }
 public function __construct()
 {
     parent::MY_Controller();
     /* User Data */
     $query = $this->db->query("SELECT * FROM `user` WHERE `id` = '{$this->userID}'");
     $result = $query->result_array();
     $this->data["user_data"] = $result[0];
     /* Employee Data */
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Doctor'");
     $doctor = $query->num_rows();
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Nurse'");
     $nurse = $query->num_rows();
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Janitor'");
     $janitor = $query->num_rows();
     $query = $this->db->query("SELECT * FROM `employees_hired` WHERE `uid` = '{$this->userID}' AND `type` = 'Receptionist'");
     $receptionist = $query->num_rows();
     $this->data["user_data"]["employee"] = array("Doctor" => $doctor, "Nurse" => $nurse, "Janitor" => $janitor, "Receptionist" => $receptionist);
     /* Building Data */
     $query = $this->db->query("SELECT * FROM `buildings_built` WHERE `uid` = '{$this->userID}'");
     $result = $query->result_array();
     foreach ($result as $value) {
         $completed[$value['bid']]++;
     }
     $this->data["user_data"]["building"] = $completed;
 }
Beispiel #7
0
 function __construct()
 {
     parent::MY_Controller();
     $this->session->set_userdata(array(config_item('session_admin') . 'menu_current' => 1));
     $this->load->library('login_manager');
     $this->checkRole(array(1));
 }
 function Setor_tipos()
 {
     parent::MY_Controller();
     $this->name = "setor_tipos";
     $this->data['title'] = "Gerencie tipos de setor";
     $this->load->model("setor_tipos_model");
     $this->addPersistent(&$this->setor_tipos_model);
     $this->presentation->defineListView("846", "600", "Tipos de setores");
     $this->presentation->defineEditorWindow(400, 250, "Editar setor");
     $this->presentation->defineSearchWindow(400, 250, "Procurando em setores");
     $this->presentation->addPage("Gerenciando tipos de setor");
     $field = new PresentationField();
     $field->name = "setor";
     $field->title = "Nome do Setor";
     $field->titleGrid = "Nome do Setor";
     $field->widthGrid = 100;
     $this->presentation->setField($field);
     $field = new PresentationField();
     $field->name = "desc";
     $field->title = "Descrição";
     $field->titleGrid = "Descrição";
     $field->widthGrid = 100;
     $this->presentation->setField($field);
     $this->renderer->listViewPageSize = 50;
 }
Beispiel #9
0
 function Settings()
 {
     parent::MY_Controller();
     $this->load->library('validation');
     $this->load->helper(array('logo', 'file', 'form', 'path'));
     $this->load->model('settings_model');
 }
Beispiel #10
0
 function Public_Controller()
 {
     parent::MY_Controller();
     // Check the frontend hasnt been disabled by an admin
     if (!$this->settings->item('frontend_enabled')) {
         $error = $this->settings->item('unavailable_message') ? $this->settings->item('unavailable_message') : 'Fatal error, is CMS installed?';
         show_error($error);
     }
     // start language string handling
     $this->lang->load('main');
     $this->data->naviHead = $this->lang->line('navigation_headline');
     $this->data->loggedInWelcome = sprintf($this->lang->line('logged_in_welcome'), @$this->data->user->first_name . ' ' . @$this->data->user->last_name);
     $this->data->logoutLabel = $this->lang->line('logout_label');
     $this->data->editProfileLabel = $this->lang->line('edit_profile_label');
     $this->data->settingsLabel = $this->lang->line('settings_label');
     $this->data->cpTitle = $this->lang->line('cp_title');
     $this->data->breadcrumbBaseLabel = $this->lang->line('breadcrumb_base_label');
     // stop language string handling
     // -- Navigation menu -----------------------------------
     $this->load->module_model('pages', 'pages_m');
     $this->load->module_model('navigation', 'navigation_m');
     $this->data->navigation = $this->cache->model('navigation_m', 'frontendNavigation', array(), $this->settings->item('navigation_cache'));
     // Set the theme view folder
     $this->data->theme_view_folder = '../themes/' . $this->settings->item('default_theme') . '/views/';
     $this->layout->layout_file = $this->data->theme_view_folder . 'layout.php';
     // Make sure whatever page the user loads it by, its telling search robots the correct formatted URL
     $this->layout->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
     // If there is a news module, link to its RSS feed in the head
     if (is_module('news')) {
         $this->layout->extra_head('<link rel="alternate" type="application/rss+xml" title="' . $this->settings->item('site_name') . '" href="' . site_url('news/rss/all|rss') . '" />');
     }
     //$this->output->enable_profiler(TRUE);
 }
Beispiel #11
0
 function Classes()
 {
     parent::MY_Controller();
     $this->load->model('redux_auth_model');
     $this->load->model('post');
     $this->load->model('educlass');
 }
Beispiel #12
0
 function Supplement()
 {
     parent::MY_Controller();
     $this->navbarFocus = 'Supplement';
     $this->fundTypeConf = array(1 => '单店基金', 2 => '城市提升');
     $this->levelConf = array(1 => '普通补报', 2 => '特殊补报');
 }
 function Clients()
 {
     parent::MY_Controller();
     $this->load->helper('date');
     $this->load->library('validation');
     $this->load->model('clients_model');
 }
Beispiel #14
0
 function Public_Controller()
 {
     parent::MY_Controller();
     // Check the frontend hasnt been disabled by an admin
     if (!$this->settings->item('frontend_enabled')) {
         $error = $this->settings->item('unavailable_message') ? $this->settings->item('unavailable_message') : lang('cms_fatal_error');
         show_error($error);
     }
     $this->lang->load('main');
     // -- Navigation menu -----------------------------------
     $this->load->module_model('pages', 'pages_m');
     $this->load->module_model('navigation', 'navigation_m');
     $this->data->navigation = $this->cache->model('navigation_m', 'frontendNavigation', array(), $this->settings->item('navigation_cache'));
     // Set the theme view folder
     $this->layout->theme($this->settings->item('default_theme'));
     // If the GET variable isbasic exists, do not use a wrapper
     if ($this->input->get('_is_basic')) {
         $this->layout->wrapper(FALSE);
     } else {
         $this->layout->wrapper('layouts/default');
     }
     // Make sure whatever page the user loads it by, its telling search robots the correct formatted URL
     $this->layout->set_metadata('canonical', site_url($this->uri->uri_string()), 'link');
     // If there is a news module, link to its RSS feed in the head
     if (is_module('news')) {
         $this->layout->extra_head('<link rel="alternate" type="application/rss+xml" title="' . $this->settings->item('site_name') . '" href="' . site_url('news/rss/all|rss') . '" />');
     }
     //$this->output->enable_profiler(TRUE);
 }
 function SinglePOffline()
 {
     parent::MY_Controller();
     //设置导航选中
     $this->navbarFocus = 'SingleBudget';
     //$this->theme = 'bootstrap';
 }
Beispiel #16
0
 function __construct()
 {
     parent::MY_Controller();
     $this->load->helper(array('form', 'text'));
     $this->isSearch = FALSE;
     $this->q = FALSE;
 }
Beispiel #17
0
 function __construct()
 {
     parent::MY_Controller();
     $meta = $this->setup_model->get(array('type' => 'meta'));
     $this->load->model('contents_model');
     $this->_data = array('tlp_title' => $meta['title_general'], 'tlp_meta_description' => $meta['description_general'], 'tlp_meta_keywords' => $meta['keywords_general'], 'content_footer' => array('sitios-recomendados' => $this->contents_model->get_content('sitios-recomendados'), 'web-amigas' => $this->contents_model->get_content('web-amigas')));
 }
 public function __construct()
 {
     parent::MY_Controller();
     if ($this->data['authLevel'] == "Admin") {
         $this->loadscript("admin/general");
     }
 }
Beispiel #19
0
 function Report()
 {
     parent::MY_Controller();
     $fundList = $this->config->item('fundType');
     $this->fundList = $fundList;
     $this->reportList = array(1 => array(1 => '线上明细表', 2 => '线下明细表', 3 => '项目费用表', 4 => '标准动作执行统计表'), 2 => array(1 => '线上明细表', 2 => '线下明细表', 3 => '项目费用表', 4 => '标准动作执行统计表'), 3 => array(1 => '线上明细表', 2 => '线下明细表', 3 => '项目费用表'), 4 => array(1 => '线上明细表', 2 => '线下明细表', 3 => '项目费用表'), 5 => array(1 => '固定传播项目', 2 => '双月发布检核'), 6 => array(1 => '线上明细表', 2 => '线下明细表', 3 => '项目费用表'), 7 => array(1 => '线上明细表', 2 => '线下明细表', 3 => '项目费用表'));
     $this->load->model('timeUnitModel');
 }
Beispiel #20
0
 function Image()
 {
     parent::MY_Controller();
     // Images model!
     $this->load->model('Images_model');
     // Thumdb library!
     $this->load->library('thumdb');
 }
 public function __construct()
 {
     parent::MY_Controller();
     #if($this->data['authLevel'] !== "Admin")
     #show_error("You may not access this page!");
     $this->loadscript("admin/admin_general");
     $this->loadscript("jquery.ingrid");
 }
Beispiel #22
0
 function Messages()
 {
     parent::MY_Controller();
     // session check
     if ($this->session->userdata('loggedin') == NULL) {
         redirect('login');
     }
 }
Beispiel #23
0
 function __construct()
 {
     parent::MY_Controller();
     $this->load->helper(array('form', 'url', 'html'));
     //$this->output->enable_profiler(TRUE);
     $params = $this->_get_settings();
     $this->load->library('Invoice_api', $params);
 }
Beispiel #24
0
 function Login()
 {
     parent::MY_Controller();
     $this->load->model('settings_model', '', TRUE);
     $this->load->helper('string');
     $this->load->library('encrypt');
     $this->load->library('email');
 }
 public function __construct()
 {
     parent::MY_Controller();
     $query = $this->db->query("SELECT numPills as pills, id FROM user WHERE id = '{$this->userID}'");
     $result = $query->result_array();
     $this->numPills = $result[0]['pills'];
     $this->data['numPills'] = $this->numPills;
 }
Beispiel #26
0
 function fileupload()
 {
     parent::MY_Controller();
     $this->load->model('fileupload_model');
     $this->load->library('upload');
     $this->temp_folder = $this->config->config["document_root"] . "temp_attach";
     $this->upload_folder = $this->config->config["document_root"] . "attach";
 }
Beispiel #27
0
 /**
  * Constructor method
  *
  * @access public
  * @return void
  */
 public function __construct()
 {
     parent::MY_Controller();
     $this->load->helper(array('text'));
     $this->load->library('cf_sitemap_lib');
     //Load Plugin
     $this->load->model('blog/cf_blog_model');
 }
Beispiel #28
0
 function Invoices()
 {
     parent::MY_Controller();
     $this->lang->load('calendar');
     $this->load->helper(array('date', 'text', 'typography'));
     $this->load->library('pagination');
     $this->load->model('invoices_model');
     $this->load->model('clients_model');
 }
Beispiel #29
0
 function __construct()
 {
     parent::MY_Controller();
     $this->load->helper(array('form', 'text'));
     $id = $this->uri->segment(5, 0);
     if (!isset($_POST['group_id']) && $id) {
         $_POST['group_id'] = (int) $id;
     }
 }
 function Reports()
 {
     parent::MY_Controller();
     $this->load->helper(array('date', 'text'));
     $this->load->library('pagination');
     $this->load->library('table');
     $this->load->model('invoices_model');
     $this->load->model('reports_model');
 }