diff --git a/api/application/config/customconfig_one.php b/api/application/config/customconfig_one.php index dfdfde98..cb4954fb 100644 --- a/api/application/config/customconfig_one.php +++ b/api/application/config/customconfig_one.php @@ -73,4 +73,7 @@ $config['master_tables_field_names'] = array('INDUSTRYCLASSIFICATION' => 'name', $config['master_tables_pkid'] = array('INDUSTRYCLASSIFICATION' => 'industry_classification_id','UOM' => 'uom_id','OCCUPATIONMEMBERS' => 'occupation_non_earning_member_id','EDUQUALIFICATION' => 'qualification_name', 'TYPEOFACTIVITY' => 'type_of_activity_id','RELATIONSHIPS' => 'relationship_id','FREQUENCY' => 'frequency_id', 'CUSTOMERBEHAVIOUR' => 'customer_behaviour_id', 'CUSTOMERSEGMENT' => 'customer_segment_id','DESIGNATION' => 'designation_id', 'EARNINGMEMBERSSTATUS' => 'earning_member_status_id','EDUQUALIFICATION' => 'qualification_id','ADDRESSTYPE' => 'address_type_id','LOCALITY' => 'locality_id','ASSETTYPE' => 'id','PROPERTIES' => 'id','INVESTMENTTYPE' => 'id','INSURANCETYPE' => 'id','PERSONSMET' => 'person_met_id','RESIDENCEOWNERSHIP' => 'id','PAYMENTMODE' => 'id','ACCOUNTTYPE' => 'id','SOURCEOFOTHERINCOME' => 'id','MORTAGEPROPERTYTYPE' => 'id','ENDUSEOFLOAN' => 'enduse_of_loan_id','SOURCEOFBALANCETRANSFER' => 'id', 'STATUSOFCONSTRUCTION' => 'id','MORTAGEPROPERTIES' => 'mortage_property_id','BTLENDERLIST'=>'bt_lender_list_id','EXISTINGLOANTYPES'=>'existing_loan_type_id','PDAPPLICANTSDETAILS'=>'pd_co_applicant_id','RELATIONWITHBUSINESS'=>'relation_with_business_id','BUSINESSENTITYTYPE'=>'business_entity_type_id','COMPANYRELATIONSHIPS'=>'company_relationship_id','STATE'=>'state_id','CITY'=>'city_id','COUNTRY'=>'country_id','BOUNCEMASTER'=>'bounce_id','BUSINESSEXPENSES'=>'expense_item_id','BUSINESSINCOME'=>'business_income_id','COMMENTSONLOCALITY'=>'comments_on_locality_id','COMPANY'=>'name','LOCALITY'=>'locality_id','NONINDIVIDUALENTITIES'=>'non_individual_entity_id','PDFORMS'=>'form_id','PDLOCATIONAPPROACH'=>'pd_location_approach_id','PDTYPE'=>'pd_type_id','PDNOTIFICATION'=>'pdnotification_id','QUESTIONCATEGORY'=>'question_category_id','ROLES'=>'role_id','SUBPRODUCTS'=>'subproduct_id','TITLES'=>'title_id','PINCODE'=>'pincode_id','PRODUCTS'=>'product_id','ENTITYTYPE'=>'entity_type_id','PDTEAM'=>'pdteam_id','ENTITY'=>'entity_id','PDSTATUS'=>'pd_status_id','LISTOFMASTERS'=>'master_id','OTPREJECTION'=>'otp_rejection_id','ENDUSEOFTOPUP'=>'end_use_of_topup_id','VEHICLETYPE'=>'vehicle_type_id','PDOFFICERRECOMMENDATIONS'=>'pdofficer_recommendation_id','REGIONS'=>'region_id','PRICINGINFO'=>'pricing_info_id'); $config['parent_forms'] = array(0,10,7,4,6,8,9,20);// 0 added for dummy + + + ?> \ No newline at end of file diff --git a/api/application/config/routes.php b/api/application/config/routes.php index 8c2ee8c5..d08b73a0 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -208,6 +208,7 @@ $route['(getPDReportHTML/:any)'] = 'PD_Controller/getPDReportHTML'; $route['smartyTestFunction'] = 'PD_Controller/smartyTestFunction'; $route['codeigniterViewTest'] = 'PD_Controller/codeigniterViewTest'; +$route['archivePDImages'] = 'PD_Controller/archivePDImages'; //PD Form Related $route['getPDFormDetails'] = 'PD_Controller/getPDFormDetailsJSON'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index c6b88ce1..a165a748 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -320,6 +320,7 @@ class PD_Controller extends REST_Controller { $pd_details = json_decode($this->post('pd_details'),true); $pd_addtional_requirements = array(); + unset($pd_details['createdon']); $addresses = array(); $company = array(); if($this->post('addtional_requirements')) @@ -3930,9 +3931,11 @@ class PD_Controller extends REST_Controller { $main_applicant_name = $pd_master_details[0]['main_applicant']; $key = 'pd'.$pdid.'/pd_reports/'.$main_applicant_name.'.pdf'; + + if($pd_master_details[0]['is_qc_edited']) { - $is_qc_edited = 1; + $is_qc_edited = $pd_master_details[0]['is_qc_edited']; } if($is_qc_edited == 1 || $is_qc_edited == 2) @@ -3940,7 +3943,30 @@ class PD_Controller extends REST_Controller { //Get Latest PD Report Html file and convert it into PDF $latest_pd_report_html_file_name = $pd_master_details[0]['pd_report_html_filename']; $latest_pd_report_html_file_path = APPPATH.'views/pd_reports/'.$pdid.'/'.$latest_pd_report_html_file_name.'.html'; - $temp = file_get_contents($latest_pd_report_html_file_path); + $temp = file_get_contents($latest_pd_report_html_file_path); + + //Replace Span tags from HTML File + + $total_replaces = substr_count($temp,'');for($i = 0 ;$i < $total_replaces;$i++) + { + $start_pos = strpos($temp,''); + + $end_pos = strpos($temp, '', strpos($temp,'')); + $end_pos = $end_pos + 14; + //echo $start_pos.'-';echo $end_pos.'-';echo ($end_pos - $start_pos).'-'; + + $temp = substr_replace($temp,'',$start_pos,($end_pos - $start_pos)); + + + $temp = substr_replace($temp,'',strpos($temp,''),(strlen(''))); + + } + + + //End Of Replace Span tags from HTML File + + + //PDF Gen using DOM PDF $pdf_doc = $this->pdfgenerator->generate($temp, $filename='version', $stream=false, $paper = 'A4', $orientation = "portrait"); @@ -3973,6 +3999,7 @@ class PD_Controller extends REST_Controller { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $singed_uri; + //$data['records'] = array('pdf_url' => $singed_uri,'zip_url' => $zip_file_uri); $this->response($data,REST_Controller::HTTP_OK); } else @@ -4002,6 +4029,7 @@ class PD_Controller extends REST_Controller { $data['dataStatus'] = true; $data['status'] = REST_Controller::HTTP_OK; $data['records'] = $singed_uri; + //$data['records'] = array('pdf_url' => $singed_uri,'zip_url' => $zip_file_uri); $this->response($data,REST_Controller::HTTP_OK); } else @@ -4113,8 +4141,80 @@ class PD_Controller extends REST_Controller { } } - + + public function archivePDImages_post() + { + $records = $this->post('records'); + $pdid = $records['pd_id']; + $pd_master_details = $this->PD_Model->getPDMasterDetails($pdid); + $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_master_details[0]['fk_lender_id']; + $main_applicant_name = $pd_master_details[0]['main_applicant']; + + //get zip url from s3 if any + + $key = $main_applicant_name.'_'.$pdid.'_'.'pd_images.zip'; + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); + if($pd_master_details[0]['is_zip_created']) + { + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); + + $response_data['dataStatus'] = true; + $response_data['status'] = REST_Controller::HTTP_OK; + $response_data['records'] = $singed_uri; + $this->response($response_data,REST_Controller::HTTP_OK); + } + else + { + + $all_pd_images = $this->PD_Model->getSignedPDDocsURL($pdid); + + $all_form_names = $this->PD_Model->selectCustomRecords(array('pd_form_id','pd_form_name'),array(),PDFORMS); + $form_name = array(); + foreach($all_form_names as $form) + { + $form_name[ $form['pd_form_id'] ] = $form['pd_form_name']; + } + //print_r($form_name);die(); + //Generate zip file + + $this->load->library('zip'); + + $this->zip->add_dir('pdimages'); + + foreach($all_pd_images as $image) + { + $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->archive(APPPATH.'docs/'.$key); + + $bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>(APPPATH.'docs/'.$key)); + + $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); + //print_r($s3result); + if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) + { + //$result_array[0]['content'] + $where_condition_array = array("pd_id" => $pdid); + $temp_array['is_zip_created'] = 1; + $id = $this->PD_Model->updateRecords($temp_array,PDTRIGGER,$where_condition_array); + } + + + + $singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucketname,$key,'+30 minutes'); + + $response_data['dataStatus'] = true; + $response_data['status'] = REST_Controller::HTTP_OK; + $response_data['records'] = $singed_uri; + $this->response($response_data,REST_Controller::HTTP_OK); + } + + + } @@ -4934,23 +5034,8 @@ class PD_Controller extends REST_Controller { public function codeigniterViewTest_post() { - // $newstring = 'Easy to locate & ReachAddress Form - Approach to PD location .'; - // //echo $newstring ; - - // $start_pos = strpos($newstring,''); - - // $end_pos = strpos($newstring, '', strpos($newstring,'')); - // $end_pos = $end_pos + 14; - // //echo $start_pos.'-';echo $end_pos.'-';echo ($end_pos - $start_pos).'-'; - - // $newstring = substr_replace($newstring,'',$start_pos,($end_pos - $start_pos)); - // $newstring = substr_replace($newstring,'',strpos($newstring,''),(strlen(''))); - // echo $newstring; - - - // die(); $records = $this->post('records'); $pdid = $records['pd_id']; @@ -5028,6 +5113,7 @@ class PD_Controller extends REST_Controller { // $this->getPDImages_post($fields2,array('fk_pd_id'=>$pdid,'fk_form_id' => $i),PDDOCUMENTS,array(),'','company_id','ASC'); // print_r($this->db->last_query()); } + //print_r($data['pd_images']); //die(); //print_r($data['pd_images']);die(); //print_r(json_decode($data['pd_processed_forms'][14][0]['processed_json'],true)); //die(); @@ -5037,7 +5123,7 @@ class PD_Controller extends REST_Controller { $total_replaces = substr_count($t,''); - echo $total_replaces; + //echo $total_replaces; //echo $t; die(); //echo "*************************************"; //echo strpos($t,''); @@ -6015,7 +6101,7 @@ class PD_Controller extends REST_Controller { public function getPDImages_post() { $records = $this->post('records'); - $result_data = $this->PD_Model->getSignedPDDocsURL($records['pd_id'],$records['form_id'],$records['company_id']); + $result_data = $this->PD_Model->getSignedPDDocsURL($records['pd_id'],$records['form_id'],isset($records['company_id']) ? $records['company_id'] : null); if(count($result_data)) { $data['dataStatus'] = true; diff --git a/api/application/controllers/Welcome.php b/api/application/controllers/Welcome.php index 6190225c..298aad70 100644 --- a/api/application/controllers/Welcome.php +++ b/api/application/controllers/Welcome.php @@ -20,23 +20,11 @@ class Welcome extends CI_Controller { */ public function index() { - // require_once APPPATH . '/controllers/PD_Controller.php'; - // require_once APPPATH . '/libraries/REST_Controller.php'; - $this->load->view('welcome_message'); - //$this->load->library('../controllers/PD_Controller'); - // $PD_Controller = new PD_Controller(); - //echo $PD_Controller->index(); + $this->load->view('welcome_message'); + } - 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 952d5bcb..858aac1d 100644 Binary files a/api/application/docs/sample.pdf and b/api/application/docs/sample.pdf differ diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 50d00fc7..01689436 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -232,8 +232,9 @@ class PD_Model extends SPARQ_Model { //Get PD Documenttitle and name from DB $where_condition_array = array('fk_pd_id' => $pdid); - - $where_condition_array['fk_form_id'] = $form_id != null ? $form_id : null; + if($company_id != null){ + $where_condition_array['fk_form_id'] = $form_id; + } if($company_id != null){ $where_condition_array['company_id'] = $company_id ; @@ -241,7 +242,7 @@ class PD_Model extends SPARQ_Model { //print_r($where_condition_array);die(); $document_lists = $this->selectRecords(PDDOCUMENTS,$where_condition_array); - // print_r($this->db->last_query());die(); + //print_r($this->db->last_query());die(); if(count($document_lists)) { @@ -744,7 +745,7 @@ class PD_Model extends SPARQ_Model { */ public function getPDMasterDetails($pdid) { - $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited'); + $this->db->SELECT('PDTRIGGER.pd_id, PDTRIGGER.fk_lender_id,ENTITY.full_name as lender_full_name,ENTITY.short_name as lender_short_name, PDTRIGGER.fk_entity_billing_id,ENTITYBILLING.billing_name,PDTRIGGER.lender_applicant_id, DATE_FORMAT(PDTRIGGER.pd_date_of_initiation, "%d/%m/%Y") as pd_date_of_initiation,PDTRIGGER.pd_date_of_initiation as pd_date_of_initiation_sqlformat, PDTRIGGER.fk_product_id,PRODUCTS.name as product_name,PRODUCTS.abbr as product_abbr, PDTRIGGER.fk_subproduct_id,SUBPRODUCTS.name as subproduct_name,SUBPRODUCTS.abbr as subproduct_abbr, PDTRIGGER.fk_pd_type,PDTYPE.type_name as pd_type_name, PDTRIGGER.pd_status,PDTRIGGER.pd_specific_clarification, DATE_FORMAT(PDTRIGGER.createdon,"%d/%m/%Y %H:%i %p") as createdon, PDTRIGGER.fk_createdby, DATE_FORMAT(PDTRIGGER.updatedon,"%d/%m/%Y %H:%i %p") as updatedon, PDTRIGGER.fk_updatedby,concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as createdby,concat(USERPROFILE1.first_name," ",USERPROFILE1.last_name) as updatedby, PDTRIGGER.fk_pd_allocation_type,,PDALLOCATIONTYPE.pd_allocation_type_name, PDTRIGGER.fk_pd_allocated_to,concat(USERPROFILE2.first_name," ",USERPROFILE2.last_name) as pd_allocated_to,PDTRIGGER.executive_id,concat(EXECUTIVE.first_name," ",EXECUTIVE.last_name) as executive_name,PDTRIGGER.central_pd_officer_id,concat(CENTRALOFFICER.first_name," ",CENTRALOFFICER.last_name) as centralofficer,PDTRIGGER.fk_pd_template_id,TEMPLATE.template_name, PDTRIGGER.fk_customer_segment,CUSTOMERSEGMENT.name as customer_segment_name,CUSTOMERSEGMENT.abbr as customer_segment_abbr, PDTRIGGER.pd_officier_final_judgement, PDTRIGGER.pd_agency_id,AGENCY.full_name as agency_name, PDTRIGGER.loan_amount,PDTRIGGER.addressline1,PDTRIGGER.addressline2,PDTRIGGER.addressline3,PDTRIGGER.fk_city,CITY.name as city_name,PDTRIGGER.fk_state,STATE.name as state_name,PINCODE.pincode,PDTRIGGER.pincode as pincode_id,PDTRIGGER.pd_contact_person,PDTRIGGER.pd_contact_mobileno,DATE_FORMAT(PDTRIGGER.scheduled_on,"%d/%m/%Y %h:%i %p") as scheduled_on,PDTRIGGER.scheduled_on as scheduled_on_for_validation,DATE_FORMAT(PDTRIGGER.scheduled_on,"%dth %b %Y ") as scheduled_date_for_log,DATE_FORMAT(PDTRIGGER.scheduled_on,"%h:%i %p") as scheduled_time_for_log,DATE_FORMAT(PDTRIGGER.completed_on,"%d/%m/%Y %h:%i:%s %p") as completed_on,PDTRIGGER.remarks,PDTRIGGER.bounce_reason,PDTRIGGER.bounce_reason_others,BOUNCEMASTER.bounce_reason_name,PDTRIGGER.is_original_report_created,PDTRIGGER.pd_report_latest_version,PDAPPLICANTSDETAILS.applicant_name as main_applicant,PDTRIGGER.pd_branch_id,ENTITYLENDERBRANCH.branch_name,PDTRIGGER.qc_feedback,PDTRIGGER.qc_rating,PDTRIGGER.qc_remarks,PDTRIGGER.lender_rating,PDTRIGGER.lender_feedback,PDAPPLICANTSDETAILS.applicant_title_name,TITLES.name as title_name,PDTRIGGER.pd_contact_landline,PDTRIGGER.other_pincode,PDTRIGGER.is_otp_done,PDTRIGGER.encrypted_url,PDTRIGGER.is_child,PDTRIGGER.parent_pd_id,PDTRIGGER.fk_primary_address_id,PDTRIGGER.fk_address_id,PDTRIGGER.start_location,PDTRIGGER.satellite_image_base64_blob,DATE_FORMAT(PDTRIGGER.pd_report_generated_date,"%d/%m/%Y %h:%i:%s %p") as pd_report_generated_date,DATE_FORMAT(PDTRIGGER.pd_visit_date,"%d/%m/%Y %h:%i:%s %p") as pd_visit_date,PDTRIGGER.random_string,PDTRIGGER.pd_report_html_filename,PDTRIGGER.is_qc_edited,PDTRIGGER.is_zip_created'); $this->db->FROM(PDTRIGGER.' as PDTRIGGER'); $this->db->JOIN(ENTITY.' as ENTITY','PDTRIGGER.fk_lender_id = ENTITY.entity_id ','LEFT'); $this->db->JOIN(ENTITYBILLING.' as ENTITYBILLING','PDTRIGGER.fk_entity_billing_id = ENTITYBILLING.entity_billing_id','LEFT'); diff --git a/api/application/views/report_templates/JSONTOREPORT.php b/api/application/views/report_templates/JSONTOREPORT.php index 76fb7fd5..f7019e3c 100644 --- a/api/application/views/report_templates/JSONTOREPORT.php +++ b/api/application/views/report_templates/JSONTOREPORT.php @@ -77,7 +77,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); /* ######### Mini Score Card Table Styles######### */ .mini_scorecard_table { - width: 80%; + width: 100%; page-break-inside: avoid; } @@ -102,28 +102,28 @@ defined('BASEPATH') OR exit('No direct script access allowed'); background: #ff9900; padding: 3px; - width: 100px; + width: 75px; height: 5px; } #rcorners_red { background: red; padding: 3px; - width: 100px; + width: 75px; height: 5px; } #rcorners_light_green { background: #99ff66; padding: 3px; - width: 100px; + width: 75px; height: 5px; } #rcorners_amber{ background: #33cc33; padding: 3px; - width: 100px; + width: 75px; height: 5px; } @@ -770,26 +770,43 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $general_captions = array("otp_done" => "OTP authentication done >>","person_met_is_applicant" => "Is person Met, a loan applicant >>","qualification" => "Qualification of Loan Applicants >>","comment_locality" => "Comment on Locality >>","pd_location_approach" => "Approach to PD location >>","customer_behaviour" => "Customer Behaviour >>","neibourhood_check_as_per_pd_officer" => "Neighbourhood check >>","was_the_company_name_board_sighted" => "Business Board Sighted >>","value_of_other_assets" => "Asset Value by Loan Amount % >>"); + $address_type_remarks_caption = array('well_suited' => 'well suited','fairly_suited' => 'fairly suited','not_suited' => 'not suited'); + + echo ''; - echo ''; + echo ''; echo ''; foreach($pd_score['business'] as $bsk => $business_score) { + $class = null; + $answer = null; $per = $business_score['attributed_score'] > 0 && $business_score['max_score'] > 0 ? ( ($business_score['attributed_score'] / $business_score['max_score']) * 100) : 0; $class = ( $per >= 80 ? 'rcorners_green' : $per >= 70 && $per < 80 ? 'rcorners_light_green' : $per >= 60 && $per < 70 ? 'rcorners_amber' : 'rcorners_red'); + + if($bsk == 'location_suited_for_busienss') + { + $answer = $address_type_remarks_caption[ $business_score['answer'] ]; + } + else if($bsk == 'cerificates') + { + $answer = $per > 0 ? 'Yes' : 'No'; + } + else + { + $answer = isset($business_score['answer']) ? $business_score['answer'] : 'WAIT'; + } - - echo ''; + echo ''; } echo ''; echo '
Business Related Parameters Impacting Score Score
Business Related Parameters Impacting Score Response
'. $business_captions[$bsk] .' '. '
'. round($business_score['attributed_score'],3).'
'. $business_captions[$bsk] .' '. '
'. ucfirst($answer).'
'; echo '


'; echo ''; - echo ''; + echo ''; echo ''; foreach($pd_score['general'] as $gsk => $general_score) @@ -800,7 +817,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $class = ( $per >= 80 ? 'rcorners_green' : $per >= 70 && $per < 80 ? 'rcorners_light_green' : $per >= 60 && $per < 70 ? 'rcorners_amber' : 'rcorners_red'); - echo ''; + echo ''; } echo ''; echo '
Other Parameters Impacting Score Score
Other Parameters Impacting ScoreResponse
'. $general_captions[$gsk] .' '. '
'. round($general_score['attributed_score'],3).'
'. $general_captions[$gsk] .' '. '
'. ucfirst($general_score['answer']).'
'; @@ -815,7 +832,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

Location Summary

'well suited','fairly_suited' => 'fairly suited','not_suited' => 'not suited'); + $address_type = $pd_address['address_type_master']; $estimated_area = $pd_address['estimated_area'].' '; $estimated_area .= $pd_address['uom_others'] != "" || $pd_address['uom_others'] != null ? $pd_address['uom_others'] : $pd_address['uom_master']; @@ -1111,7 +1128,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } if(strtoupper($businessRow['other_documents'])=='YES' && array_key_exists('documents',$businessRow)){ foreach($businessRow['documents'] as $docValue){ - array_push($getDocuments,array('name' => $docValue['document'].'.', 'img' => '')); + array_push($getDocuments,array('name' => $docValue['document'].'.', 'img' => $docValue['document_pic'])); } } $bindEachResult['visit_documents']=$getDocuments; @@ -1466,12 +1483,14 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $visit_documents = ($fetchRow['visit_documents']); //print_r($visit_documents);die(); $visit_documents_row_count = ceil(count($fetchRow['visit_documents'])/2); - + //echo count($visit_documents); + //echo $visit_documents_row_count;die(); + $from_index_increment = 0; for($vrc = 1;$vrc <= $visit_documents_row_count;$vrc++) { - $from = $vrc == 1 ? 0 : ( $vrc ); - $to = $vrc == 1 ? 1 : ( $vrc ); + $from = $from_index_increment; + $to = ($from + 1); echo ''; for ($doc = $from; $doc <= $to ; $doc++){ if(isset($visit_documents[$doc])){ @@ -1486,6 +1505,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); } } echo ''; + $from_index_increment = $from_index_increment+2; } ?> @@ -1493,7 +1513,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); @@ -2075,7 +2095,49 @@ defined('BASEPATH') OR exit('No direct script access allowed'); - Out of total sales done by ".$name_of_the_company .", ".$done_on_credit."% is done on credit.

"; }?> + Out of total sales done by ".$name_of_the_company .", ".$done_on_credit."% is done on credit.

"; } + + //CLient Photo Section + $client_photo_count = $pd_images[2]; + $client_img_row_count = ceil(count($client_photo_count) / 3); + + if(count($client_photo_count)){ + // echo '
'; + // echo '

Supplier '.($k+1).' Photograph`s :

'; + // echo '
'; + echo ''; + + $client_from_index_increment = 0; + for($img_row = 1; $img_row <= $client_img_row_count; $img_row++) + { + + echo ''; + $from = $client_from_index_increment; + $to = ($from + 2); + for($client_photo_iter = $from; $client_photo_iter <= $to;$client_photo_iter++) + { + + if(isset($client_photo_count[$client_photo_iter]) &&$client_photo_count[$client_photo_iter]['company_id'] == ($business_count+1)) + { + echo ''; + //unset($stock_photo_count[$stock_photo_iter]); + } + + } + //echo "


"; + echo ''; + $client_from_index_increment = $client_from_index_increment + 3; + } + //echo ''; + echo '
'; + echo ''; + echo '
'; + } + //End of CLient Photo Section + ?> @@ -2089,7 +2151,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // this is for manufacturing $supplier_details = $pd_processed_forms[1][$business_count]; $supplierRow = json_decode($supplier_details['processed_json'],true); - //print_r($supplierRow['trade_details']);die(); + //print_r($supplierRow);die(); $company_name = MYUTIL::findCompanyName($all_company_details,$supplierRow['company_id'],1); $total_no_of_suppliers = count($supplierRow['manufacturing_details']); $total_payments_percent_on_credit_for_supplier = 0; @@ -2101,7 +2163,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); if(isset($manuRow['main_raw_materials'])){ - foreach($manuRow['main_raw_materials'] as $raw){ + foreach($manuRow['main_raw_materials'] as $rawkey => $raw){ $temp['supplier_first_row'] = '1Item Purchased '.''.$raw['manufacturing_raw_material_name'].''; @@ -2115,6 +2177,9 @@ defined('BASEPATH') OR exit('No direct script access allowed'); $supplier_second_row .= isset($raw['person_designation_master']) ? $raw['person_designation_master'] : '' ; $supplier_second_row .= ' '.$raw['manufacturing_supplier_name'].''; + + $name_for_photo = $raw['manufacturing_supplier_name'].' - Raw Material '.($rawkey + 1); + $temp['supplier_name_for_photo'] = $name_for_photo; $temp['supplier_second_row'] = $supplier_second_row.''; $temp['supplier_third_row'] = '3Mobile Number '.''. (isset($raw['manufacturing_contact_person_mobile_number']) ? $raw['manufacturing_contact_person_mobile_number'].'' : 'Not Provided' .''); @@ -2202,7 +2267,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');

Supplier Details

$fetchRow){ - echo '
Supplier '.($k+1).':


'; + echo '
Supplier '.($k+1).':

'; ?> @@ -2227,10 +2292,64 @@ defined('BASEPATH') OR exit('No direct script access allowed');
- + '; + echo '

Supplier '.($k+1).' Photograph`s :

'; + echo '
'; + echo ''; + + $supplier_from_index_increment = 0; + for($img_row = 1; $img_row <= $supplier_img_row_count; $img_row++) + { + + echo ''; + $from = $supplier_from_index_increment; + $to = ($from + 2); + for($supplier_photo_iter = $from; $supplier_photo_iter <= $to;$supplier_photo_iter++) + { + + if(isset($supplier_photo_count[$supplier_photo_iter]) &&$supplier_photo_count[$supplier_photo_iter]['company_id'] == ($business_count+1)) + { + echo ''; + //unset($stock_photo_count[$stock_photo_iter]); + } + + } + //echo "


"; + echo ''; + $supplier_from_index_increment = $supplier_from_index_increment + 3; + } + //echo ''; + echo '
'; + echo ''; + echo '
'; + } + + + //End of Supplier Photo section + + }//End of supplier foreach ?> 0) { echo "

Have to make payment of about ". $total_payments_percent_on_credit_for_supplier ." % in advance rest on delivery.

"; @@ -2381,28 +2500,15 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo '

'. $is_raw_materials_sufficient_enough_remarks.'

'; } echo '

'.$stock_remarks.'

'; - $stock_photo_count = $pd_images[11]; - // echo count($pd_images[11]); - // die(); + $stock_photo_count = $pd_images[11]; $stock_img_row_count = ceil(count($stock_photo_count) / 3); - //echo $stock_img_row_count; if(count($stock_photo_count)){ echo '
'; echo '

Stock Photograph`s :

'; echo '
'; echo ''; - //echo ''; - // echo '
'; - // foreach($stock_photo_count as $stock) - // { - // echo $stock['pd_document_title']; - // echo ''; - // echo '   '; - - // } - //echo ''; for($img_row = 1; $img_row <= $stock_img_row_count; $img_row++) { diff --git a/api/index.php b/api/index.php index 39fe9976..7f1cb7fb 100644 --- a/api/index.php +++ b/api/index.php @@ -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);