芝麻web文件管理V1.00
编辑当前文件:/home/qrafawbu/joolsmen.com/application/controllers/user/Myservice.php
data['base_url'] = base_url(); $this->session->keep_flashdata('error_message'); $this->session->keep_flashdata('success_message'); $this->load->helper('user_timezone_helper'); $this->load->helper('push_notifications'); $this->load->model('api_model','api'); $this->load->model('service_model','service'); $this->load->model('home_model','home'); // Load pagination library $this->load->library('ajax_pagination'); // Load post model $this->load->model('post'); // Per page limit $this->perPage = 12; $this->data['theme'] = 'user'; $this->data['module'] = 'service'; $default_language_select = default_language(); if ($this->session->userdata('user_select_language') == '') { $this->data['user_selected'] = $default_language_select['language_value']; } else { $this->data['user_selected'] = $this->session->userdata('user_select_language'); } $this->data['active_language'] = $active_lang = active_language(); $lg = custom_language($this->data['user_selected']); $this->data['default_language'] = $lg['default_lang']; $this->data['user_language'] = $lg['user_lang']; $this->user_selected = (!empty($this->data['user_selected'])) ? $this->data['user_selected'] : 'en'; $this->default_language = (!empty($this->data['default_language'])) ? $this->data['default_language'] : ''; $this->user_language = (!empty($this->data['user_language'])) ? $this->data['user_language'] : ''; } public function index(){ if(empty($this->session->userdata('id'))){ redirect(base_url()); } $data = array(); // Get record count $conditions['returnType'] = 'count'; $totalRec = $this->post->getRows($conditions); // Pagination configuration $config['target'] = '#dataList'; $config['base_url'] = base_url('user/myservice/ajaxPaginationData'); $config['total_rows'] = $totalRec; $config['per_page'] = $this->perPage; // Initialize pagination library $this->ajax_pagination->initialize($config); // Get records $conditions = array( 'limit' => $this->perPage ); $this->data['services'] = $this->post->getRows($conditions); $this->data['page'] = 'my_service_new'; // Load the list page view $this->load->vars($this->data); $this->load->view($this->data['theme'].'/template'); } function ajaxPaginationData(){ // Define offset $page = $this->input->post('page'); if(!$page){ $offset = 0; }else{ $offset = $page; } // Get record count $conditions['returnType'] = 'count'; $totalRec = $this->post->getRows($conditions); // Pagination configuration $config['target'] = '#dataList'; $config['base_url'] = base_url('user/myservice/ajaxPaginationData'); $config['total_rows'] = $totalRec; $config['per_page'] = $this->perPage; // Initialize pagination library $this->ajax_pagination->initialize($config); // Get records $conditions = array( 'start' => $offset, 'limit' => $this->perPage ); $this->data['services'] = $this->post->getRows($conditions); // Load the data list view $this->load->view('user/service/ajax-data', $this->data, false); } public function inactive_services() { if(empty($this->session->userdata('id'))){ redirect(base_url()); } $data = array(); // Get record count $conditions['returnType'] = 'count'; $totalRec = $this->post->getInactiveRows($conditions); // Pagination configuration $config['target'] = '#dataList'; $config['base_url'] = base_url('user/myservice/inactiveajaxPaginationData'); $config['total_rows'] = $totalRec; $config['per_page'] = $this->perPage; // Initialize pagination library $this->ajax_pagination->initialize($config); // Get records $conditions = array( 'limit' => $this->perPage ); $this->data['services'] = $this->post->getInactiveRows($conditions); $this->data['page'] = 'my_service_inactive'; // Load the list page view $this->load->vars($this->data); $this->load->view($this->data['theme'].'/template'); } function inactiveajaxPaginationData(){ // Define offset $page = $this->input->post('page'); if(!$page){ $offset = 0; }else{ $offset = $page; } // Get record count $conditions['returnType'] = 'count'; $totalRec = $this->post->getInactiveRows($conditions); // Pagination configuration $config['target'] = '#dataList'; $config['base_url'] = base_url('user/myservice/inactiveajaxPaginationData'); $config['total_rows'] = $totalRec; $config['per_page'] = $this->perPage; // Initialize pagination library $this->ajax_pagination->initialize($config); // Get records $conditions = array( 'start' => $offset, 'limit' => $this->perPage ); $this->data['services'] = $this->post->getInactiveRows($conditions); // Load the data list view $this->load->view('user/service/service-inactive-ajax-data', $this->data, false); } }