Exemplo n.º 1
0
 private function check_validation()
 {
     $valid = true;
     $division_id = $this->input->post("division");
     $zilla_id = $this->input->post("zilla");
     $upazilla_id = $this->input->post("upazilla");
     $union_id = $this->input->post("union");
     $city_corporation_id = $this->input->post("citycorporation");
     $city_corporation_word_id = $this->input->post("citycorporationward");
     $municipal_id = $this->input->post("municipal");
     $municipal_word_id = $this->input->post("municipalward");
     if ($this->input->post('uisc_type') == $this->config->item('ONLINE_UNION_GROUP_ID')) {
         if (!$this->Entrepreneur_approval_model->check_upazilla($zilla_id, $upazilla_id)) {
             $valid = false;
             $this->message .= $this->lang->line('VALID_UPAZILLA_REQUIRED') . '<br>';
         }
         if (!$this->Entrepreneur_approval_model->check_union($zilla_id, $upazilla_id, $union_id)) {
             $valid = false;
             $this->message .= $this->lang->line('VALID_UNION_REQUIRED') . '<br>';
         }
     } elseif ($this->input->post('uisc_type') == $this->config->item('ONLINE_CITY_CORPORATION_WORD_GROUP_ID')) {
         if (!$this->Entrepreneur_approval_model->check_city_corporation($zilla_id, $city_corporation_id)) {
             $valid = false;
             $this->message .= $this->lang->line('VALID_CITY_CORPORATION_REQUIRED') . '<br>';
         }
         if (!$this->Entrepreneur_approval_model->check_city_corporation_word($zilla_id, $city_corporation_id, $city_corporation_word_id)) {
             $valid = false;
             $this->message .= $this->lang->line('VALID_CITY_CORPORATION_WORD_REQUIRED') . '<br>';
         }
     } elseif ($this->input->post('uisc_type') == $this->config->item('ONLINE_MUNICIPAL_WORD_GROUP_ID')) {
         if (!$this->Entrepreneur_approval_model->check_municipal($zilla_id, $municipal_id)) {
             $valid = false;
             $this->message .= $this->lang->line('VALID_MUNICIPAL_REQUIRED') . '<br>';
         }
         if (!$this->Entrepreneur_approval_model->check_municipal_word($zilla_id, $municipal_id, $municipal_word_id)) {
             $valid = false;
             $this->message .= $this->lang->line('VALID_MUNICIPAL_WORD_REQUIRED') . '<br>';
         }
     }
     if (!Validation_helper::validate_int($this->input->post('uisc_id'))) {
         $valid = false;
         $this->message .= $this->lang->line('CENTER_ID_REQUIRED') . '<br>';
     }
     if (!Validation_helper::validate_int($this->input->post('approval_status'))) {
         $valid = false;
         $this->message .= $this->lang->line('APPROVAL_STATUS_REQUIRED') . '<br>';
     }
     if (!Validation_helper::validate_int($this->input->post('uisc_type'))) {
         $valid = false;
         $this->message .= $this->lang->line('UISC_TYPE_REQUIRED') . '<br>';
     }
     return $valid;
 }
Exemplo n.º 2
0
 private function check_validation()
 {
     $valid = true;
     $notice_detail = $this->input->post('notice_detail');
     if (!Validation_helper::validate_int($notice_detail['notice_type'])) {
         $valid = false;
         $this->message .= $this->lang->line('SELECT_A_NOTICE_TYPE') . '<br>';
     }
     if (!isset($notice_detail['notice_title']) && strlen($notice_detail['notice_title']) < 1) {
         $valid = false;
         $this->message .= $this->lang->line('NOTICE_TITLE_REQUIRED') . '<br>';
     }
     if ($notice_detail['notice_type'] == 1) {
         $general_user_group = $this->input->post('general_user_group');
         if (sizeof($general_user_group) == 0) {
             $valid = false;
             $this->message .= $this->lang->line('SELECT_A_RECEIVER_GROUP') . '<br>';
         }
     } elseif ($notice_detail['notice_type'] == 2) {
         $specific_user_level = $this->input->post('specific_user_level');
         if (!Validation_helper::validate_int($specific_user_level)) {
             $valid = false;
             $this->message .= $this->lang->line('SELECT_A_SPECIFIC_USER_GROUP') . '<br>';
         }
         if ($specific_user_level == $this->config->item('DIVISION_GROUP_ID') && !Validation_helper::validate_int($this->input->post('division'))) {
             $valid = false;
             $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
         }
         if ($specific_user_level == $this->config->item('DISTRICT_GROUP_ID')) {
             if (!Validation_helper::validate_int($this->input->post('division'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
             }
         }
         if ($specific_user_level == $this->config->item('UPAZILLA_GROUP_ID')) {
             if (!Validation_helper::validate_int($this->input->post('division'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('upazila'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_UPAZILLA') . '<br>';
             }
         }
         if ($specific_user_level == $this->config->item('UNION_GROUP_ID')) {
             if (!Validation_helper::validate_int($this->input->post('division'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('upazila'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_UPAZILLA') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('union'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_UNION') . '<br>';
             }
         }
         if ($specific_user_level == $this->config->item('CITY_CORPORATION_GROUP_ID')) {
             if (!Validation_helper::validate_int($this->input->post('division'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('city_corporation'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_CITY_CORPORATION') . '<br>';
             }
         }
         if ($specific_user_level == $this->config->item('CITY_CORPORATION_WORD_GROUP_ID')) {
             if (!Validation_helper::validate_int($this->input->post('division'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('city_corporation'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_CITY_CORPORATION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('city_corporation_ward'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_CITY_CORPORATION_WARD') . '<br>';
             }
         }
         if ($specific_user_level == $this->config->item('MUNICIPAL_GROUP_ID')) {
             if (!Validation_helper::validate_int($this->input->post('division'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('municipal'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_MUNICIPAL') . '<br>';
             }
         }
         if ($specific_user_level == $this->config->item('MUNICIPAL_WORD_GROUP_ID')) {
             if (!Validation_helper::validate_int($this->input->post('division'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('municipal'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_MUNICIPAL') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('municipal_ward'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_MUNICIPAL_WARD') . '<br>';
             }
         }
         if ($specific_user_level == $this->config->item('UISC_GROUP_ID')) {
             $center_type = $this->input->post('center_type');
             if (!Validation_helper::validate_int($center_type)) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_CENTER_TYPE') . '<br>';
             }
             if (!Validation_helper::validate_int($this->input->post('digital_center'))) {
                 $valid = false;
                 $this->message .= $this->lang->line('SELECT_DIGITAL_CENTER') . '<br>';
             }
             if ($center_type == $this->config->item('ONLINE_UNION_GROUP_ID')) {
                 if (!Validation_helper::validate_int($this->input->post('division'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('upazila'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_UPAZILLA') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('union'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_UNION') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('union'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_UNION') . '<br>';
                 }
             } elseif ($center_type == $this->config->item('ONLINE_CITY_CORPORATION_WORD_GROUP_ID')) {
                 if (!Validation_helper::validate_int($this->input->post('division'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('city_corporation'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_CITY_CORPORATION') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('city_corporation_ward'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_CITY_CORPORATION_WARD') . '<br>';
                 }
             } elseif ($center_type == $this->config->item('ONLINE_MUNICIPAL_WORD_GROUP_ID')) {
                 if (!Validation_helper::validate_int($this->input->post('division'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_DIVISION') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('zilla'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_DISTRICT') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('municipal'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_MUNICIPAL') . '<br>';
                 }
                 if (!Validation_helper::validate_int($this->input->post('municipal_ward'))) {
                     $valid = false;
                     $this->message .= $this->lang->line('SELECT_MUNICIPAL_WARD') . '<br>';
                 }
             }
         }
     }
     return $valid;
 }