Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group8 - BSCS17063 - Updated Form.php (8-13, 20-30, 51-80 and 90-91) All Issues Resolved #2570

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
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
Ch-Usman-266 committed Jan 19, 2021
commit 1dd27eac7ad4b2f89bf936787fd12804abc6ed5f
52 changes: 39 additions & 13 deletions application/controllers/form.php
Original file line number Diff line number Diff line change
@@ -760,38 +760,60 @@ 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');
session_to_page($session_data, $data);
$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'];

$result_sess_array = array(
'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'];