From bf470b465ae18e4e172070bba33ac71cf46b76f0 Mon Sep 17 00:00:00 2001 From: Ch-Usman-266 <72358488+Ch-Usman-266@users.noreply.github.com> Date: Mon, 18 Jan 2021 19:06:55 +0500 Subject: [PATCH 1/7] Update api.php Line 269: More than 80 characters in a line $temp was created to split character in multiple lines to resoved this issue. Line 270: More than 80 characters in a line $temp and $vartemp was created to split character in multiple lines to resoved this issue. Line 271: More than 80 characters in a line $temp and $vartemp was created to split character in multiple lines to resoved this issue. Line 272: More than 80 characters in a line $temp and $vartemp was created to split character in multiple lines to resoved this issue. Line273: More than 80 characters in a line $temp and $vartemp was created to split character in multiple lines to resoved this issue. line 274 : More than 80 characters in a line $temp and $vartemp was created to split character in multiple lines to resoved this issue. --- application/controllers/api.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/application/controllers/api.php b/application/controllers/api.php index f0fbf17..ce48141 100644 --- a/application/controllers/api.php +++ b/application/controllers/api.php @@ -266,12 +266,23 @@ function get_forms($app_id, $imei_no) { $prefrences['BackgroundUpdate']=($app_general_setting->background_update==1)?'YES':'NO'; $prefrences['ForceUpdate']=($app_general_setting->force_update==1)?'YES':'NO'; $prefrences['EnableAutoTime']=($app_general_setting->enable_auto_time==1)?'YES':'NO'; - $prefrences['TrackingStatus']=($app_general_setting->tracking_status==1)?'YES':'NO'; - $prefrences['TrackingInterval']=(isset($app_general_setting->tracking_interval))?$app_general_setting->tracking_interval:'5'; - $prefrences['TrackingDistance']=(isset($app_general_setting->tracking_distance))?$app_general_setting->tracking_distance:'100'; - $prefrences['DebugTracking']=(isset($app_general_setting->debug_tracking) && $app_general_setting->debug_tracking == 1)?'YES':'NO'; - $prefrences['hasGeoFencing']=(isset($app_general_setting->has_geo_fencing) && $app_general_setting->has_geo_fencing == 1)?'YES':'NO'; - $prefrences['DebugGeoFencing']=(isset($app_general_setting->debug_geo_fencing) && $app_general_setting->debug_geo_fencing == 1)?'YES':'NO'; + $temp = ($app_general_setting->tracking_status==1)?'YES':'NO'; + $prefrences['TrackingStatus']= $temp; + $vartemp = $app_general_setting->tracking_interval:'5'; + $temp = (isset($app_general_setting->tracking_interval))?$vartemp; + $prefrences['TrackingInterval']= $temp; + $vartemp = $app_general_setting->tracking_distance:'100'; + $temp = (isset($app_general_setting->tracking_distance))?$vartemp; + $prefrences['TrackingDistance']= $temp + $vartemp = $app_general_setting->debug_tracking == 1; + $temp = (isset($app_general_setting->debug_tracking) && $vartemp)?'YES':'NO'; + $prefrences['DebugTracking']= $temp; + $vartemp =$app_general_setting->has_geo_fencing == 1; + $temp = (isset($app_general_setting->has_geo_fencing) && $vartemp )?'YES':'NO'; + $prefrences['hasGeoFencing']= $temp; + $vartemp = $app_general_setting->debug_geo_fencing == 1; + $temp = (isset($app_general_setting->debug_geo_fencing) && $vartemp )?'YES':'NO'; + $prefrences['DebugGeoFencing']= $temp; //Get geoFence from App user table $prefrences['geoFence']="[{'lng':74.33375,'lat':31.50282},{'lng':72.32271,'lat':31.49976},{'lng':74.3286,'lat':31.48541},{'lng':74.3474,'lat':30.48577},{'lng':74.33764,'lat':34.5049}]"; From 7f13d45d9ac1f81585d0e4094b6fdd32f6cb9035 Mon Sep 17 00:00:00 2001 From: Ch-Usman-266 <72358488+Ch-Usman-266@users.noreply.github.com> Date: Tue, 19 Jan 2021 11:20:04 +0500 Subject: [PATCH 2/7] Update form.php Issue Number: 8 Line Number: 649 Filename: Controller/form.php Resolution: 2 new variables tmp_arg and tmp_arg2 created and white spaces were removed to keep line within the 80-character per line limit Issue Number: 9 Line Number: 656 Filename: Controller/form.php Resolution: temp_var created to split line and keep it within 80-character per line limit Issue Number: 10 Line Number: 660 Filename: Controller/form.php Resolution: temp_choice created to split line and keep it within 80-character per line limit Issue Number: 11 Line Number: 670 Filename: Controller/form.php Resolution: temp_choice created and white spaces deleted to split line and keep it within the 80-character per line limit Issue Number: 12 Line Number: 682 Filename: Controller/form.php Resolution: temp_arg and temp_var to split line and keep it within the 80-character per line limit Issue Number: 13 Line Number: 699 Filename: Controller/form.php Resolution: temp_var, temp_var_2 and temp_var_3 created split line and keep it within the 80-character per line limit --- application/controllers/form.php | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/application/controllers/form.php b/application/controllers/form.php index 076aa25..4c5c41b 100644 --- a/application/controllers/form.php +++ b/application/controllers/form.php @@ -646,18 +646,21 @@ public function results($slug) { // $selected_form = $this->form_model->get_form($form_id); // // $app_id = $selected_form['app_id']; -// $changed_filter_form_id = $this->get_form_filter_based($app_id, $changed_category); +// $tmp_arg = $app_id; +// $tmp_arg_1 = $changed_category; +//$changed_filter_form_id = $this->get_form_filter_based($tmp_arg, $tmp_arg_1); $posted_array_filter = array(); $data_per_filter = array(); $posted_filters = array(); $filter_options = ''; -// $filter_result = get_result_view_settings($selected_form['app_id']); +// $tmp_var = get_result_view_settings($selected_form['app_id']); +// $filter_result = $tmp_var; // if (isset($filter_result->filters->$form_id)) { // $app_filter_list = $filter_result->filters->$form_id; -// -// $filter_options .= ""; +// $temp_choice = ""; +// $filter_options .= $temp_choice; // if (!empty($app_filter_list)) { // // foreach ($app_filter_list as $key => $val) { @@ -667,7 +670,8 @@ public function results($slug) { // } else { // $selected = ''; // } -// $filter_options .= ""; +// $temp_choice =""; +// $filter_options .= $temp_choice; // } // } // } @@ -679,7 +683,9 @@ public function results($slug) { // $final = array(); // if (!empty($datum)) { // foreach ($datum as $inside) { -// $final = array_merge($final, array($inside => $inside)); +// $temp_arg = array($inside => $inside); +// $temp_var = array_merge($final, $temp_arg ); +// $final = $temp_var; // } // } // } @@ -696,7 +702,10 @@ public function results($slug) { $data['search_text'] = $search_text; if ($search_text) { $search_text = mysql_real_escape_string($search_text); - $search_text = str_replace(array('~', '<', '>', '$', '%', '|', '^', '*'), array(' '), $search_text); + $temp_var = array('~', '<', '>', '$', '%', '|', '^', '*'); + $temp_var_2 =array(' ') ; + $temp_var_3 = str_replace($temp_var, $temp_var_2, $search_text); + $search_text = $temp_var_3; $search_text = str_replace('/', '\\\\/', $search_text); $search_text = trim($search_text); } From ff2054b58cc0bcb5771af76b1f33fe17fece4cad Mon Sep 17 00:00:00 2001 From: Ch-Usman-266 <72358488+Ch-Usman-266@users.noreply.github.com> Date: Tue, 19 Jan 2021 11:25:35 +0500 Subject: [PATCH 3/7] Revert "Update api.php" This reverts commit bf470b465ae18e4e172070bba33ac71cf46b76f0. --- application/controllers/api.php | 23 ++++++----------------- 1 file changed, 6 insertions(+), 17 deletions(-) diff --git a/application/controllers/api.php b/application/controllers/api.php index ce48141..f0fbf17 100644 --- a/application/controllers/api.php +++ b/application/controllers/api.php @@ -266,23 +266,12 @@ function get_forms($app_id, $imei_no) { $prefrences['BackgroundUpdate']=($app_general_setting->background_update==1)?'YES':'NO'; $prefrences['ForceUpdate']=($app_general_setting->force_update==1)?'YES':'NO'; $prefrences['EnableAutoTime']=($app_general_setting->enable_auto_time==1)?'YES':'NO'; - $temp = ($app_general_setting->tracking_status==1)?'YES':'NO'; - $prefrences['TrackingStatus']= $temp; - $vartemp = $app_general_setting->tracking_interval:'5'; - $temp = (isset($app_general_setting->tracking_interval))?$vartemp; - $prefrences['TrackingInterval']= $temp; - $vartemp = $app_general_setting->tracking_distance:'100'; - $temp = (isset($app_general_setting->tracking_distance))?$vartemp; - $prefrences['TrackingDistance']= $temp - $vartemp = $app_general_setting->debug_tracking == 1; - $temp = (isset($app_general_setting->debug_tracking) && $vartemp)?'YES':'NO'; - $prefrences['DebugTracking']= $temp; - $vartemp =$app_general_setting->has_geo_fencing == 1; - $temp = (isset($app_general_setting->has_geo_fencing) && $vartemp )?'YES':'NO'; - $prefrences['hasGeoFencing']= $temp; - $vartemp = $app_general_setting->debug_geo_fencing == 1; - $temp = (isset($app_general_setting->debug_geo_fencing) && $vartemp )?'YES':'NO'; - $prefrences['DebugGeoFencing']= $temp; + $prefrences['TrackingStatus']=($app_general_setting->tracking_status==1)?'YES':'NO'; + $prefrences['TrackingInterval']=(isset($app_general_setting->tracking_interval))?$app_general_setting->tracking_interval:'5'; + $prefrences['TrackingDistance']=(isset($app_general_setting->tracking_distance))?$app_general_setting->tracking_distance:'100'; + $prefrences['DebugTracking']=(isset($app_general_setting->debug_tracking) && $app_general_setting->debug_tracking == 1)?'YES':'NO'; + $prefrences['hasGeoFencing']=(isset($app_general_setting->has_geo_fencing) && $app_general_setting->has_geo_fencing == 1)?'YES':'NO'; + $prefrences['DebugGeoFencing']=(isset($app_general_setting->debug_geo_fencing) && $app_general_setting->debug_geo_fencing == 1)?'YES':'NO'; //Get geoFence from App user table $prefrences['geoFence']="[{'lng':74.33375,'lat':31.50282},{'lng':72.32271,'lat':31.49976},{'lng':74.3286,'lat':31.48541},{'lng':74.3474,'lat':30.48577},{'lng':74.33764,'lat':34.5049}]"; From 1dd27eac7ad4b2f89bf936787fd12804abc6ed5f Mon Sep 17 00:00:00 2001 From: Ch-Usman-266 <72358488+Ch-Usman-266@users.noreply.github.com> Date: Tue, 19 Jan 2021 12:57:30 +0500 Subject: [PATCH 4/7] Update form.php Issue Number: 20 Line Number: 754 Filename: Controller/form.php Resolution: temp_arg and temp_var created to split the line and keep it within the 80-character per line limit Issue Number: 21 Line Number: 759 Filename: Controller/form.php Resolution: temp_arg and temp_var created to split the line and keep it within the 80-character per line limit Issue Number: 22 Line Number:759 Filename: Controller/form.php Resolution: temp_arg and temp_var created to split the line and keep it within the 80-character per line limit Issue Number: 23 Line Number: 774 Filename: Controller/form.php Resolution: Newlines inserted, and same function call is now split into multiple lines. Issue Number: 24 Line Number:782 Filename: Controller/form.php Resolution: temp_arg created to separate function arguments in multiple lines to split the line and keep it within the 80-character per line limit; Issue Number: 25 Line Number:783 Filename: Controller/form.php Resolution: temp_arg and temp_argv2 created to separate function arguments in multiple lines to split the line and keep it within the 80-character per line limit; Issue Number: 26 Line Number:785 Filename: Controller/form.php Resolution: temp_arg, temp_var created and newlines inserted, and same function call is now split into multiple lines. Issue Number: 27 Line Number:802 Filename: Controller/form.php Resolution: temp_var created to split the line and keep it within the 80-character per line limit Issue Number: 28 Line Number:819 Filename: Controller/form.php Resolution: temp_var created and newlines inserted in between function arguments to split the function arguments in multiple lines and keep the line within the 80-character per line limit Issue Number: 29 Line Number:825 Filename: Controller/form.php Resolution: temp_var created split the line into in multiple lines and keep the line within the 80-character per line limit Issue Number: 30 Line Number:829 Filename: Controller/form.php Resolution: temp_var created split the line into in multiple lines and keep the line within the 80-character per line limit --- application/controllers/form.php | 52 ++++++++++++++++++++++++-------- 1 file changed, 39 insertions(+), 13 deletions(-) diff --git a/application/controllers/form.php b/application/controllers/form.php index 4c5c41b..f5fc141 100644 --- a/application/controllers/form.php +++ b/application/controllers/form.php @@ -760,19 +760,24 @@ public function results($slug) { // $town_list_array = array(); // foreach ($town_lists as $towns) { // if (!in_array($towns['town'], $town_list_array)) { -// $town_list_array = array_merge($town_list_array, array($towns['town'] => $towns['town'])); +// $temp_arg = array($towns['town'] => $towns['town']); +// $town_list_array = array_merge($town_list_array, $temp_var ); // } // } // $data['town_filter'] = $town_list_array; /** Get filters from multiple forms * */ -// $multiple_filters = $this->form_model->get_form_filters($form_list_filter); +// $temp_arg = $form_list_filter; +// $temp_var = $this->form_model->get_form_filters($temp_arg); +// $multiple_filters = $temp_var; // $filter_attribute = array(); // $form_html_multiple = array(); // foreach ($multiple_filters as $key => $value) { // array_push($filter_attribute, $value['filter']); // array_push($form_html_multiple, $value['description']); // } -// $filter_attribute_search = (!empty($filter_attribute)) ? $filter_attribute : ""; +// $temp_arg = !empty($filter_attribute); +// $temp_var = ($temp_arg) ? $filter_attribute : ""; +// $filter_attribute_search = $temp_var; // $data['filter_attribute'] = $filter_attribute; // $data['form_html'] = $form_html_multiple; $session_data = $this->session->userdata('logged_in'); @@ -780,7 +785,14 @@ public function results($slug) { $login_district = $session_data['login_district']; /* $changed_category = filter attrubte search */ $array_final = array(); - $array_final = $this->get_heading_n_data_posted($form_list_filter, $to_date, $from_date, $cat_filter_value, $changed_category, $town_filter, $posted_filters, $search_text, $district, $sent_by, $export = '', $selected_dc, $selected_uc, $selected_pp, $selected_na, $dynamic_filters); + $temp_arg = $form_list_filter; + $array_final = $this->get_heading_n_data_posted($temp_arg, + $to_date, $from_date, $cat_filter_value, + $changed_category, $town_filter, + $posted_filters, $search_text, $district, + $sent_by, $export = '', + $selected_dc, $selected_uc, $selected_pp, $selected_na, + $dynamic_filters); $data['headings'] = $array_final['headings']; $data['form'] = $array_final['form']; @@ -788,10 +800,20 @@ public function results($slug) { 'heading' => $array_final['headings'], 'form' => $array_final['form'] ); - $this->db->delete('form_result_temp', array('user_id' => $session_data['login_user_id'])); - $this->db->insert('form_result_temp', array('user_id' => $session_data['login_user_id'], 'query_user' => json_encode($result_sess_array))); - - $total_record_return = $this->form_results_model->return_total_record_posted($form_list_filter, $to_date, $from_date, $cat_filter_value, $filter_attribute_search, $town_filter, $posted_filters, $search_text, $district, $sent_by, $selected_dc, $dynamic_filters); + $temp_arg = array('user_id' => $session_data['login_user_id']); + $this->db->delete('form_result_temp', $temp_arg); + $temp_arg = 'user_id' => $session_data['login_user_id']; + $temp_arg_2 = 'query_user' => json_encode($result_sess_array); + $this->db->insert('form_result_temp', array($temp_arg,$temp_arg_2)); + + $temp_arg = $form_list_filter; + $temp_var = $this->form_results_model->return_total_record_posted($temp_arg, + $to_date, $from_date, $cat_filter_value, + $filter_attribute_search, $town_filter, + $posted_filters, $search_text, + $district, $sent_by, + $selected_dc, $dynamic_filters); + $total_record_return = $temp_var; $pdata['TotalRec'] = $total_record_return; $pdata['perPage'] = $this->perPage; @@ -808,7 +830,8 @@ public function results($slug) { $pdata['district'] = $district; $pdata['ajax_function'] = 'paginated_ajax_data_posted'; $pdata['slug'] = $form_id; - $subdata['paging_category_filter'] = $this->parser->parse('form/paging_category_filter', $pdata, TRUE); + $temp_var = $this->parser->parse('form/paging_category_filter', $pdata, TRUE); + $subdata['paging_category_filter'] = $temp_var; $subdata['all_form_results'] = $data['form']; $subdata['headings'] = $data['headings']; $subdata['saved_columns'] = $array_final['saved_columns']; @@ -825,17 +848,20 @@ public function results($slug) { $category_values = array(); (isset($changed_filter_form_id[0])) ? $changed_filter_form_id[0] : ''; if ($changed_category) { - $category_list = $this->form_results_model->get_category_values('zform_' . $changed_filter_form_id[0], $changed_category); + $temp_arg = 'zform_' . $changed_filter_form_id[0] + $category_list = $this->form_results_model->get_category_values($temp_arg, + $changed_category); foreach ($category_list as $key => $val) { $category_values[$val[$changed_category]] = $val[$changed_category]; } } - - $data['body_content'] = $this->parser->parse('form/form_results_data', $subdata, TRUE); + $temp_var = $this->parser->parse('form/form_results_data', $subdata, TRUE); + $data['body_content'] = $temp_var; $data['selected_form'] = $form_id; $data['category_values'] = $category_values; $data['app_id'] = $selected_form['app_id']; - $data['app_comments'] = $this->form_model->get_comments($selected_form['app_id']); + $temp_var = $this->form_model->get_comments($selected_form['app_id']); + $data['app_comments'] = $temp_var; $data['pageTitle'] = $selected_app['name'] . ' Records - List View-' . PLATFORM_NAME; $selected_app = $this->app_model->get_app($data['app_id']); $data['app_name'] = $selected_app['name']; From 88723c1ee6403c4f23392242039e6f15790dd4a4 Mon Sep 17 00:00:00 2001 From: Ch-Usman-266 <72358488+Ch-Usman-266@users.noreply.github.com> Date: Wed, 20 Jan 2021 14:16:46 +0500 Subject: [PATCH 5/7] (51 - 80 Issue resolved) Updated- Form.php Issue Number 51 Line (995 of original document) (1030 of this document): temp_var created to split the line reformat code according to PITB (80-character per line limit) standards. Issue Number 52 Line (997 of original document) (1032 of this document): temp_arg created to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 53 Line (1043 of original document) (1078 of this document): Newline inserted in between arguments of function to split the line reformat code according to PITB (80-character per line limit) standards. Issue Number 54 Line (1044 of original document) (1079 of this document): temp_var created to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 55 Line (1084 of original document) (1119 of this document): temp_arg created and newline inserted in between arguments of function to split the line and reformat code code according to PITB (80-character per line limit) standards. Issue Number 56 Line (1085 of original document) (1120 of this document): temp_arg created to to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 57 Line (1092 of original document) (1127 of this document): new line inserted in between arguments of if condition split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 58 Line (1104 of original document) (1139 of this document): new line inserted in between arguments of if condition split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 59 Line (1127 of original document) (1162 of this document): new line inserted in between comment to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 60 Line (1137 of original document) (1172 of this document): new line inserted in between arguments of function call to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 61 Line (1145 of original document) (1180 of this document): new line inserted in between arguments of function call to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 62 Line (1152 of original document) (1187 of this document): new line inserted in between arguments of function call to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 63 Line (1158 of original document) (1193 of this document): new line inserted in between arguments of function call to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 64 Line (1201 of original document) (1236 of this document): new line inserted in between arguments of function call to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 65 Line (1204 of original document) (1239 of this document): new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 66 Line (1210 of original document) (1245 of this document): new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 67 Line (1225 of original document) (1260 of this document): temp_var created to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 68 Line (1259 of original document) (1294 of this document): new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 69 Line (1270 of original document) (1305 of this document): new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 70 Line (1272 of original document) (1307 of this document): new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 71 Line (1279 of original document) (1314 of this document): new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 72 Line (1295 of original document) (1330 of this document): temp_arg created and new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 73 Line (1309 of original document) (1344 of this document): new line inserted in between arguments of if condition to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 74 Line (1323 of original document) (1357 of this document): line is exactly 80 characters Issue Number 75 Line (1327 of original document) (1362 of this document): new line inserted in between arguments of function to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 76 Line (1330 of original document) (1365 of this document): new line inserted in between arguments of function to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 77 Line (1345 of original document) (1380 of this document): new line inserted in between arguments of function to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 78 Line (1358 of original document) (1393 of this document): temp_var created and new line inserted in between arguments of function to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 79 Line (1365 of original document) (1400 of this document): new line inserted in between arguments of function to split the line and reformat code according to PITB (80-character per line limit) standards. Issue Number 80 Line (1369 of original document) (1404 of this document): new line inserted in between arguments of function to split the line and reformat code according to PITB (80-character per line limit) standards. --- .gitignore | 2 + application/controllers/form.php | 114 +++++++++++++++++++++++-------- 2 files changed, 86 insertions(+), 30 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c685a01 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ + +application/controllers/backup/formbackup.php diff --git a/application/controllers/form.php b/application/controllers/form.php index f5fc141..27d8bd3 100644 --- a/application/controllers/form.php +++ b/application/controllers/form.php @@ -1027,9 +1027,11 @@ public function results($slug) { $this->load->view('form/results_1293'); } else if ($slug == 1567) { $final_dc = array('' => 'Select All'); - $disbursement_center_lists = $this->form_results_model->get_distinct_d_center(1567); + $temp_var = $this->form_results_model->get_distinct_d_center(1567); + $disbursement_center_lists = $temp_var; foreach ($disbursement_center_lists as $dc) { - $final_dc = array_merge($final_dc, array($dc['Disbursement_Center'] => $dc['Disbursement_Center'])); + $temp_arg = array($dc['Disbursement_Center'] => $dc['Disbursement_Center']); + $final_dc = array_merge($final_dc, $temp_var ); } $data['selected_dc'] = array(); $data['d_center'] = $final_dc; @@ -1052,7 +1054,7 @@ public function results($slug) { */ public function unsaved_activities() { - $session_data = $this->session->userdata('logged_in'); + $session_data = $this->session->erdata('logged_in'); session_to_page($session_data, $data); $us_activities = $this->form_results_model->get_unsaved_activities(); @@ -1075,8 +1077,15 @@ public function unsaved_activities_ajax() { - $us_activities = $this->form_results_model->get_unsaved_activities($_GET['iDisplayStart'],$_GET['iDisplayLength'],$_GET['sSearch'],$_GET['iSortCol_0'],$_GET['sSortDir_0']); - $total_act_un = $this->form_results_model->get_unsaved_activities_total($_GET['sSearch']); + $temp_var = $this->form_results_model; + $us_activities = $temp_var->get_unsaved_activities($_GET['iDisplayStart'], + $_GET['iDisplayLength'], + $_GET['sSearch'], + $_GET['iSortCol_0'], + $_GET['sSortDir_0']); + + $temp_var = $this->form_results_model; + $total_act_un = $temp_var->get_unsaved_activities_total($_GET['sSearch']); // making array for ajax datatable... $data2= array("sEcho" => intval($_GET['sEcho']), "iTotalRecords" => $total_act_un, @@ -1116,15 +1125,22 @@ public function unsaved_activities_ajax() { public function exportcurrentresults() { $session_data = $this->session->userdata('logged_in'); - $activity_aready_exist = $this->db->order_by('id', 'desc')->get_where('form_result_temp', array('user_id' => $session_data['login_user_id']), 1)->row_array(); - $activity_aready_exist = (array) json_decode($activity_aready_exist['query_user']); + $temp_arg = array('user_id' => $session_data['login_user_id']); + $activity_aready_exist = $this->db->order_by('id', + 'desc')->get_where('form_result_temp', + $temp_arg , 1)->row_array(); + $temp_arg = $activity_aready_exist['query_user']; + $activity_aready_exist = (array) json_decode($temp_arg); $headings = $activity_aready_exist['heading']; $forms = $activity_aready_exist['form']; $header = ''; foreach ($headings as $heading) { - if ($heading == 'is_take_picture' || $heading == 'actions' || $heading == 'image') { + $temp_cond = + if ($heading == 'is_take_picture' || + $heading == 'actions' || + $heading == 'image') { continue; } $header .= $heading . ","; @@ -1136,7 +1152,9 @@ public function exportcurrentresults() { $form_item = (array) $form_item; $line = ''; for ($i = 0; $i < $total_headings; $i++) { - if ($headings[$i] == 'is_take_picture' || $headings[$i] == 'actions' || $headings[$i] == 'image') { + if ($headings[$i] == 'is_take_picture' || + $headings[$i] == 'actions' || + $headings[$i] == 'image') { continue; } else { $inside = ucwords($form_item[$headings[$i]]); @@ -1159,7 +1177,8 @@ public function exportcurrentresults() { } /** - * main method to render form results in listview based on specific application Id + * main method to render form results + * in listview based on specific application Id * @param $slug application id * @return void * @author UbaidUllah Balti @@ -1169,7 +1188,9 @@ public function damage($slug) { if ($this->session->userdata('logged_in')) { if (!$this->acl->hasPermission('form', 'view')) { - $this->session->set_flashdata('validate', array('message' => "You don't have enough permissions to do this task.", 'type' => 'warning')); + $this->session->set_flashdata('validate', + array('message' => "You don't have enough permissions to do this task.", + 'type' => 'warning')); redirect(base_url() . '/apps'); } /** multiple form handling system statrs here * */ @@ -1177,20 +1198,25 @@ public function damage($slug) { $all_forms = $this->form_model->get_form_by_app($slug); foreach ($all_forms as $forms) { - $forms_list[] = array('form_id' => $forms['form_id'], 'table_name' => 'zform_' . $forms['form_id'], 'form_name' => $forms['form_name']); + $forms_list[] = array('form_id' => $forms['form_id'], + 'table_name' => 'zform_' . $forms['form_id'], + 'form_name' => $forms['form_name']); } /** multiple form handling system ends here * */ /** in case of post of form filters * */ $form_single_to_query = array(); - $form_single_to_query[] = array('form_id' => $all_forms[0]['form_id'], 'table_name' => 'zform_' . $all_forms[0]['form_id'], 'form_name' => $all_forms[0]['form_name']); + $form_single_to_query[] = array('form_id' => $all_forms[0]['form_id'], + 'table_name' => 'zform_' . $all_forms[0]['form_id'], + 'form_name' => $all_forms[0]['form_name']); $data['selected_district'] = ''; $data['selected_sent_by'] = ''; $data['all_visits_hidden'] = 0; $view_list = array(); foreach ($forms_list as $final_view) { - $view_list = array_merge($view_list, array($final_view['form_name'] => $final_view['form_id'])); + $view_list = array_merge($view_list, + array($final_view['form_name'] => $final_view['form_id'])); } $view_list = array_flip($view_list); $data['form_lists'] = $view_list; @@ -1233,16 +1259,20 @@ public function resultsframe($slug) { $forms_list = array(); $all_forms = $this->form_model->get_form_by_app($slug); foreach ($all_forms as $forms) { - $forms_list[] = array('form_id' => $forms['form_id'], 'table_name' => 'zform_' . $forms['form_id'], 'form_name' => $forms['form_name']); + $forms_list[] = array('form_id' => $forms['form_id'], + 'table_name' => 'zform_' . $forms['form_id'], + 'form_name' => $forms['form_name']); } $app_settings = $this->app_model->get_app_settings($slug); - if (isset($app_settings['district_filter']) && $app_settings['district_filter'] == 'On') { + if (isset($app_settings['district_filter']) && + $app_settings['district_filter'] == 'On') { $district_list = $this->form_results_model->get_distinct_district($slug); $data['district_list'] = $district_list; } - if (isset($app_settings['sent_by_filter']) && $app_settings['sent_by_filter'] == 'On') { + if (isset($app_settings['sent_by_filter']) && + $app_settings['sent_by_filter'] == 'On') { $sent_by_list = $this->form_results_model->get_distinct_sent_by($slug); $data['sent_by_list'] = $sent_by_list; } @@ -1257,7 +1287,8 @@ public function resultsframe($slug) { $selected_dc = $this->input->post('d_center'); $selected_form = $this->form_model->get_form($form_id); $app_id = $selected_form['app_id']; - $changed_filter_form_id = $this->get_form_filter_based($app_id, $changed_category); + $temp_var = $this->get_form_filter_based($app_id, $changed_category); + $changed_filter_form_id = $temp_var; $posted_array_filter = array(); $data_per_filter = array(); $posted_filters = array(); @@ -1291,7 +1322,9 @@ public function resultsframe($slug) { $data['search_text'] = $search_text; if ($search_text) { $search_text = mysql_real_escape_string($search_text); - $search_text = str_replace(array('~', '<', '>', '$', '%', '|', '^', '*'), array(' '), $search_text); + $search_text = str_replace(array('~', '<', '>', '$', '%', '|', '^', '*'), + array(' '), + $search_text); $search_text = str_replace('/', '\\\\/', $search_text); $search_text = trim($search_text); } @@ -1302,16 +1335,19 @@ public function resultsframe($slug) { $final_send = array(); foreach ($forms_list as $final_view) { if (in_array($final_view['form_id'], $form_list_posted)) { - $final_send = array_merge($final_send, array($final_view['form_name'] => $final_view['form_id'])); + $final_send = array_merge($final_send, + array($final_view['form_name'] => $final_view['form_id'])); } - $view_list = array_merge($view_list, array($final_view['form_name'] => $final_view['form_id'])); + $view_list = array_merge($view_list, + array($final_view['form_name'] => $final_view['form_id'])); } $view_list = array_flip($view_list); $data['form_lists'] = $view_list; $data['form_list_selected'] = $final_send; $form_list_filter = array(); foreach ($form_list_posted as $list) { - $form_list_filter[] = array('form_id' => $list, 'table_name' => 'zform_' . $list); + $form_list_filter[] = array('form_id' => $list, + 'table_name' => 'zform_' . $list); } if (empty($to_date)) { $to_date = "2013-06-03"; @@ -1327,7 +1363,9 @@ public function resultsframe($slug) { $sent_by = $this->input->post('sent_by_list'); $data['selected_sent_by'] = $sent_by; if (strtotime($to_date) > strtotime($from_date)) { - $this->session->set_flashdata('validate', array('message' => 'Invalid Date selection. From Date should be greater than To Date.', 'type' => 'warning')); + $temp_arg = 'message' => 'Invalid Date selection. From Date should be greater than To Date.'; + $this->session->set_flashdata('validate', array($temp_arg , + 'type' => 'warning')); redirect(base_url() . 'form/resultsframe/' . $slug_id); } $data['form_id'] = $form_id; @@ -1341,7 +1379,8 @@ public function resultsframe($slug) { $town_list_array = array(); foreach ($town_lists as $towns) { if (!in_array($towns['town'], $town_list_array)) { - $town_list_array = array_merge($town_list_array, array($towns['town'] => $towns['town'])); + $town_list_array = array_merge($town_list_array, + array($towns['town'] => $towns['town'])); } } $data['town_filter'] = $town_list_array; @@ -1359,10 +1398,19 @@ public function resultsframe($slug) { $data['filter_attribute'] = $filter_attribute; $data['form_html'] = $form_html_multiple; $array_final = array(); - $array_final = $this->get_heading_n_data_posted($form_list_filter, $to_date, $from_date, $cat_filter_value, $changed_category, $town_filter, $posted_filters, $search_text, $district, $sent_by, $export = '', $selected_dc); + $array_final = $this->get_heading_n_data_posted($form_list_filter, + $to_date, $from_date, $cat_filter_value, + $changed_category, $town_filter, $posted_filters, + $search_text, $district, $sent_by, + $export = '', $selected_dc); $data['headings'] = $array_final['headings']; $data['form'] = $array_final['form']; - $total_record_return = $this->form_results_model->return_total_record_posted($form_list_filter, $to_date, $from_date, $cat_filter_value, $filter_attribute_search, $town_filter, $posted_filters, $search_text, $district, $sent_by, $selected_dc); + $temp_var = $this->form_results_model; + $total_record_return = $temp_var ->return_total_record_posted($form_list_filter, + $to_date, $from_date, $cat_filter_value, + $filter_attribute_search, $town_filter, + $posted_filters, $search_text, $district, + $sent_by, $selected_dc); $pdata['TotalRec'] = $total_record_return; $pdata['perPage'] = $this->perPage; $pdata['cat_filter_value'] = $cat_filter_value; @@ -1377,7 +1425,9 @@ public function resultsframe($slug) { $pdata['district'] = $district; $pdata['ajax_function'] = 'paginated_ajax_data_posted'; $pdata['slug'] = $form_id; - $subdata['paging_category_filter'] = $this->parser->parse('form/paging_category_filter', $pdata, TRUE); + $temp_var = $this->parser->parse('form/paging_category_filter', + $pdata, TRUE); + $subdata['paging_category_filter'] = $temp_var; $subdata['all_form_results'] = $data['form']; $subdata['headings'] = $data['headings']; $subdata['form'] = $data['form']; @@ -1390,18 +1440,22 @@ public function resultsframe($slug) { $data['app_filters_array'] = array(); $category_values = array(); if ($changed_category) { - $category_list = $this->form_results_model->get_category_values('zform_' . $changed_filter_form_id[0], $changed_category); + $temp_var = $this->form_results_model; + $category_list = $temp_var -> get_category_values('zform_' . $changed_filter_form_id[0], + $changed_category); foreach ($category_list as $category) { if ($slug == '1293') { if ($category[$changed_category]) if (!in_array($category, $category_values)) { $category = trim($category[$changed_category]); $category = explode(',', $category); - $category_values = array_merge($category_values, array($category[0] => $category[0])); + $category_values = array_merge($category_values, + array($category[0] => $category[0])); } } else { if ($category[$changed_category]) - $category_values = array_merge($category_values, array($category[$changed_category] => $category[$changed_category])); + $category_values = array_merge($category_values, + array($category[$changed_category] => $category[$changed_category])); } } } From 3be9e069500e8e5306868078c7f9217cf4224fde Mon Sep 17 00:00:00 2001 From: Ch-Usman-266 <72358488+Ch-Usman-266@users.noreply.github.com> Date: Wed, 20 Jan 2021 14:27:25 +0500 Subject: [PATCH 6/7] (Variable not lower snake case resolved) - Updated - tempapi.php Line #40 variable name changed to lower_snake_case Line#43 variable reference also changed to the correct name --- .gitignore | 2 ++ application/controllers/tempapi.php | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index c685a01..20430f3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ application/controllers/backup/formbackup.php +application/controllers/backup/tempapibackup.php +application/controllers/backup/apimakerbackup.php diff --git a/application/controllers/tempapi.php b/application/controllers/tempapi.php index 21edeca..27d442a 100644 --- a/application/controllers/tempapi.php +++ b/application/controllers/tempapi.php @@ -37,10 +37,10 @@ public function postreset(){ //Re-Post the all record of given application which have not sent public function cardverificationapi(){ $form_id = 10601;//$_REQUEST['api_id'];//10601 - $cardnumber = $_REQUEST['cardnumber']; + $card_number = $_REQUEST['cardnumber']; $this->db->select('*'); $this->db->from('zform_'.$form_id); - $this->db->where('cardnumber', $cardnumber); + $this->db->where('cardnumber', $card_number); $this->db->where('is_deleted', '0'); $query = $this->db->get(); $post_available = $query->result_array(); From bf2ec2f02b6761669d94b063cb9499abd4eb6df5 Mon Sep 17 00:00:00 2001 From: Ch-Usman-266 <72358488+Ch-Usman-266@users.noreply.github.com> Date: Wed, 20 Jan 2021 14:32:32 +0500 Subject: [PATCH 7/7] (Issue 92 Line 85 variable name not lower_snake_case resolved) - Updated - Apimaker.php Line 85# variable existArray named chaged to lower_snake_case --- application/controllers/apimaker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/controllers/apimaker.php b/application/controllers/apimaker.php index c9ed413..efc24e2 100644 --- a/application/controllers/apimaker.php +++ b/application/controllers/apimaker.php @@ -82,7 +82,7 @@ public function createurl($slug) { $file_path = "assets/data/".$api_rec['file_name']; $row = 1; $options = array(); - $existArray = array(); + $exist_array = array(); $data['fields_name']=''; if (($handle = fopen($file_path, "r")) !== FALSE) { while (($datas = fgetcsv($handle, 15000, ",")) !== FALSE) {