示例#1
0
 public function tfo()
 {
     switch ($this->var['action']) {
         case 'add':
             /*Begin process when add button is clicked*/
             loadComponentsDropdowns();
             /*get tfo type for dropdown list*/
             $this->setMethod('getTFOType');
             $this->setIndex('tfo_type_list');
             $this->executeMethod(array('type' => 'get', 'active' => TRUE));
             /*End process when add button is clicked*/
             /*Begin process when submit button is clicked*/
             $this->setMethod('addTFO');
             $this->form_validation->set_rules('data[TFOTypeID]', 'TFO Type Name', 'trim|required');
             $this->form_validation->set_rules('data[TFOName]', 'TFO Name', 'trim|required|is_unique[tfo.TFOName]');
             $input_data = $this->input->post('data') ? $this->input->post('data') : array();
             $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'add', 'input' => $input_data)) : NULL;
             /*End process when submit button is clicked*/
             break;
         case 'edit':
             /*Begin process when edit button is clicked*/
             loadComponentsDropdowns();
             /*get tfo type for dropdown list*/
             $this->setMethod('getTFOType');
             $this->setIndex('tfo_type_list');
             $this->executeMethod(array('type' => 'get', 'active' => TRUE));
             /*get specific record by id*/
             $this->setMethod('getTFO');
             $this->setIndex('tfo_list');
             $this->executeMethod(array('type' => 'get', 'id' => $this->var['id']));
             /*End process when edit button is clicked*/
             /*Begin process when submit button is clicked*/
             $input_data = $this->input->post('data') ? $this->input->post('data') : array();
             $this->setMethod('updateTFO');
             $this->form_validation->set_rules('data[TFOTypeID]', 'TFO Type Name', 'trim|required');
             $this->form_validation->set_rules('data[TFOName]', 'TFO Name', 'trim|required');
             $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'update', 'id' => $this->var['id'], 'input' => $input_data)) : NULL;
             /*End process when submit button is clicked*/
             break;
         default:
             /*Load Data Table*/
             loadAdvancedDataTables();
             /*get all records*/
             $this->setMethod('getTFO');
             $this->setIndex('tfo_list');
             $this->executeMethod(array('type' => 'get'));
             break;
     }
     $this->viewPage();
 }
示例#2
0
 public function business_nature()
 {
     $this->setModel($this->model);
     switch ($this->var['action']) {
         case 'add':
             loadComponentsDropdowns();
             /*Begin process when submit button is clicked*/
             $this->setMethod('addBusinessNature');
             $this->form_validation->set_rules('data[PSIC]', 'PSIC', 'trim');
             $this->form_validation->set_rules('data[BusinessNatureName]', 'Business Nature Name', 'trim|required|is_unique[business_nature.BusinessNatureName]');
             $this->form_validation->set_rules('data[BusinessNatureDescription]', 'Business Nature Description', 'trim');
             $input_data = $this->input->post('data') ? $this->input->post('data') : array();
             $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'add', 'input' => $input_data)) : NULL;
             /*End process when submit button is clicked*/
             break;
         case 'edit':
             /*Begin process when edit button is clicked*/
             loadComponentsDropdowns();
             /*get specific record by id*/
             $this->setMethod('getBusinessNature');
             $this->setIndex('business_nature_list');
             $this->executeMethod(array('type' => 'get', 'id' => $this->var['id']));
             /*End process when edit button is clicked*/
             /*Begin process when submit button is clicked*/
             if ($this->input->post('data')) {
                 $input_data = $this->input->post('data') ? $this->input->post('data') : array();
                 if (isset($input_data['TFOTemplateID'])) {
                     foreach ($input_data['TFOTemplateID'] as $template_id) {
                         $input_data2 = array('BusinessNatureID' => $this->var['id'], 'TFOTemplateID' => $template_id, 'Active' => 1);
                     }
                 }
                 unset($input_data['TFOTemplateID']);
                 $this->setMethod('updateBusinessNature');
                 $this->form_validation->set_rules('data[BusinessNatureName]', 'Business Nature Name', 'trim|required');
                 $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'update', 'id' => $this->var['id'], 'input' => $input_data)) : NULL;
             }
             /*End process when submit button is clicked*/
             break;
         default:
             /*Load Data Table*/
             loadAdvancedDataTables();
             /*get all records*/
             $this->setMethod('getBusinessNature');
             $this->setIndex('business_nature_list');
             $this->executeMethod(array('type' => 'get'));
             break;
     }
     $this->viewPage();
 }
示例#3
0
 public function index()
 {
     $this->setModel('usermenu_model');
     $input_data = $this->input->post('data') ? $this->input->post('data') : array();
     switch ($this->var['action']) {
         case 'add':
             /*Begin process when edit button is clicked */
             loadComponentsDropdowns();
             loadiCheck();
             $this->setMethod('getUsermenu');
             $this->setIndex('usermenu_list');
             $this->executeMethod(array('type' => 'get', 'active' => true));
             /*End process when edit button is clicked */
             /*Begin process when submit button is clicked */
             $this->setMethod('addUsermenu');
             $this->form_validation->set_rules('data[MenuName]', 'This', 'trim|required|is_unique[user_menu.MenuName]');
             $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'add', 'input' => $input_data)) : NULL;
             /*End process when submit button is clicked */
             break;
         case 'edit':
             /*Begin process when edit button is clicked */
             loadComponentsDropdowns();
             loadiCheck();
             /*get specific user menu*/
             $this->setMethod('getUsermenuByID');
             $this->setIndex('menu_list');
             $this->executeMethod(array('type' => 'get', 'id' => $this->var['id']));
             /*get all menus for parent menu dropdown selection*/
             $this->setMethod('getUsermenu');
             $this->setIndex('usermenu_list');
             $this->executeMethod(array('type' => 'get', 'active' => true));
             /*End process when edit button is clicked */
             /*Begin process when submit button is clicked*/
             $this->setMethod('updateUsermenu');
             $this->form_validation->set_rules('data[MenuName]', 'This', 'trim|required');
             $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'update', 'id' => $this->var['id'], 'input' => $input_data)) : NULL;
             /*End Process when submit button is clicked*/
             break;
         default:
             loadAdvancedDataTables();
             $this->setMethod('getUsermenu');
             $this->setIndex('usermenu_list');
             $this->executeMethod(array('type' => 'get'));
             break;
     }
     $this->viewPage();
 }
示例#4
0
 public function index()
 {
     $this->setModel('userrole_model');
     $input_data = $this->input->post('data') ? $this->input->post('data') : array();
     switch ($this->var['action']) {
         case 'add':
             loadComponentsDropdowns();
             $input_data['Active'] = 1;
             $this->form_validation->set_rules('data[UserRoleName]', 'Name', 'trim|required|is_unique[user_role.UserRoleName]');
             if ($this->form_validation->run() == TRUE) {
                 /*set the method to add user role*/
                 $this->setMethod('addUserrole');
                 /*if adding user role is successfull*/
                 if ($this->executeMethod(array('type' => 'add', 'input' => $input_data))) {
                     /*set new container for user access input data*/
                     $data = array();
                     /*loop through each selected pages*/
                     foreach ($input_data['Page'] as $page) {
                         /*set the input data*/
                         $data[] = array('UserRoleID' => $this->{$model}->last_id, 'Page' => $page);
                     }
                     /*set the method to add user role access*/
                     $this->setMethod('addAccess');
                     /*execute the method to add user role access */
                     $this->executeMethod(array('type' => 'add', 'input' => $data));
                 }
             }
             break;
         case 'edit':
             loadComponentsDropdowns();
             /*get specific user role data*/
             $this->setMethod('getUserRole');
             $this->setIndex('userrole_list');
             $this->executeMethod(array('type' => 'get', 'id' => $this->var['id']));
             /*get page access*/
             $this->setMethod('getPageAccess');
             $this->setIndex('pages');
             $this->executeMethod(array('type' => 'get', 'id' => $this->var['id']));
             foreach ($this->var['pages'] as $row) {
                 $this->var['pageaccess_list'][] = $row['Page'];
             }
             $this->setMethod('updateUserrole');
             $this->form_validation->set_rules('data[UserRoleName]', 'Name', 'trim|required');
             if ($this->form_validation->run() == TRUE) {
                 //                    $this->var['data'] = $input_data;
                 /*set the method to add user role*/
                 $this->setMethod('updateUserrole');
                 if ($this->executeMethod(array('type' => 'update', 'id' => $this->var['id'], 'input' => $input_data))) {
                     /*remove the access*/
                     $this->setMethod('deleteAccess');
                     $this->executeMethod(array('type' => 'update'));
                     /*set new container for user access input data*/
                     $data = array();
                     /*loop through each selected pages*/
                     foreach ($input_data['Page'] as $page) {
                         /*set the input data*/
                         $data[] = array('UserRoleID' => $this->var['id'], 'Page' => $page);
                     }
                     /*set the method to add user role access*/
                     $this->setMethod('addAccess');
                     //                        $this->var['data'] = $this->$model->input_data;
                     /*execute the method to add user role access */
                     $this->executeMethod(array('type' => 'add', 'input' => $data));
                 }
             }
             break;
         default:
             loadAdvancedDataTables();
             $this->setMethod('getUserrole');
             $this->setIndex('userrole_list');
             $this->executeMethod(array('type' => 'get'));
     }
     $this->viewPage();
 }
 public function index()
 {
     switch ($this->var['action']) {
         case 'add':
             loadComponentsDropdowns();
             $this->setModel('requirement_model');
             $this->setMethod('getRequirement');
             $this->setIndex('requirement_list');
             $this->executeMethod(array('type' => 'get', 'active' => TRUE));
             /*Begin process when submit button is clicked*/
             $this->setModel('business_requirement_model');
             $this->setMethod('addBusinessRequirement');
             $this->form_validation->set_rules('data[TransactionType]', 'Transaction', 'trim|required');
             $this->form_validation->set_rules('data[RequirementID]', 'Requirement Name', 'trim|required');
             if ($this->input->post('data')) {
                 /*set input data*/
                 $data = $this->input->post('data');
                 foreach ($data['RequirementID'] as $requirement) {
                     $input_data[] = array('TransactionType' => $data['TransactionType'], 'RequirementID' => $requirement, 'Active' => 1);
                 }
                 $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'add', 'input' => $input_data)) : NULL;
             }
             /*End process when submit button is clicked*/
             break;
         case 'edit':
             loadComponentsDropdowns();
             /*Begin process when edit button is clicked*/
             /*get specific record by id*/
             $this->setModel('business_requirement_model');
             $this->setMethod('getBusinessRequirement');
             $this->setIndex('business_requirement_list');
             $this->executeMethod(array('type' => 'get', 'id' => $this->var['id']));
             $this->setModel('requirement_model');
             $this->setMethod('getRequirement');
             $this->setIndex('requirement_list');
             $this->executeMethod(array('type' => 'get', 'active' => TRUE));
             /*End process when edit button is clicked*/
             /*Begin process when submit button is clicked*/
             $this->form_validation->set_rules('data[TransactionType]', 'Transaction', 'trim|required');
             $this->form_validation->set_rules('data[RequirementID]', 'Requirement Name', 'trim|required');
             if ($this->input->post('data')) {
                 /*set input data*/
                 $data = $this->input->post('data');
                 foreach ($data['RequirementID'] as $requirement) {
                     $input_data[] = array('TransactionType' => $data['TransactionType'], 'RequirementID' => $requirement, 'Active' => isset($data['Active']) ? $data['Active'] : 0);
                 }
                 $this->setModel('business_requirement_model');
                 $this->setMethod('updateBusinessRequirement');
                 $this->form_validation->run() == TRUE ? $this->executeMethod(array('type' => 'update', 'id' => $this->var['id'], 'input' => $input_data)) : NULL;
             }
             /*End process when submit button is clicked*/
             break;
         default:
             /*Load Data Table*/
             loadAdvancedDataTables();
             /*get all records*/
             $this->setModel('business_requirement_model');
             $this->setMethod('getBusinessRequirement');
             $this->setIndex('business_requirement_list');
             $this->executeMethod(array('type' => 'get'));
             break;
     }
     $this->viewPage();
 }
示例#6
0
 public function barangay()
 {
     /*Begin getting data needed for input forms in add and edit*/
     /*Get the Province - this is needed for dropdown list*/
     $this->setMethod('getProvince');
     $this->setIndex('province_list');
     $this->executeMethod(array('type' => 'get', 'active' => TRUE));
     /*End getting data needed for input forms in add and edit*/
     /*Begin initial process when submit button is clicked on add and edit*/
     /*Set the input data */
     $input_data = $this->input->post('data') ? $this->input->post('data') : array();
     /*End inital process when submit button is clicked on add and edit */
     switch ($this->var['action']) {
         case 'add':
             loadComponentsDropdowns();
             /*Begin additional process when submit button is clicked*/
             $this->setMethod('addBarangay');
             $this->form_validation->set_rules('data[CityMunicipalityID]', 'City/Municipality', 'trim|required');
             $this->form_validation->set_rules('data[BarangayName]', 'Barangay', 'trim|required');
             $this->form_validation->run() ? $this->executeMethod(array('type' => 'add', 'input' => $input_data)) : NULL;
             /*End additional process when submit button is clicked*/
             break;
         case 'edit':
             loadComponentsDropdowns();
             /*Begin process when edit button is clicked*/
             /*get specific record by id*/
             $this->setMethod('getBarangay');
             $this->setIndex('barangay_list');
             $this->executeMethod(array('type' => 'get', 'id' => $this->var['id']));
             /*get the municipality list based on province id - this is needed for dropdown list on edit*/
             $province_id = $this->var['barangay_list'][0]['ProvinceID'];
             $this->setMethod('getCityMunicipality');
             $this->setIndex('citymunicipality_list');
             $this->executeMethod(array('type' => 'get', 'parent_id' => $province_id, 'active' => 1));
             /*End process when edit button is clicked*/
             /*Begin additional process when submit button is clicked*/
             $this->setMethod('updateBarangay');
             $this->form_validation->set_rules('data[CityMunicipalityID]', 'City/Municipality', 'trim|required');
             $this->form_validation->set_rules('data[BarangayName]', 'Barangay', 'trim|required');
             $this->form_validation->run() ? $this->executeMethod(array('type' => 'update', 'id' => $this->var['id'], 'input' => $input_data)) : NULL;
             /*End additional process when submit button is clicked*/
             break;
         default:
             /*Load Data Table*/
             loadAdvancedDataTables();
             /*get all records*/
             $this->setMethod('getBarangay');
             $this->setIndex('barangay_list');
             $this->executeMethod(array('type' => 'get'));
             break;
     }
     $this->viewPage();
 }
 public function tfo_template_test()
 {
     loadComponentsDropdowns();
     $this->viewPage();
 }