From 6e06a7464f39b8f7728e4a366f6108e05d042a4b Mon Sep 17 00:00:00 2001 From: PunnooBSCS <71382877+PunnooBSCS@users.noreply.github.com> Date: Tue, 19 Jan 2021 18:40:07 +0500 Subject: [PATCH 1/6] Update customreports.php Line is greater than 80 characters --- application/controllers/customreports.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/application/controllers/customreports.php b/application/controllers/customreports.php index 1e621ba..ff6c9d8 100644 --- a/application/controllers/customreports.php +++ b/application/controllers/customreports.php @@ -1387,7 +1387,9 @@ public function exportschoolreport($slug) { $data['category_list'] = $new_category_list; $final_district_wise_array2 = array(); foreach ($new_category_list as $cat_listv) { - $district_wise_catorized = $this->form_results_model->get_school_categorized_count_new($form_id, $_REQUEST['district'], $filter_attribute[0], $cat_listv, $from_date, $to_date); + $district_wise_catorized = $this->form_results_model-> + get_school_categorized_count_new($form_id, $_REQUEST['district'], + $filter_attribute[0], $cat_listv, $from_date, $to_date); foreach ($district_wise_catorized as $key => $val) { if (!array_key_exists($val['EMIS_Code'], $final_district_wise_array2)) { From 1ace3aacbd3cbaf087682a5deaa52ba8e58209fb Mon Sep 17 00:00:00 2001 From: PunnooBSCS <71382877+PunnooBSCS@users.noreply.github.com> Date: Tue, 19 Jan 2021 22:17:04 +0500 Subject: [PATCH 2/6] Update customreports.php Lines is greater than 80 characters --- application/controllers/customreports.php | 26 ++++++++++++++++------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/application/controllers/customreports.php b/application/controllers/customreports.php index ff6c9d8..0143049 100644 --- a/application/controllers/customreports.php +++ b/application/controllers/customreports.php @@ -1303,16 +1303,23 @@ public function get_category_list($slug) { $filter_data = array(); if (in_array($filter_attribute_value, $table_headers_array)) { -// if ($selected_form['app_id'] == 1293 || $selected_form['app_id'] == 1567) { +// if ($selected_form['app_id'] == +// 1293 || $selected_form['app_id'] == 1567) { // foreach ($record_array_final as $key => $form_item) { // -// if (!empty($form_item[$filter_attribute_value])) { -// if (!in_array($form_item[$filter_attribute_value], $filter_data)) { -// $key = trim($form_item[$filter_attribute_value]); +// if (!empty( +// $form_item[$filter_attribute_value])) { +// if (!in_array($form_item[ +// $filter_attribute_value], +// $filter_data)) { +// $key = trim( +// $form_item[$filter_attribute_value]); // $key = explode(',', $key); -// $value = ($form_item[$filter_attribute_value]); +// $value = +// ($form_item[$filter_attribute_value]); // $value = explode(',', $value); -// $filter_data = array_merge($filter_data, array($key[0] => $value[0])); +// $filter_data = array_merge($filter_data, +// array($key[0] => $value[0])); // } // } // } @@ -1346,7 +1353,9 @@ public function exportschoolreport($slug) { $selected_form = $this->form_model->get_form($slug); //print_r($selected_form); $form_single_to_query = array(); - $form_single_to_query[] = array('form_id' => $form_id, 'table_name' => 'zform_' . $form_id, 'form_name' => $selected_form['name']); + $form_single_to_query[] = array('form_id' => + $form_id, 'table_name' => 'zform_' . $form_id, + 'form_name' => $selected_form['name']); /** Get filters from multiple forms * */ $multiple_filters = $this->form_model->get_form_filters($form_single_to_query); @@ -1372,7 +1381,8 @@ public function exportschoolreport($slug) { $filter_result = get_graph_view_settings($selected_form['app_id']); - if (isset($filter_result->district_wise_report) && $filter_result->district_wise_report == 1) { + if (isset($filter_result->district_wise_report) && + $filter_result->district_wise_report == 1) { $new_category_list = array(); foreach ($category_list as $cl_key => $cl_value) { From cc18b0c58d79f6dfece18a0ac42e15cfa00c1532 Mon Sep 17 00:00:00 2001 From: PunnooBSCS <71382877+PunnooBSCS@users.noreply.github.com> Date: Wed, 20 Jan 2021 15:11:36 +0500 Subject: [PATCH 3/6] Update customreports.php Line is greater than 80 characters --- application/controllers/customreports.php | 28 +++++++++++++++-------- 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/application/controllers/customreports.php b/application/controllers/customreports.php index 0143049..6ea347b 100644 --- a/application/controllers/customreports.php +++ b/application/controllers/customreports.php @@ -1228,7 +1228,8 @@ public function single_category_graph($slug) { } /** - * function to get heading and form data of form results table return data array having two values forms and headings + * function to get heading and form data of form + * results table return data array having two values forms and headings * @param $slug form id * @return void * @author UbaidUllah Balti @@ -1241,7 +1242,8 @@ public function get_category_list($slug) { $filter_attribute = array(); if ($selected_form['filter'] != '') { - $filter_rec = array_filter(array_map('trim', explode(',', $selected_form['filter']))); + $filter_rec = array_filter(array_map( + 'trim', explode(',', $selected_form['filter']))); foreach ($filter_rec as $key => $value) { array_push($filter_attribute, $value); } @@ -1260,33 +1262,41 @@ public function get_category_list($slug) { $table_headers_array = array(); $record_array_final = array(); - $results = $this->form_results_model->return_total_record_for_graph($form_id, $filter_attribute[0]); + $results = $this->form_results_model-> + return_total_record_for_graph($form_id, $filter_attribute[0]); // echo "
";
 //        print_r($results);die;
 //        foreach ($results as $k => $v) {
 //            $record_array = array();
 //            foreach ($v as $key => $value) {
 ////                    if (!in_array($key, $exclude_array)) {
-//                $record_array = array_merge($record_array, array($key => $value));
+//                $record_array = array_merge(
+//                  $record_array, array($key => $value));
 ////                    }
 //            }
 //
 //
-////                $imagess = $this->form_results_model->getResultsImages($v['id'],$form_id);
+////                $imagess = $this->form_results_model->
+//                          getResultsImages($v['id'],$form_id);
 ////                if ($imagess) {
 ////                    if (!in_array('image', $table_headers_array)) {
-////                        $table_headers_array = array_merge($table_headers_array, array('image'));
+////                        $table_headers_array = 
+//                              array_merge($table_headers_array, array('image'));
 ////                    }
-////                    $record_array = array_merge($record_array, array('image' => $imagess));
+////                    $record_array = array_merge(
+//                          $record_array, array('image' => $imagess));
 ////                }
 //
-////            $record_array = array_merge($record_array, array('created_datetime' => $v['created_datetime'], 'actions' => $v['id']));
+////            $record_array = array_merge($record_array, 
+//                      array('created_datetime' => $v['created_datetime'],
+//                           'actions' => $v['id']));
 //            $record_array_final[] = $record_array;
 //        }
         $record_array_final = $results;
 
 
-        $heading_query = $this->form_results_model->getTableHeadingsFromSchema('zform_' . $form_id);
+        $heading_query = $this->form_results_model->
+            getTableHeadingsFromSchema('zform_' . $form_id);
         foreach ($heading_query as $key => $value) {
             $header_value = $value['COLUMN_NAME'];
             if (!in_array($header_value, $table_headers_array)) {

From de52789da6cf60af7d49825212a10b3f663ea3e3 Mon Sep 17 00:00:00 2001
From: PunnooBSCS <71382877+PunnooBSCS@users.noreply.github.com>
Date: Thu, 21 Jan 2021 21:20:06 +0500
Subject: [PATCH 4/6] Update customreports.php

Line is greater than 80 characters
---
 application/controllers/customreports.php | 30 ++++++++++++++++-------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/application/controllers/customreports.php b/application/controllers/customreports.php
index 6ea347b..77a473a 100644
--- a/application/controllers/customreports.php
+++ b/application/controllers/customreports.php
@@ -1095,7 +1095,8 @@ public function single_user_graph($slug) {
          */
         $heading_array = array();
         $record_array_final = array();
-        $user_wise_result = $this->form_results_model->getResultUserImeiBased($slug, $imei_number);
+        $user_wise_result = $this->form_results_model->
+            getResultUserImeiBased($slug, $imei_number);
         foreach ($user_wise_result as $k => $v) {
             $record_array = array();
             $result_json = $v['record'];
@@ -1114,11 +1115,14 @@ public function single_user_graph($slug) {
                 $record_array = array_merge($record_array, array($key => $value));
             }
             $record_array = array_merge($record_array, array('uc_name' => $v['uc_name']));
-            $record_array = array_merge($record_array, array('created_datetime' => $v['created_datetime'], 'actions' => $v['id']));
+            $record_array = array_merge($record_array, 
+                array('created_datetime' => $v['created_datetime'], 
+                    'actions' => $v['id']));
 
             $record_array_final[] = $record_array;
         }
-        $heading_array = array_merge($heading_array, array('created_datetime', 'actions'));
+        $heading_array = array_merge($heading_array,
+             array('created_datetime', 'actions'));
         $data['headings'] = $heading_array;
         $data['form'] = $record_array_final;
 
@@ -1131,7 +1135,8 @@ public function single_user_graph($slug) {
         foreach ($record_array_final as $record) {
             $uc_name = $record['uc_name'];
             if (!empty($uc_name) & !in_array($uc_name, $uc_counted)) {
-                $users_count = $this->form_results_model->getCountUserUcBased($slug, $imei_number, $uc_name);
+                $users_count = $this->form_results_model->
+                    getCountUserUcBased($slug, $imei_number, $uc_name);
                 if ($users_count > 0) {
                     $users_uc_set = array_merge($users_uc_set, array($uc_name => $users_count));
                 }
@@ -1170,7 +1175,8 @@ public function single_category_graph($slug) {
          */
         $heading_array = array();
         $record_array_final = array();
-        $user_wise_result = $this->form_results_model->getResultSingleCatgory($slug, $category_name, $filter_attribute);
+        $user_wise_result = $this->form_results_model->
+            getResultSingleCatgory($slug, $category_name, $filter_attribute);
         foreach ($user_wise_result as $k => $v) {
             $record_array = array();
             $result_json = $v['record'];
@@ -1191,11 +1197,14 @@ public function single_category_graph($slug) {
                 $record_array = array_merge($record_array, array($key => $value));
             }
             $record_array = array_merge($record_array, array('uc_name' => $v['uc_name']));
-            $record_array = array_merge($record_array, array('created_datetime' => $v['created_datetime'], 'actions' => $v['id']));
+            $record_array = array_merge($record_array, 
+                array('created_datetime' => $v['created_datetime'],
+                     'actions' => $v['id']));
 
             $record_array_final[] = $record_array;
         }
-        $heading_array = array_merge($heading_array, array('created_datetime', 'actions'));
+        $heading_array = array_merge($heading_array,
+             array('created_datetime', 'actions'));
         $data['headings'] = $heading_array;
         $data['form'] = $record_array_final;
 
@@ -1209,9 +1218,12 @@ public function single_category_graph($slug) {
         foreach ($record_array_final as $record) {
             $uc_name = $record['uc_name'];
             if (!empty($uc_name) & !in_array($uc_name, $uc_counted)) {
-                $category_count = $this->form_results_model->getCountCategoryUcBased($slug, $category_name, $filter_attribute, $uc_name);
+                $category_count = $this->form_results_model->
+                    getCountCategoryUcBased(
+                        $slug, $category_name, $filter_attribute, $uc_name);
                 if ($category_count > 0) {
-                    $category_uc_set = array_merge($category_uc_set, array($uc_name => $category_count));
+                    $category_uc_set = array_merge($category_uc_set,
+                         array($uc_name => $category_count));
                 }
                 $totalRecords += $category_count;
                 $uc_counted [] = $uc_name;

From a308ad56af2ccd871746ceacf1f05a94b4b427b4 Mon Sep 17 00:00:00 2001
From: PunnooBSCS <71382877+PunnooBSCS@users.noreply.github.com>
Date: Fri, 22 Jan 2021 22:02:21 +0500
Subject: [PATCH 5/6] Update customreports.php

Line is greater than 80 characters
---
 application/controllers/customreports.php | 30 ++++++++++++++++-------
 1 file changed, 21 insertions(+), 9 deletions(-)

diff --git a/application/controllers/customreports.php b/application/controllers/customreports.php
index 77a473a..138eae8 100644
--- a/application/controllers/customreports.php
+++ b/application/controllers/customreports.php
@@ -966,8 +966,11 @@ public function graphframe($slug) {
             foreach ($category_list as $category) {
                 $categorieslist = explode(',', $category);
                 foreach ($categorieslist as $catu) {
-                    $category_count = $this->form_results_model->getCountCatgoryBase($form_id, $catu, $filter_attribute, $from_date, $to_date, $selected_district = '');
-                    $category_list_count = array_merge($category_list_count, array($catu => $category_count));
+                    $category_count = $this->form_results_model->
+                        getCountCatgoryBase($form_id, $catu, $filter_attribute,
+                             $from_date, $to_date, $selected_district = '');
+                    $category_list_count = array_merge($category_list_count,
+                         array($catu => $category_count));
                     $totalRecords += $category_count;
                 }
             }
@@ -986,7 +989,8 @@ public function graphframe($slug) {
             $data['category_list'] = $category_list;
             $data['total_records'] = $total_record;
             $data['category_list_count'] = $category_list_count;
-            $data['graph_text'] = 'Graph By Category  ' . str_replace('_', ' ', $filter_attribute[0]) . '';
+            $data['graph_text'] = 'Graph By Category  ' . 
+                str_replace('_', ' ', $filter_attribute[0]) . '';
             $data['pageTitle'] = " Graph-View";
             $data['graph_type'] = 'Category';
             $data['app_id'] = $selected_form['app_id'];
@@ -1023,17 +1027,23 @@ public function graph_type($slug) {
         $data['app_name'] = $selected_app['name'];
 
         if ($graph_type == 'user') {
-            $users_lists = $this->app_users_model->get_app_users_app_based($selected_form['app_id'], $login_district);
+            $users_lists = $this->app_users_model->
+                get_app_users_app_based($selected_form['app_id'], 
+                    $login_district);
             $users_lists_array = array();
             foreach ($users_lists as $users_name) {
 
-                $users_lists_array[] = array('imei_no' => $users_name['imei_no'], 'user_name' => $users_name['user_name']);
+                $users_lists_array[] = array('imei_no' => 
+                    $users_name['imei_no'], 'user_name' => 
+                        $users_name['user_name']);
             }
             $users_wise_counter = array();
             $totalRecords = 0;
             foreach ($users_lists_array as $users) {
-                $users_count = $this->form_results_model->getCountUserBased($slug, $users['imei_no']);
-                $users_wise_counter = array_merge($users_wise_counter, array($users['user_name'] => $users_count));
+                $users_count = $this->form_results_model->
+                    getCountUserBased($slug, $users['imei_no']);
+                $users_wise_counter = array_merge($users_wise_counter, 
+                    array($users['user_name'] => $users_count));
                 $totalRecords += $users_count;
             }
             $users_wise_counter[] = arsort($users_wise_counter);
@@ -1053,8 +1063,10 @@ public function graph_type($slug) {
             $totalRecords = 0;
             $category_list_count = array();
             foreach ($category_list as $category) {
-                $category_count = $this->form_results_model->getCountCatgoryBased($slug, $category, $filter_attribute);
-                $category_list_count = array_merge($category_list_count, array($category => $category_count));
+                $category_count = $this->form_results_model->
+                    getCountCatgoryBased($slug, $category, $filter_attribute);
+                $category_list_count = array_merge($category_list_count, 
+                    array($category => $category_count));
                 $totalRecords += $category_count;
             }
             $category_list_count[] = arsort($category_list_count);

From 67f769ab7e65e124d4ca045c8014088eec11535a Mon Sep 17 00:00:00 2001
From: PunnooBSCS <71382877+PunnooBSCS@users.noreply.github.com>
Date: Sat, 23 Jan 2021 22:33:37 +0500
Subject: [PATCH 6/6] Update customreports.php

Line is greater than 80 characters
---
 application/controllers/customreports.php | 37 +++++++++++++++++------
 1 file changed, 28 insertions(+), 9 deletions(-)

diff --git a/application/controllers/customreports.php b/application/controllers/customreports.php
index 138eae8..f8337ac 100644
--- a/application/controllers/customreports.php
+++ b/application/controllers/customreports.php
@@ -920,16 +920,26 @@ public function graphframe($slug) {
                 }
 
                 if (!key_exists($myrep['Disbursement_Center'], $final_disb_array[$myrep['District']][$myrep['Tehsil']])) {
-                    $final_disb_array[$myrep['District']][$myrep['Tehsil']][$myrep['Disbursement_Center']] = array();
+                    $final_disb_array[$myrep['District']]
+                        [$myrep['Tehsil']][$myrep['Disbursement_Center']] 
+                            = array();
                 }
 
                 $available_fac = explode(',', $myrep['Facilities_Available']);
                 foreach ($available_fac as $avail_value) {
-                    if (!key_exists('facilities', $final_disb_array[$myrep['District']][$myrep['Tehsil']][$myrep['Disbursement_Center']])) {
-                        $final_disb_array[$myrep['District']][$myrep['Tehsil']][$myrep['Disbursement_Center']]['facilities'] = array();
+                    if (!key_exists('facilities', 
+                        $final_disb_array[$myrep['District']][$myrep['Tehsil']]
+                            [$myrep['Disbursement_Center']])) {
+                        $final_disb_array[$myrep['District']]
+                            [$myrep['Tehsil']][$myrep['Disbursement_Center']]
+                                ['facilities'] = array();
                     }
-                    if (!in_array($avail_value, $final_disb_array[$myrep['District']][$myrep['Tehsil']][$myrep['Disbursement_Center']]['facilities'])) {
-                        array_push($final_disb_array[$myrep['District']][$myrep['Tehsil']][$myrep['Disbursement_Center']]['facilities'], $avail_value);
+                    if (!in_array($avail_value, 
+                        $final_disb_array[$myrep['District']][$myrep['Tehsil']]
+                            [$myrep['Disbursement_Center']]['facilities'])) {
+                        array_push($final_disb_array[$myrep['District']]
+                            [$myrep['Tehsil']][$myrep['Disbursement_Center']]
+                                ['facilities'], $avail_value);
                     }
                 }
             }
@@ -950,14 +960,23 @@ public function graphframe($slug) {
                 $counter = 0;
                 foreach ($category_list as $category) {
                     $counter ++;
-                    $district_wise_catorized = $this->form_results_model->get_district_categorized_count($form_id, $district['district_name'], $filter_attribute[0], $category, $from_date, $to_date);
+                    $district_wise_catorized = $this->form_results_model->
+                        get_district_categorized_count($form_id, 
+                            $district['district_name'], $filter_attribute[0], 
+                                $category, $from_date, $to_date);
                     $total += $district_wise_catorized;
-                    $final_district_wise_array = array_merge($final_district_wise_array, array('district' => $district['district_name'], $category => $district_wise_catorized));
+                    $final_district_wise_array = 
+                        array_merge($final_district_wise_array, 
+                            array('district' => $district['district_name'], 
+                                $category => $district_wise_catorized));
                     if ($counter == count($category_list)) {
-                        $final_district_wise_array = array_merge($final_district_wise_array, array('total' => $total));
+                        $final_district_wise_array = 
+                            array_merge($final_district_wise_array, 
+                                array('total' => $total));
                     }
                 }
-                $final_district_wise_array2[$district['district_name']] = $final_district_wise_array;
+                $final_district_wise_array2[$district['district_name']] 
+                    = $final_district_wise_array;
             }
             $data['district_categorized'] = $final_district_wise_array2;