From 6cd6e9805855ba608a8a1a4a5b043dee0489a9b5 Mon Sep 17 00:00:00 2001 From: Velz2020 Date: Fri, 15 Nov 2019 20:19:35 +0530 Subject: [PATCH] SMC SAPLED TYPE 7,8 REVOKED --- api/application/config/routes.php | 3 ++- api/application/controllers/PD_Controller.php | 2 +- api/application/controllers/Sales_PD_Controller.php | 7 ++++--- api/application/libraries/SPARQ_Model.php | 4 ++-- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 95ac4609..e7912294 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -256,5 +256,6 @@ $route['(getRawData/:any)'] = 'Data_Dump_Controller/getRawData'; $route['loadSalesPDTemplate'] = 'Sales_PD_Controller/loadSalesPDTemplate'; $route['saveSalesPD'] = 'Sales_PD_Controller/saveSalesPD'; $route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport'; -$route['(listSalesPD/:any/:any)'] = 'Sales_PD_Controller/listSalesPD'; +$route['listSalesPD/(:any)'] = 'Sales_PD_Controller/listSalesPD'; +$route['listSalesPD/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 7c44b47a..b0ed73b4 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -4899,7 +4899,7 @@ public function getPDFormDetailsJSON_post() { $temp_dir_name = isset($form_name[ $image['fk_form_id'] ]) ? $form_name[ $image['fk_form_id'] ] : 'Common'; - $this->zip->add_data('pdimages/'.$temp_dir_name.'/'.$image['pd_document_name'],file_get_contents($image['doc_url'])); + $this->zip->add_data('pdimages/'.$image['pd_document_name'],file_get_contents($image['doc_url'])); } $temp_path = $main_applicant_name.'_'.$pdid.'_'.'pd_images.zip'; diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index a029daf0..f42604ac 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -56,7 +56,7 @@ class Sales_PD_Controller extends REST_Controller { $applicant_id = ''; $officer = ''; - foreach ($records['pd_json'] as $key => $value) + foreach (json_decode($records['pd_json']) as $key => $value) { //print_r($value);die(); if($value['section_id'] == 1) @@ -161,10 +161,11 @@ class Sales_PD_Controller extends REST_Controller { $view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section); } + //print_r($view_data);die(); //$view_name = $sales_pd_data[0]['short_name'].'_'.$sales_pd_data[0]['abbr']; $view_name = $sales_pd_data[0]['short_name']; $html_content = $this->load->view('sale_pd_templates/'.$view_name,$view_data,true); - //echo $html_content;die(); + echo $html_content;die(); $pdf_doc = $this->pdfgenerator->generate($html_content, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf"; @@ -222,7 +223,7 @@ class Sales_PD_Controller extends REST_Controller { $where_condition_array = array('SALES_PD_DATA.createdby' => $user_id); } $order_by = 'SALES_PD_DATA.sales_pd_id'; - $sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array); + $sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC'); if(count($sales_pd_data)) { $data['dataStatus'] = true; diff --git a/api/application/libraries/SPARQ_Model.php b/api/application/libraries/SPARQ_Model.php index d75804dc..a1cc2b90 100644 --- a/api/application/libraries/SPARQ_Model.php +++ b/api/application/libraries/SPARQ_Model.php @@ -93,7 +93,7 @@ class SPARQ_Model extends CI_Model { } - public function getJoinRecords($columns,$table,$joins,$where_condition_array = array(),$order_by = '',$print_query = '') + public function getJoinRecords($columns,$table,$joins,$where_condition_array = array(),$order_by_cloumn = '',$order_by = 'ASC',$print_query = '') { @@ -115,7 +115,7 @@ class SPARQ_Model extends CI_Model { if($order_by != '') { - $this->db->ORDER_BY($order_by); + $this->db->ORDER_BY($order_by_cloumn,$order_by); } $data = $this->db->get()->result_array();