SALE PD WITH MAIL AND LIVE ISSUES
This commit is contained in:
parent
9cee26105c
commit
5991b6bff2
@ -115,7 +115,7 @@ $config['sms_api_pwd'] = 'wRfAwb&v';
|
||||
$config['sms_gupshup_url'] = 'http://enterprise.smsgupshup.com/GatewayAPI/rest?method=SendMessage&send_to={{send_to_mobile_no}}&msg={{send_msg}}&msg_type=TEXT&userid={{sms_api_user_id}}&auth_scheme=plain&password={{sms_api_pwd}}=1.1&format=text';
|
||||
|
||||
|
||||
$config['master_tables_field_names'] = array('INDUSTRYCLASSIFICATION' => 'name','UOM' => 'name','OCCUPATIONMEMBERS' => 'name','EDUQUALIFICATION' => 'qualification_name', 'TYPEOFACTIVITY' => 'name','RELATIONSHIPS' => 'name','FREQUENCY' => 'name', 'CUSTOMERBEHAVIOUR' => 'description', 'CUSTOMERSEGMENT' => 'name','DESIGNATION' => 'short_name', 'EARNINGMEMBERSSTATUS' => 'earning_member_status','EDUQUALIFICATION' => 'qualification_name','ADDRESSTYPE' => 'address_type','LOCALITY' => 'locality_name','ASSETTYPE' => 'name','PROPERTIES' => 'name','INVESTMENTTYPE' => 'name','INSURANCETYPE' => 'name','PERSONSMET' => 'person_met_name','RESIDENCEOWNERSHIP' => 'name','PAYMENTMODE' => 'name','ACCOUNTTYPE' => 'name','SOURCEOFOTHERINCOME' => 'name','MORTAGEPROPERTYTYPE' => 'name','ENDUSEOFLOAN' => 'enduse_of_loan','SOURCEOFBALANCETRANSFER' => 'name', 'STATUSOFCONSTRUCTION' => 'name','BTLENDERLIST'=>'lender_name','MORTAGEPROPERTIES'=>'property_name','EXISTINGLOANTYPES'=>'loan_type_name','PDAPPLICANTSDETAILS'=>'applicant_name','RELATIONWITHBUSINESS'=>'relation_with_business_name','BUSINESSENTITYTYPE'=>'business_entity_type_name','COMPANYRELATIONSHIPS'=>'name','STATE'=>'name','CITY'=>'name','COUNTRY'=>'country_name','BOUNCEMASTER'=>'bounce_reason_name','BUSINESSEXPENSES'=>'expense_item','BUSINESSINCOME'=>'business_income_item','COMMENTSONLOCALITY'=>'rating','COMPANY'=>'company_id','LOCALITY'=>'locality_name','NONINDIVIDUALENTITIES'=>'non_individual_entity_name','PDFORMS'=>'pd_form_name','PDLOCATIONAPPROACH'=>'description','PDTYPE'=>'type_name','PDNOTIFICATION'=>'pd_status','QUESTIONCATEGORY'=>'category_name','ROLES'=>'role_name','SUBPRODUCTS'=>'name','TITLES'=>'name','PINCODE'=>'pincode','PRODUCTS'=>'name','ENTITYTYPE'=>'name','PDTEAM'=>'team_name','ENTITY'=>'short_name','PDSTATUS'=>'pd_status_name','LISTOFMASTERS'=>'master_name','OTPREJECTION'=>'rejection_reason','ENDUSEOFTOPUP'=>'end_use_of_topup','VEHICLETYPE'=>'vehicle_type_name','PDOFFICERRECOMMENDATIONS'=>'pdofficer_recommendation','REGIONS'=>'name','PRICINGINFO'=>'pricing_info_id');
|
||||
$config['master_tables_field_names'] = array('INDUSTRYCLASSIFICATION' => 'name','UOM' => 'name','OCCUPATIONMEMBERS' => 'name','EDUQUALIFICATION' => 'qualification_name', 'TYPEOFACTIVITY' => 'name','RELATIONSHIPS' => 'name','FREQUENCY' => 'name', 'CUSTOMERBEHAVIOUR' => 'description', 'CUSTOMERSEGMENT' => 'name','DESIGNATION' => 'designation', 'EARNINGMEMBERSSTATUS' => 'earning_member_status','EDUQUALIFICATION' => 'qualification_name','ADDRESSTYPE' => 'address_type','LOCALITY' => 'locality_name','ASSETTYPE' => 'name','PROPERTIES' => 'name','INVESTMENTTYPE' => 'name','INSURANCETYPE' => 'name','PERSONSMET' => 'person_met_name','RESIDENCEOWNERSHIP' => 'name','PAYMENTMODE' => 'name','ACCOUNTTYPE' => 'name','SOURCEOFOTHERINCOME' => 'name','MORTAGEPROPERTYTYPE' => 'name','ENDUSEOFLOAN' => 'enduse_of_loan','SOURCEOFBALANCETRANSFER' => 'name', 'STATUSOFCONSTRUCTION' => 'name','BTLENDERLIST'=>'lender_name','MORTAGEPROPERTIES'=>'property_name','EXISTINGLOANTYPES'=>'loan_type_name','PDAPPLICANTSDETAILS'=>'applicant_name','RELATIONWITHBUSINESS'=>'relation_with_business_name','BUSINESSENTITYTYPE'=>'business_entity_type_name','COMPANYRELATIONSHIPS'=>'name','STATE'=>'name','CITY'=>'name','COUNTRY'=>'country_name','BOUNCEMASTER'=>'bounce_reason_name','BUSINESSEXPENSES'=>'expense_item','BUSINESSINCOME'=>'business_income_item','COMMENTSONLOCALITY'=>'rating','COMPANY'=>'company_id','LOCALITY'=>'locality_name','NONINDIVIDUALENTITIES'=>'non_individual_entity_name','PDFORMS'=>'pd_form_name','PDLOCATIONAPPROACH'=>'description','PDTYPE'=>'type_name','PDNOTIFICATION'=>'pd_status','QUESTIONCATEGORY'=>'category_name','ROLES'=>'role_name','SUBPRODUCTS'=>'name','TITLES'=>'name','PINCODE'=>'pincode','PRODUCTS'=>'name','ENTITYTYPE'=>'name','PDTEAM'=>'team_name','ENTITY'=>'short_name','PDSTATUS'=>'pd_status_name','LISTOFMASTERS'=>'master_name','OTPREJECTION'=>'rejection_reason','ENDUSEOFTOPUP'=>'end_use_of_topup','VEHICLETYPE'=>'vehicle_type_name','PDOFFICERRECOMMENDATIONS'=>'pdofficer_recommendation','REGIONS'=>'name','PRICINGINFO'=>'pricing_info_id');
|
||||
|
||||
$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');
|
||||
|
||||
|
||||
@ -5697,10 +5697,10 @@ public function getPDFormDetailsJSON_post()
|
||||
|
||||
public function codeigniterViewTest_post()
|
||||
{
|
||||
|
||||
//satellite_image::getSatelliteImage(886);die();
|
||||
//echo $this->assignPDTempalate(1325);die();
|
||||
//$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com
|
||||
//PDALERTS::sendMail($this,'vitvelz@gmail.com','PDGENIE TEST',array());die();
|
||||
//PDALERTS::sendSalesPDMail($this,'vitvelz@gmail.com','PDGENIE TEST');die();
|
||||
//$this->load->helper('applicantname_grabber');
|
||||
// print_r(APPLICANTNAME_GRABBER::getLatestApplicantsName(1390));die();
|
||||
//satellite_image::getSatelliteImage(1442);die();
|
||||
@ -5820,8 +5820,9 @@ public function getPDFormDetailsJSON_post()
|
||||
//print_r($data['pd_master_details'][0]['is_score_card_enabled']);die();
|
||||
// echo "**************************";
|
||||
//$data['dsc_cards'] = $this->getDetailedScoreCardChart( $data['pd_score'] );
|
||||
if($data['pd_master_details'][0]['is_score_card_enabled'] == 1 && ($data['pd_master_details'][0]['customer_segment_abbr'] != ''))
|
||||
if($data['pd_master_details'][0]['is_score_card_enabled'] == 1 && ($data['pd_master_details'][0]['customer_segment_abbr'] != "SAL-CASH" && $data['pd_master_details'][0]['customer_segment_abbr'] != "SAL-CHQ")) //&& ($data['pd_master_details'][0]['customer_segment_abbr'] != ''))
|
||||
{
|
||||
//echo $data['pd_master_details'][0]['is_score_card_enabled'].'-'.$data['pd_master_details'][0]['customer_segment_abbr'];die();
|
||||
$data['pd_score'] = $this->calculateScore($pdid);
|
||||
//print_r( $data['pd_score']);die();
|
||||
$score_for_chart = $data['pd_score']['score_summary']['overall_score']['final_score'] ? round($data['pd_score']['score_summary']['overall_score']['final_score'],1) : 0;
|
||||
@ -5875,7 +5876,7 @@ public function getPDFormDetailsJSON_post()
|
||||
}
|
||||
//print_r(json_decode($data['pd_processed_forms'][18][0]['processed_json']));die();
|
||||
$data['pd_images']['common_images'] = $this->PD_Model->getSignedPDDocsURL($pdid,null,null,'common',null,'report');
|
||||
// print_r($data['pd_images'][11]);
|
||||
//print_r($data['pd_processed_forms'][12]);//die();
|
||||
|
||||
// $it = array_filter($data['pd_images'][11],function($d){ if($d['company_id'] == 2){ echo $d['company_id'].'TRUE';return 1;}else {echo $d['company_id'].'FALSE'; return 0;} });
|
||||
// print_r($it);
|
||||
@ -5927,6 +5928,10 @@ public function getPDFormDetailsJSON_post()
|
||||
{
|
||||
$t = $this->load->view('report_templates/JSONTOREPORT_DI_AI',$data,true);
|
||||
}
|
||||
else if($data['pd_master_details'][0]['customer_segment_abbr'] == 'SAL-CASH' || $data['pd_master_details'][0]['customer_segment_abbr'] == 'SAL-CHQ' )
|
||||
{
|
||||
$t = $this->load->view('report_templates/JSONTOREPORT_SAL',$data,true);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -5934,7 +5939,8 @@ public function getPDFormDetailsJSON_post()
|
||||
}
|
||||
//$t = $this->load->view('temp_html.html',null,true);
|
||||
echo $t;
|
||||
die();
|
||||
//
|
||||
//die();
|
||||
|
||||
$total_replaces = substr_count($t,'<span class="tooltip">');
|
||||
for($i = 0 ;$i < $total_replaces;$i++)
|
||||
|
||||
@ -22,6 +22,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$this->load->library('AWS_S3');
|
||||
$this->load->library('pdfgenerator');
|
||||
$this->load->helper('satellite_image');
|
||||
$this->load->library('phpmailer_library');
|
||||
|
||||
|
||||
}
|
||||
@ -149,12 +150,9 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
// }
|
||||
|
||||
// }
|
||||
|
||||
public function getSalesPDReport_get()
|
||||
function prepareSalesPDReport($sales_pd_id,$api = true)
|
||||
{
|
||||
$sales_pd_id = $this->uri->segment(2);
|
||||
|
||||
$columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr');
|
||||
$columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr');
|
||||
$table = SALES_PD_DATA.' as SALES_PD_DATA';
|
||||
$joins = array(
|
||||
array('table' => ENTITY. ' as ENTITY',
|
||||
@ -201,8 +199,8 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$view_data['section'.$section['section_id'] ] = $this->processSalesPDJSON($section);
|
||||
}
|
||||
//print_r($view_data['section1']);die();
|
||||
$view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite'),SALEPD_DOCS);
|
||||
$view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite'),SALEPD_DOCS);
|
||||
$view_data['section9'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name !=' => 'satellite','isactive' => 1),SALEPD_DOCS);
|
||||
$view_data['satellite_image'] = $this->Sales_PD_Model->selectCustomRecords(array('*'),array('fk_sales_pd_id' => $sales_pd_id,'img_name' => 'satellite','isactive' => 1),SALEPD_DOCS);
|
||||
$view_data['product_id'] = $sales_pd_data[0]['product_id'];
|
||||
$view_data['geo_location'] = $sales_pd_data[0]['geo_location'];
|
||||
//print_r($this->db->last_query());die();
|
||||
@ -223,23 +221,34 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
{
|
||||
|
||||
$this->Sales_PD_Model->updateRecords(array('is_pdf' => 1, 'is_edited' => 0),SALES_PD_DATA,array('sales_pd_id' => $sales_pd_id));
|
||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $singed_uri;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
if($api)
|
||||
{
|
||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $singed_uri;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $singed_uri;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
if($api)
|
||||
{
|
||||
$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI($bucket_name,$key,'30 minutes');
|
||||
$data['dataStatus'] = true;
|
||||
$data['status'] = REST_Controller::HTTP_OK;
|
||||
$data['records'] = $singed_uri;
|
||||
$this->response($data,REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public function getSalesPDReport_get()
|
||||
{
|
||||
$sales_pd_id = $this->uri->segment(2);
|
||||
$this->prepareSalesPDReport($sales_pd_id);
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -520,6 +529,9 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$records['completed_date'] = date('Y-m-d h:i:s');
|
||||
$id = $this->Sales_PD_Model->updateRecords($records,SALES_PD_DATA,array('sales_pd_id' => $records['sales_pd_id']));
|
||||
satellite_image::getSatelliteImage($records['sales_pd_id'],2);
|
||||
$this->prepareSalesPDReport($records['sales_pd_id'],false);
|
||||
//trigger mail function
|
||||
PDALERTS::sendSalesPDMail($this,$records['sales_pd_id']);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -591,13 +603,12 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$applicant_id = $g_value['answer_value'] ? $g_value['answer_value'] : 'Not Provided';
|
||||
}
|
||||
|
||||
if($sales_pd_master_data[0]['abbr'] == 'BL') // leter WTCL
|
||||
{
|
||||
if($sales_pd_master_data[0]['abbr'] == 'WCTL')
|
||||
if($g_value['question_key'] == 'company_name')
|
||||
{
|
||||
$applicant_name = $g_value['answer_value'];
|
||||
}
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
if($g_value['question_key'] == 'main_loan_applicant')
|
||||
@ -741,7 +752,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$question['is_repeatable'] = "";
|
||||
$question['group_title'] = null;
|
||||
$question['answer_value'] = $exist_data_value['img'];
|
||||
$question['answer_value'] = "IMG";
|
||||
//$question['answer_value'] = "IMG";
|
||||
$question['question'] = $photo_names [ $exist_data_value['img_name'] ];
|
||||
$question['question_key'] = $exist_data_value['img_name'];
|
||||
$question['type'] = 6;
|
||||
@ -830,7 +841,7 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
}
|
||||
|
||||
$temp['questions'] = array_values($questions);
|
||||
print_r($questions);die();
|
||||
//print_r($questions);die();
|
||||
|
||||
$temp['section_id'] = 9;
|
||||
$temp['section_name'] = 'Photography';
|
||||
|
||||
@ -492,6 +492,77 @@ class PDALERTS
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendSalesPDMail($CI,$salespd_id)
|
||||
{
|
||||
|
||||
|
||||
$mail = $CI->phpmailer_library->load();
|
||||
$mail_contents = SELF::salesPDMailContentGrabber($CI,$salespd_id);
|
||||
//echo "$msg";
|
||||
if(count($mail_contents))
|
||||
{
|
||||
$mail->IsSMTP(); // Telling the class to use SMTP
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->SMTPDebug = 0;
|
||||
$mail->SMTPSecure = "ssl";
|
||||
$mail->Host = 'bh-in-16.webhostbox.net'; // SMTP server
|
||||
$mail->Username = "noreply@ssa.sineedge.com"; // "The account"
|
||||
$mail->Password = "noreply@ssa"; // "The password"
|
||||
$mail->Port = 465; // "The port"
|
||||
$mail->addAddress('vishant@sinemanegement.com');
|
||||
$mail->addBCC("vitvelz@gmail.com", "Some BCC Name"); // Name is optional
|
||||
$mail->From = 'noreply@pdgenie.com';
|
||||
$fromName = 'PD Genie'; if(ENVIRONMENT == 'testing' || ENVIRONMENT == 'development') { $fromName .= ' ( TEST ENV ) '; }
|
||||
$mail->FromName = $fromName;
|
||||
$mail->isHTML(true); // Set email format to HTML
|
||||
$mail->Subject = $mail_contents[0];
|
||||
$mail->Body = $mail_contents[2];
|
||||
$mail->AltBody = $mail_contents[2];
|
||||
$mail->addStringAttachment(file_get_contents($mail_contents[3]), $mail_contents[1]);
|
||||
|
||||
|
||||
//$logger = MYLOG::logFunction(null,$core_details[0]['pd_id']);
|
||||
if(!$mail->send()) {
|
||||
//$logger->error("Mailer Error:" ,array($mail->ErrorInfo));
|
||||
log_message('ERROR','SALESPD MAIL SEND'.$mail_contents[1]);
|
||||
} else {
|
||||
//$logger->info("Mailer Send:" ,array('mail_ID' => $lender_email,'Status' => 'SEND'));
|
||||
//echo 'DONE';
|
||||
log_message('ERROR','SALESPD MAIL NOT SEND'.$mail_contents[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static function salesPDMailContentGrabber($CI,$sales_pd_id)
|
||||
{
|
||||
$columns = array('SALES_PD_DATA.*','ENTITY.short_name','PRODUCT.abbr');
|
||||
$table = SALES_PD_DATA.' as SALES_PD_DATA';
|
||||
$joins = array(
|
||||
array('table' => ENTITY. ' as ENTITY',
|
||||
'condition' =>'SALES_PD_DATA.lender_id = ENTITY.entity_id',
|
||||
'jointype' => 'INNER'),
|
||||
array('table' => PRODUCTS. ' as PRODUCT',
|
||||
'condition' =>'SALES_PD_DATA.product_id = PRODUCT.product_id',
|
||||
'jointype' => 'INNER')
|
||||
);
|
||||
|
||||
$where_condition_array = array('SALES_PD_DATA.sales_pd_id' => $sales_pd_id);
|
||||
$sales_pd_data = $CI->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array);
|
||||
if(count($sales_pd_data))
|
||||
{
|
||||
$mail_subject = "Sales PD Report for ";
|
||||
$pdf_name = strtolower(trim($sales_pd_data[0]['applicant_name']));
|
||||
$pdf_name .= '-'.$sales_pd_data[0]['abbr'];
|
||||
$pdf_name .= '-'.(date('dmY',strtotime($sales_pd_data[0]['completed_date'])));
|
||||
$mail_subject .=$pdf_name;
|
||||
$file_name = $pdf_name.'.pdf';
|
||||
$content = "Dear Team<br><br>Please find enclosed the sales PD report." ;
|
||||
$key = 'sales_pd/'.$sales_pd_id.'/'.$pdf_name.'.pdf';
|
||||
$singed_uri = $CI->aws_s3->getSingleObjectInaBucketAsSignedURI((LENDER_BUCKET_NAME_PREFIX.$sales_pd_data[0]['lender_id']),$key,'+5 minutes');
|
||||
//echo $singed_uri;
|
||||
return array($mail_subject,$file_name,$content,$singed_uri);
|
||||
}
|
||||
}
|
||||
|
||||
public static function subGenerator($core_details)
|
||||
{
|
||||
|
||||
@ -83,6 +83,7 @@ class satellite_image
|
||||
else if($pd_type == 2) //save satellite img as base64 in sale pd doc table
|
||||
{
|
||||
$satellite_base64 = base64_encode(file_get_contents($satellite_image_png_path));
|
||||
$CI->Sales_PD_Model->updateRecords(array('isactive' => 0),SALEPD_DOCS,array('img_name' => 'satellite'));
|
||||
$CI->Sales_PD_Model->saveRecords(array('img' => $satellite_base64,'img_name' => 'satellite','fk_sales_pd_id' => $pdid),SALEPD_DOCS);
|
||||
}
|
||||
//generate log
|
||||
|
||||
@ -28,7 +28,8 @@ class Common_Masters_Model extends SPARQ_Model {
|
||||
return $master_data;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
|
||||
$order = $master_tables_field_names[$table_constant];
|
||||
$master_data = $this->db->SELECT('*')->FROM(constant($table_constant))->ORDER_BY('is_others')->ORDER_BY($order)->GET()->result_array();
|
||||
return $master_data;
|
||||
|
||||
@ -352,6 +352,10 @@ class PD_Model extends SPARQ_Model {
|
||||
);
|
||||
return $this->getJoinRecords($fields,$table,$joins,$where_condition_array);
|
||||
}
|
||||
else
|
||||
{
|
||||
return array();
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -805,7 +805,8 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
|
||||
<!-- ########################### Score Card Section ############################################### -->
|
||||
<?php
|
||||
//print_r($pd_score);die();
|
||||
//print_r($pd_score);
|
||||
die();
|
||||
$address_type_remarks_caption = array('well_suited' => 'well suited','fairly_suited' => 'fairly suited','not_suited' => 'not suited');
|
||||
//die();
|
||||
if( isset($pd_score) && count($pd_score))
|
||||
@ -3793,7 +3794,7 @@ if($total_no_of_business > 0) {
|
||||
<?php
|
||||
//print_r($otherAssetResult);die();
|
||||
if($is_personal_info_available != null){ ?>
|
||||
<table class="scorecard_table">
|
||||
<table class="scorecard_table_resonal_assest">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Sr.No</th>
|
||||
@ -4029,18 +4030,31 @@ if($total_no_of_business > 0) {
|
||||
foreach($pd_processed_forms[8] as $rowKey=> $elRow) {
|
||||
$otherLoanRow = json_decode($elRow['processed_json'],true);
|
||||
$existing_loan_form_common_remarks = $otherLoanRow['currentloan_remarks'];
|
||||
$is_all_loan_details_availble = 'yes';
|
||||
$out_standing_loan_info = array();
|
||||
if(array_key_exists('loan_info_available',$otherLoanRow))
|
||||
{
|
||||
$is_all_loan_details_availble = $otherLoanRow['loan_info_available'];
|
||||
|
||||
}
|
||||
$total_no_of_data = 0;
|
||||
if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){
|
||||
if(strtoupper($otherLoanRow['existing_loan'])=='YES' && (!strcasecmp($is_all_loan_details_availble,'yes') && count($otherLoanRow['loan_details'])>0)){
|
||||
$is_existing_loans_available = 1;
|
||||
$total_no_of_data = count($otherLoanRow['loan_details']);
|
||||
$existLoanResult=FINANCIALFORM::getOtherLoanDetails($otherLoanRow['loan_details'],$pd_master_details[0]['pd_id']);
|
||||
}
|
||||
else if(!strcasecmp($is_all_loan_details_availble,'no'))
|
||||
{
|
||||
$out_standing_loan_info['tot_running_loans'] = $otherLoanRow['tot_running_loans'];
|
||||
$out_standing_loan_info['tot_emi_paid'] = $otherLoanRow['tot_emi_paid'];
|
||||
$out_standing_loan_info['tot_outstanding_loans'] = $otherLoanRow['tot_outstanding_loans'];
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
<br>
|
||||
<h3 contenteditable="true">Existing loan obligation</h3>
|
||||
<?php if($is_existing_loans_available != null){
|
||||
<?php if($is_existing_loans_available != null && (!strcasecmp($is_all_loan_details_availble,'yes'))){
|
||||
//print_r($existLoanResult);
|
||||
|
||||
?>
|
||||
@ -4082,6 +4096,17 @@ if($total_no_of_business > 0) {
|
||||
<br>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
elseif (!strcasecmp($is_all_loan_details_availble,'no') && ($out_standing_loan_info['tot_running_loans']))
|
||||
{
|
||||
?>
|
||||
The table below lists the details of Existing Loan Obligations of the Loan Applicants.
|
||||
<table class="scorecard_table"><thead><tr>
|
||||
<th>Total No of Running Loans</th><th>Total Outstanding Amount</th><th>Total EMI being Paid (Monthly)</th></tr></thead><tbody>
|
||||
<tr> <td class="customtd"><?php echo $out_standing_loan_info['tot_running_loans'] ?></td> <td class="customtd"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($out_standing_loan_info['tot_outstanding_loans']) ?></td> <td class="customtd"><?php echo $rupee_symbol.' '.MYUTIL::customIndianNumberFormat($out_standing_loan_info['tot_emi_paid']) ?></td> </tr>
|
||||
</tbody></table>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {?>
|
||||
<p>As per loan applicant he does not have any existing loan obligations.</p>
|
||||
|
||||
@ -73,6 +73,37 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
border: 1px solid black;
|
||||
border-collapse: collapse;
|
||||
}
|
||||
/* #########Score Card for personal assest section table getting overlapped ######### */
|
||||
|
||||
.scorecard_table_resonal_assest {
|
||||
/* font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;*/
|
||||
/*font-family: Merriweather;*/
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
|
||||
}
|
||||
|
||||
.scorecard_table_resonal_assest td, .scorecard_table_resonal_assest th {
|
||||
border: 1px solid #000;
|
||||
padding: 8px;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
.scorecard_table_resonal_assest tr:nth-child(even){background-color: #f2f2f2; }
|
||||
|
||||
.scorecard_table_resonal_assest tr:hover {background-color: #ddd;}
|
||||
|
||||
.scorecard_table_resonal_assest th {
|
||||
padding-top: 8px;
|
||||
padding-bottom: 8px;
|
||||
text-align: center;
|
||||
background-color: #0191ed;
|
||||
color: white;
|
||||
|
||||
}
|
||||
/* #########End of Score Card Table Styles######### */
|
||||
|
||||
/* ######### Mini Score Card Table Styles######### */
|
||||
|
||||
@ -1452,6 +1483,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
$is_existing_loans_available = null;
|
||||
foreach($pd_processed_forms[8] as $rowKey=> $elRow) {
|
||||
$otherLoanRow = json_decode($elRow['processed_json'],true);
|
||||
//print_r($otherLoanRow);die();
|
||||
$existing_loan_form_common_remarks = $otherLoanRow['currentloan_remarks'];
|
||||
$total_no_of_data = 0;
|
||||
if(strtoupper($otherLoanRow['existing_loan'])=='YES' && count($otherLoanRow['loan_details'])>0){
|
||||
@ -1464,41 +1496,50 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
?>
|
||||
<br>
|
||||
<h3 contenteditable="true">Existing loan obligation</h3>
|
||||
<?php if($is_existing_loans_available != null){
|
||||
//print_r($existLoanResult);
|
||||
<?php
|
||||
if($is_existing_loans_available != null){
|
||||
//print_r($existLoanResult);die();
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
The table below lists the details of Existing Loan Obligations of the Loan Applicants.
|
||||
<table class="scorecard_table">
|
||||
<thead>
|
||||
<br><br>
|
||||
<?php
|
||||
$pre_loan_no = 0;
|
||||
foreach($existLoanResult as $table_key => $single_table){
|
||||
//print_r($single_table);die();
|
||||
?>
|
||||
<table class="scorecard_table_resonal_assest" >
|
||||
<!-- <thead> -->
|
||||
<tr>
|
||||
<th>Particulars</th>
|
||||
<?php for($header = 1;$header <= $existLoanResult['total_header']; $header++ ) {echo "<th>Loan $header</th>";}?>
|
||||
<?php for($header = 1;$header <= $single_table['total_header']; $header++ )
|
||||
{ $pre_loan_no++; echo "<th>Loan $pre_loan_no</th>"; } ?>
|
||||
</tr>
|
||||
</thead>
|
||||
<!-- </thead> -->
|
||||
<tbody>
|
||||
<?php
|
||||
echo $existLoanResult['first_row'];
|
||||
echo $existLoanResult['second_row'];
|
||||
echo $single_table['first_row'];
|
||||
echo $single_table['second_row'];
|
||||
//echo $existLoanResult['third_row'];
|
||||
echo $existLoanResult['fourth_row'];
|
||||
echo $existLoanResult['fifth_row'];
|
||||
echo $existLoanResult['sixth_row'];
|
||||
echo $existLoanResult['seventh_row'];
|
||||
echo $existLoanResult['eigth_row'];
|
||||
echo $existLoanResult['ninth_row'];
|
||||
echo $existLoanResult['tenth_row'];
|
||||
echo $single_table['fourth_row'];
|
||||
echo $single_table['fifth_row'];
|
||||
echo $single_table['sixth_row'];
|
||||
echo $single_table['seventh_row'];
|
||||
echo $single_table['eigth_row'];
|
||||
echo $single_table['ninth_row'];
|
||||
echo $single_table['tenth_row'];
|
||||
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<?php
|
||||
//
|
||||
}
|
||||
}
|
||||
}
|
||||
else {?>
|
||||
<p>As per loan applicant he does not have any existing loan obligations.</p>
|
||||
<?php } ?>
|
||||
|
||||
@ -61,6 +61,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
page-break-inside: inline;
|
||||
|
||||
}
|
||||
|
||||
.scorecard_table td, .scorecard_table th {
|
||||
@ -164,7 +165,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
<table class="scorecard_table">
|
||||
<table class="scorecard_table" style="table-layout: fixed">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="thlargefont" colspan="10">Details of Key Stakeholders in the Business</th>
|
||||
@ -200,7 +201,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
|
||||
<th class="thlargefont" colspan="10" >Brief of the Business / Service</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="10" style="text-align: justify;"><?php echo $section4['brief_business_service']?></td>
|
||||
<td colspan="10" style="text-align: justify;word-wrap:break-word;table-layout:fixed;"><?php echo $section4['brief_business_service']?></td>
|
||||
</tr>
|
||||
<!-- <tr></tr><tr></tr><tr></tr> -->
|
||||
</tbody></table>
|
||||
@ -380,8 +381,7 @@ if(isset($section6))
|
||||
<table class="scorecard_table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th class="thlargefont" colspan="10"> Property Information</th>
|
||||
</tr>
|
||||
<th class="thlargefont" colspan="10"> Property Information</th></tr>
|
||||
<?php foreach($section6 as $property_key => $property_value) {
|
||||
|
||||
echo '<tr><th colspan="10"> Property '.($property_key + 1).'</th></tr>';
|
||||
@ -398,10 +398,10 @@ if(isset($section6))
|
||||
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['occupancy_status']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" >Permitted Property Usage</td>
|
||||
<td colspan="1">Permitted Property Usage</td>
|
||||
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['permitted_property_usage']?></td>
|
||||
<td colspan="1" >Actual Property Usage</td>
|
||||
<td class="tdcenteralign" colspan="4" ><?php echo $property_value['actual_property_usage']?></td>
|
||||
<td class="tdcenteralign" colspan="4"><?php echo $property_value['actual_property_usage']?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="1" >Built-Up Area</td>
|
||||
@ -414,7 +414,7 @@ if(isset($section6))
|
||||
<td class="tdcenteralign" colspan="9"><?php echo $property_value['Property_Ownership_Status']?></td>
|
||||
</tr>
|
||||
<?php
|
||||
echo '<br>';
|
||||
//echo '<br>';
|
||||
}?>
|
||||
</tbody>
|
||||
</table>
|
||||
@ -436,7 +436,7 @@ if(isset($section6))
|
||||
<td colspan="4" >Overall Assessment (Positive / Negative)</td>
|
||||
<td class="tdcenteralign" <?php if($section7['overall_assessment'] == 'Positive') { echo 'style="color:green;"';}else{ echo 'style="color:red;"';} ?> ><?php echo $section7['overall_assessment']?></td>
|
||||
<td colspan="4" >Recommended ROI for the case</td>
|
||||
<td class="tdcenteralign" ><?php echo $section7['recommended_roi']?></td>
|
||||
<td class="tdcenteralign" ><?php echo $section7['recommended_roi'].' %'?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" >Any Other remarks </td>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user