From ddfd95ace797622ae9a5003aa164715881708537 Mon Sep 17 00:00:00 2001 From: velz Date: Thu, 23 May 2019 19:43:17 +0530 Subject: [PATCH] PD QC BASIC FUNCTIONALITY --- .gitignore | 1 + api/application/config/constants.php | 3 +- api/application/config/routes.php | 9 +- api/application/controllers/PD_Controller.php | 181 +++++++++++++++++- api/application/controllers/Welcome.php | 11 ++ api/application/docs/sample.pdf | Bin 744998 -> 745042 bytes .../helpers/authorization_helper.php | 5 + api/application/views/business_scorecard.php | 2 +- .../views/report_templates/JSONTOREPORT.php | 44 +++-- api/index.php | 4 +- 10 files changed, 231 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index 8e20071b..9d455059 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ api/application/logs/* api/application/syslogs/* api/application/request_logs/* api/application/pd_reports/* +api/application/views/pd_reports/* api/application/docs/* !api/application/logs/index.html !api/application/logs/.htaccess diff --git a/api/application/config/constants.php b/api/application/config/constants.php index 6f06b0a9..e30796b9 100644 --- a/api/application/config/constants.php +++ b/api/application/config/constants.php @@ -85,8 +85,9 @@ defined('EXIT__AUTO_MIN') OR define('EXIT__AUTO_MIN', 9); // lowest automat defined('EXIT__AUTO_MAX') OR define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code // define login route name for token verification -//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(listAllEntites/:any)'); // no errors +//defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', '(getPDReportHTML/:any)'); // no errors defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN', 'getPDOfficerCurrentLocation'); // no errors +defined('ROUTE_LOGIN_X') OR define('ROUTE_LOGIN_X', '(getPDReportHTML/:any)'); // no errors //defined('ROUTE_LOGIN') OR define('ROUTE_LOGIN','getFullPDDetails'); // no errors /*********************AWS resources Constants*************************************************/ diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 26f0c9d4..adde5e77 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -87,6 +87,9 @@ $route['getCustomerSegment'] = 'Common_Masters_Controller/getCustomerSegment'; + + + //USER MANAGEMENT $route['getListOfUsers'] = 'User_Management_Controller/listAllUsers'; $route['saveNewUser'] = 'User_Management_Controller/saveNewUser'; @@ -197,7 +200,8 @@ $route['getPDAddress'] = 'PD_Controller/getPDAddress'; $route['updatePDAddress'] = 'PD_Controller/updatePDAddress'; $route['getPDCompleteDetails'] = 'PD_Controller/getPDCompleteDetails'; $route['getStateCityNamesAndPincode'] = 'PD_Controller/getStateCityNamesAndPincode'; - +$route['saveHTMLReport'] = 'PD_Controller/saveHTMLReport'; +$route['(getPDReportHTML/:any)'] = 'PD_Controller/getPDReportHTML'; // $route['savePDFormDetailsJSON'] = 'PD_Controller/savePDFormDetailsJSON'; // $route['getPDFormDetailsJSON'] = 'PD_Controller/getPDFormDetailsJSON'; @@ -221,5 +225,8 @@ $route['getDashBoardDetailsOfCity'] = 'Dash_Board_Controller/getDashBoardDetails $route['getDashBoardAlertDetails'] = 'Dash_Board_Controller/getDashBoardDetailsOfAlert'; $route['PD_MIS_report'] = 'Dash_Board_Controller/PD_MIS_report'; + +//$route['(getPDReportHTML/:any)'] = 'Welcome/getPDReportHTML'; + //miscellanous //$route['showBusinessScorecard'] = 'PD_Controller/'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index ae6da878..e423c5a7 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -703,7 +703,7 @@ class PD_Controller extends REST_Controller { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; - for ($i = 0; $i < 8; $i++) + for ($i = 0; $i < 16; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } @@ -3915,7 +3915,9 @@ class PD_Controller extends REST_Controller { /********************************************************************************************* *********************************************************************************************/ - public function generatePDReport_post() + + //Generate Report AS PDF, currenly not in use. + public function generatePDReportPDF_post() { $records = $this->post('records'); $pdid = $records['pd_id']; @@ -3981,8 +3983,7 @@ class PD_Controller extends REST_Controller { $temp = $this->load->view('report_templates/JSONTOREPORT',$data,true); //Save Report as HTML Version with timestamp - $file_name = APPPATH.'pd_reports/'.$pdid.'_'.date('Y-m-d-h-m-s').'.html'; - file_put_contents($file_name,$temp,LOCK_EX); + //PDF Gen using DOM PDF $pdf_doc = $this->pdfgenerator->generate($temp, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); @@ -4058,6 +4059,109 @@ class PD_Controller extends REST_Controller { } } } + + + //Generate Report as HTML File + public function generatePDReport_post() + { + $records = $this->post('records'); + $pdid = $records['pd_id']; + $fk_createdby = $records['fk_createdby']; + $original_template = "RAW"; + $is_regenerate = 0; + if(isset($records['regenerate'])) + { + $is_regenerate = 1; + } + + $data['pd_master_details'] = $this->PD_Model->getPDMasterDetails($pdid); + $data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid); + $data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid); + $data['score_questions_display'] = $this->PD_Model->getScoreableQuestionToDispaly($pdid); + $data['pd_score'] = $this->calculateScore($pdid); + $data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] ); + $data['assessed_income_details'] = $this->getAssessedIncomeForPDReport($pdid); + $score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],1) : 0; + //echo $score_for_chart; + + //GET phantom script from DB + $phantom_script = $this->PD_Model->selectCustomRecords(array('*'),array('script_name' => PHANTOMJSSCRIPT_LOCATION),SCRIPTS); + + $exact_script = $phantom_script[0]['script_content']; + //print_r($exact_script); + $exact_script = str_replace('{{place_score_here}}',$score_for_chart,$exact_script); + //print_r($exact_script);die(); + + + //GENERATE CHART PART + file_put_contents(APPPATH.'/views/js/phantomchart.js',$exact_script,LOCK_EX); + + $str = 'phantomjs '.APPPATH.'/views/js/phantomchart.js'; + exec($str,$ou); + exec('phantom.exit();'); + + //print_r($ou); + + $chart_img_path = APPPATH.'/views/report_templates/chart.png'; + $type = pathinfo($chart_img_path, PATHINFO_EXTENSION); + $chart_img_content = file_get_contents($chart_img_path); + $base64_pdscore_chart_url = 'data:image/' . $type . ';base64,' . base64_encode($chart_img_content); + $data['base64_pdscore_chart_url'] = $base64_pdscore_chart_url; + // echo $data['base64_pdscore_chart_url']; + //die(); + //END OF GENERATE CHART PART + + + + + //GET ALL PROCESSED JSON + for($i = 1;$i<=25;$i++) + { + $fields = array('processed_json'); + $where_condition_array = array('isactive' => 1,'fk_pd_id'=>$pdid,'fk_form_id' => $i); + $data['pd_processed_forms'][$i] = $this->PD_Model->selectCustomRecords($fields,$where_condition_array,PDFORMDETAILSJSON,array(),'','company_id','ASC'); + + $fields2 = array('*'); + $data['pd_images'][$i] = $this->PD_Model->getSignedPDDocsURL($pdid,$i); + } + + + $temp = $this->load->view('report_templates/JSONTOREPORT',$data,true); + //Save Report as HTML Version with timestamp + if (!is_dir(APPPATH.'views/pd_reports/'.$pdid)) { + $dust = mkdir(APPPATH.'views/pd_reports/'.$pdid, 0777, TRUE); + } + $pd_report_time = date('Y-m-d-h-m-s'); + $pd_report_store = APPPATH.'views/pd_reports/'.$pdid.'/'.$pd_report_time.'.html'; + $is_write_done = file_put_contents($pd_report_store,$t); + + if($is_write_done) + { + + $update = $this->PD_Model->updateRecords(array('pd_report_html_filename' => $pd_report_time),PDTRIGGER,array('pd_id' => $pdid)); + + $where_condition_array = array("pd_id" => $pdid); + $temp_array = array('is_original_report_created'=>1,'pd_report_html_filename' => $pd_report_time,'pd_report_generated_date' => date('Y-m-d h:m:s')); + + $id = $this->PD_Model->updateRecords($temp_array,PDTRIGGER,$where_condition_array); + + $response_data['dataStatus'] = true; + $response_data['status'] = REST_Controller::HTTP_OK; + $response_data['msg'] = 'Report Generated Sucessfully..!'; + $this->response($response_data,REST_Controller::HTTP_OK); + + } + else + { + $response_data['dataStatus'] = true; + $response_data['status'] = REST_Controller::HTTP_NOT_MODIFIED; + $response_data['msg'] = 'Something went wrong..!'; + $this->response($response_data,REST_Controller::HTTP_OK); + + } + + } + @@ -4863,9 +4967,12 @@ class PD_Controller extends REST_Controller { public function codeigniterViewTest_post() { + + //echo MYUTIL::customIndianNumberFormat(145263.45896);die(); $records = $this->post('records'); $pdid = $records['pd_id']; + $is_regenerate = 0; if(isset($records['regenerate'])) { @@ -4939,9 +5046,26 @@ class PD_Controller extends REST_Controller { //die(); //echo "*******************************************"; $t = $this->load->view('report_templates/JSONTOREPORT',$data,true); - $file_name = APPPATH.'pd_reports/'.$pdid.'_'.date('Y-m-d-h-m-s').'.html'; - //file_put_contents($file_name,$t,LOCK_EX); - //echo $t; die(); + + //echo $t; + + if (!is_dir(APPPATH.'views/pd_reports/'.$pdid)) { + $dust = mkdir(APPPATH.'views/pd_reports/'.$pdid, 0777, TRUE); + } + $pd_report_time = date('Y-m-d-h-m-s'); + $pd_report_store = APPPATH.'views/pd_reports/'.$pdid.'/'.$pd_report_time.'.html'; + file_put_contents($pd_report_store,$t); + + $update = $this->PD_Model->updateRecords(array('pd_report_html_filename' => $pd_report_time),PDTRIGGER,array('pd_id' => $pdid)); + + if(count($update)) + { + $dat['dataStatus'] = true; + $dat['status'] = REST_Controller::HTTP_OK; + $dat['msg'] = 'Report Generated Sucessfully..!'; + $this->response($dat,REST_Controller::HTTP_OK); + } + //PDF Gen using DOM PDF $pdf_doc = $this->pdfgenerator->generate($t, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); //End of PDF Gen using DOM PDF @@ -6483,5 +6607,48 @@ class PD_Controller extends REST_Controller { } + public function saveHTMLReport_post() + { + + $records = $this->post('records'); + $pdid = $records['pdid']; + $content = $records['content']; + $pd_report_time = date('Y-m-d-h-m-s'); + $pd_report_store = APPPATH.'views/pd_reports/'.$pdid.'/'.$pd_report_time.'.html'; + file_put_contents($pd_report_store,$content); + + $update = $this->PD_Model->updateRecords(array('pd_report_html_filename' => $pd_report_time),PDTRIGGER,array('pd_id' => $pdid)); + + if(count($update)) + { + $dat['dataStatus'] = true; + $dat['status'] = REST_Controller::HTTP_OK; + $dat['msg'] = 'Report Generated Sucessfully..!'; + $this->response($dat,REST_Controller::HTTP_OK); + } + } + + public function getPDReportHTML_get() + { + $pdid = $this->uri->segment(2); + if(($pdid != null || $pdid != "") && (strlen($pdid) == 16) &&(is_string($pdid))) + { + $pd_data = $this->PD_Model->selectCustomRecords(array('pd_id','pd_report_html_filename'),array('random_string' => $pdid),PDTRIGGER); + if(count($pd_data)) + { + $view_name = 'pd_reports/'.$pd_data[0]['pd_id'].'/'.$pd_data[0]['pd_report_html_filename'].'.html'; + $this->load->view($view_name); + } + else + { + echo "

Not Found

"; + } + } + else + { + echo "

Not Found

"; + } + } + } \ No newline at end of file diff --git a/api/application/controllers/Welcome.php b/api/application/controllers/Welcome.php index df8b7c0c..6190225c 100644 --- a/api/application/controllers/Welcome.php +++ b/api/application/controllers/Welcome.php @@ -28,4 +28,15 @@ class Welcome extends CI_Controller { //echo $PD_Controller->index(); } + + public function getPDReportHTML() + { + //$code = $_GET['']; + //echo $code; + //print_r($this->uri->segment(2)); + + + $this->load->view('pd_reports/602/2019-05-23-04-05-52.html'); + } + } diff --git a/api/application/docs/sample.pdf b/api/application/docs/sample.pdf index 4127dca040e6d6a3075df6cf98174f79a382bf9d..f7614112c056e0e45aede147ce2e72f089a3c8b6 100644 GIT binary patch delta 6837 zcmaJ_1yoeq_ZB1vMQR8M2@wSc=1$!iP?Qjr5|r+ar-+mys27HQ2!eD70*XipsFWa$ z(xr4NrQ{P76nOlvFMd8RuK%oc*3A0WK0Chi?S1Z@%nD3*1*X7-jvkK#u=uE}bVC39 zN}wyCC19h}=#TL@4P5rMyL;a7j@0L}nH2eQ%o-h!qLy1!3cU&BRB*QRESI>jm`BmU zw6Z+LH8oAY&5ihP*RLC^C;D+V#Gq|V8=q&tQf-di9N?3)s@LrI4;v7u64;=cieA;Z z2X@(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+Z!*iHKk&WF++YW=-HpZ?Xi&b_smGdO$Vxq_a+#1R8i^#od0jK;}b_{KcDl$oJKBl?X!O4>`<OejbL_MQ&KBsp2&B1v#{8x`zm)@HHZ7ovT=@9fOZ`DK&kM-@Zv-o z%eU3#_OG^zlXcUFDDq~80)4#Flln8F`5uP6`crPS z^e=b#)@&Z8qicEwn}RtOLVR{Q@~&{lY>J}g>8xVp#n5sz)mqW2ft=;By2oa+{hj?3 zPw(=b$&vy3ADsB#ULV#>G|tb}Y&;LLc<_s*p%`vIm_gCPn1d6Zc^%=cmM*hhy(Ee5s!3&$71nFB4hx<;s3jr26Ki%GVZ@10AK+u z4*p5@mmoitfiV#JJL-Rf21z(FaxX~212{y0KQPi(3=7hJ1CkL;;LSJ!;n!eb439;y z`+*UEVF&z>4tGEyHhX-kQLWHK2-Y6fF}>j-D~Cr1JRz!Lq+2Lf>*8Q~ZL z2?X*MJBWbn3kZZD0-`S_q-n!27_ccj94bnILx`+G1i0XlPT=@R zTlT_ju>~VzX;?(IAP4}EjRs>_5+eH$ghw*nRkc?0$b8VgtLrPhDZR&NM(p5!mmVN{UH(-A|VJV>A+d6A;1VN6_GJh-?{1upQyw0Z04iVkH7t2#+W(B7h?xs~W~& z(_e!o0uUaL$omfrIrZRX0*Q#)q7kvc7A7#ZW!e+5@PnveA{NB`)5rf#Q6iRr{pa@n zFNPx_#yk-&U-+{9G5`KIf{8dR^sh8Om4UO49Kl2!4z5>(3OE9UtPdjW7TKOK@Sh8v z_V;@Y3=)yUf(Tzj$RZ@-38bxd5D7xaO2k937es(~xZe>4OhkcL_#Gjp+!CW|Ma7Zr zK`hxGvc-}h@+rJM!5*N(L&ug3ox*{(YAU4v&%zS@*Wbjp9$vm4R0lK>gmuE9Wn{FC HbkP3?U{(^j diff --git a/api/application/helpers/authorization_helper.php b/api/application/helpers/authorization_helper.php index 5e4481de..51cf57e8 100644 --- a/api/application/helpers/authorization_helper.php +++ b/api/application/helpers/authorization_helper.php @@ -63,6 +63,11 @@ class AUTHORIZATION //print_r($CI->uri->uri_string); //die(); + + if( $routingName == ROUTE_LOGIN_X) + { + return true; + } if (!array_key_exists("Authorization",$headersData) OR $headersData['Authorization']!=$CI->config->item('authorization_key')) { set_status_header(REST_CONTROLLER::HTTP_UNAUTHORIZED,"Unauthorized"); diff --git a/api/application/views/business_scorecard.php b/api/application/views/business_scorecard.php index 8fe66348..043dfde7 100644 --- a/api/application/views/business_scorecard.php +++ b/api/application/views/business_scorecard.php @@ -1,3 +1,3 @@ "Business Banking Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Shared >>", "minimum_client_info" => "Client Information Shared >>","stock_raw_material_enough" => "Raw Materials Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>");$descriptions = '';$score = '';if(isset($business) && count($business)){foreach($business as $key => $d){$descriptions .= '"'.$business_captions [$key].'",'; $score .= $d['attributed_score'] != 0 && $d['max_score'] != 0 ? (($d['attributed_score']/$d['max_score']) * 100).',' : '0'.',';}} +$business_captions = array("no_of_years_business_run" => "Business Vintage >>", "location_suited_for_busienss" => "Business Location suitability >>", "business_seasonality" => "Seasonality >>", "employees_total" => "Employee Strength >>", "cerificates" => "Business Certifications Sighted >>","owned_property" => "Business Premise Ownership >>", "owned_vechile" => "Vehicle Ownership >>", "business_activity_has_seen" => "Business Activity Observed >>", "minimum_supplier_info" => "Supplier Information Shared >>", "minimum_client_info" => "Client Information Shared >>","stock_raw_material_enough" => "Raw Materials Stock Sufficiency >>", "stock_finished_goods_enough" => "Finished/Traded Stock Sufficiency >>", "vintage_of_business_account" => "Main Business Banking Account Vintage >>");$descriptions = '';$score = '';if(isset($business) && count($business)){foreach($business as $key => $d){$descriptions .= '"'.$business_captions [$key].'",'; $score .= $d['attributed_score'] != 0 && $d['max_score'] != 0 ? (($d['attributed_score']/$d['max_score']) * 100).',' : '0'.',';}} ?> \ No newline at end of file diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 70e7f19d..2e5503ef 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -2,7 +2,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ?> - + @@ -270,7 +270,17 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - + @@ -637,7 +647,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

PD Location Address : '.$pd_address['address'].' ,'.$pd_address['city_master'].' ,'.$pd_address['state_master'].' - '.$pincode; + echo 'PD Location Address : '.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode; echo '

GPS Coordinates of location where PD Visit was done : '.$pd_master_details[0]['start_location']; echo '

'; ?> @@ -663,20 +673,20 @@ defined('BASEPATH') OR exit('No direct script access allowed'); if($business_assets_details['business_assets_for_address'][0]['business_month'] != ""){ $yrs_being_run.= ' and '.$business_assets_details['business_assets_for_address'][0]['business_month'].' Months';} echo '

'; - echo "The PD visit was done at ". $address_type. " of the loan applicants. "; - echo "The ".$address_type." is ".$property_owner_type." and the business has been in operation from here for the last $yrs_being_run."; - echo "

The ".$address_type." is located in ".$locality." and the estimated area of the office is ".$estimated_area." ."; - echo "

The PD location was ". $pd_address['pd_location_master'].". " . "As Per PD Offcier, the ".$address_type ." is situated in ".$comment_locality_master ." Locality."; - echo "

The PD officer also made the following observations:" ; - echo "

    "; + echo 'The PD visit was done at '. $address_type. ' of the loan applicants.'; + echo 'The '.$address_type.' is '.$property_owner_type.' and the business has been in operation from here for the last '.$yrs_being_run.'.'; + echo '

    The '.$address_type.' is located in '.$locality.' and the estimated area of the '.$address_type.' is '.$estimated_area.' .'; + echo '

    The PD location was '. $pd_address['pd_location_master'].'. ' . 'As Per PD Offcier, the '.$address_type .' is situated in '.$comment_locality_master .' Locality.'; + echo '

    The PD officer also made the following observations:' ; + echo '
      '; - echo "
    • The location of the ".$address_type." is ".$address_type_remarks_caption [ $final_remark_data['is_service_provided'] ]." to the nature of business.
    • "; + echo '
    • The location of the '.$address_type.' is '.$address_type_remarks_caption [ $final_remark_data['is_service_provided'] ].' to the nature of business.
    • '; if($business_assets_details['business_assets_for_address'][0]['business_is_pd_visited'] == 'yes') { - echo "
    • Business Activity was seen during visit.
    • "; + echo '
    • Business Activity was seen during visit.
    • '; } else{ - echo "
    • No business activity was seen during the PD visit
    • "; + echo '
    • No business activity was seen during the PD visit
    • '; } if(isset($business_assets_details['business_assets_form_remark']) && $business_assets_details['business_assets_form_remark'] != ""){ echo "
    • ".$business_assets_details['business_assets_form_remark'] ."
    • ";} @@ -1702,7 +1712,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_second_row .= ' '.$main_raw_material['manufacturing_client_name'].''; - $client_third_row .= ''.$main_raw_material['manufacturing_contact_person_mobile_number'] ? $main_raw_material['manufacturing_contact_person_mobile_number'] : 'Not Provided' .''; + $client_third_row .= ''.($main_raw_material['manufacturing_contact_person_mobile_number'] ? $main_raw_material['manufacturing_contact_person_mobile_number'].'' : 'Not Provided' .''); $client_fourth_row .= $main_raw_material['person_stdcode'] && $main_raw_material['person_landline'] ? ''. $main_raw_material['person_stdcode'].' '.$main_raw_material['person_landline'].'' : ''.'Not Provided'.''; @@ -1742,7 +1752,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_second_row .= ' '.$trading_product['trade_client_name'].''; - $client_third_row .= ''. $trading_product['trade_product_contact_person_mobile_number'] ? $trading_product['trade_product_contact_person_mobile_number'] : 'Not Provided'.''; + $client_third_row .= ''. ($trading_product['trade_product_contact_person_mobile_number'] ? $trading_product['trade_product_contact_person_mobile_number'].'' : 'Not Provided'.''); $client_fourth_row .= $trading_product['person_stdcode'] && $trading_product['person_landline'] ? ''. $trading_product['person_stdcode'].' '.$trading_product['person_landline'].'' : ''.'Not Provided'.''; @@ -1783,7 +1793,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_second_row .= ' '.$service_product['service_provider_client_name'].''; - $client_third_row .= ''. $service_product['service_provider_product_contact_person_mobile_number'] ? $service_product['service_provider_product_contact_person_mobile_number'] : 'Not Provided' .''; + $client_third_row .= ''. ($service_product['service_provider_product_contact_person_mobile_number'] ? $service_product['service_provider_product_contact_person_mobile_number'].'' : 'Not Provided' .''); $client_fourth_row .= $service_product['person_stdcode'] && $service_product['person_landline'] ? ''. $service_product['person_stdcode'].' '.$service_product['person_landline'].'' : ''.'Not Provided'.''; @@ -1808,7 +1818,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $client_fifth_row .= ''; $client_sixth_row .= ''; $client_seventh_row .= ''; - + //echo $client_third_row;die(); ?> Asset Description Asset Owned By Approx Market Value(Rs) - Purchase Year + Age of the Assest Loan Again Assest diff --git a/api/index.php b/api/index.php index c7fa828b..7f1cb7fb 100644 --- a/api/index.php +++ b/api/index.php @@ -54,7 +54,7 @@ * NOTE: If you change these, also change the error_reporting() code below */ //define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development'); - define('ENVIRONMENT','development'); + define('ENVIRONMENT','testing'); date_default_timezone_set('Asia/Kolkata'); @@ -77,7 +77,7 @@ switch (ENVIRONMENT) case 'testing': error_reporting(-1); - ini_set('display_errors', 0); + ini_set('display_errors', 1); break; case 'production': ini_set('display_errors', 0);