Entity distmatrix : ps

This commit is contained in:
sanjeev.p 2021-08-31 19:29:31 +05:30
parent ab92661c2f
commit a6fef218da
11 changed files with 30 additions and 22 deletions

View File

@ -5007,11 +5007,12 @@ public function getPDFormDetailsJSON_post()
$pd_type = $data['pd_master_details'][0]['fk_pd_type'] == 3 ? 3 : 1;
$data['lender_disclaimer'] = $this->PD_Model->selectRecords(ENTITYDISCLAIMER,array('fk_entity_id' => ($data['pd_master_details'][0]['sub_entity_id'] ? $data['pd_master_details'][0]['sub_entity_id'] : $data['pd_master_details'][0]['fk_lender_id']),'fk_pd_type' => $pd_type));
//}
if($data['pd_master_details'][0]['lender_short_name'] == 'CSLFL'){
$entity_geo_location = $this->PD_Model->getEntityAddr($data['pd_master_details'][0]['fk_lender_id']);
$entity_geo_location = $this->PD_Model->getEntityAddr($data['pd_master_details'][0]['fk_lender_id']);
print_r($entity_geo_location);die();
if($entity_geo_location != 0){
$pd_location = $data['pd_master_details'][0]['start_location'];
$data['distances'] = satellite_image::getdistancematrix($entity_geo_location,$pd_location);
}
}else{ $data['distances'] = ""; }
//$data['lender_disclaimer'] = $this->PD_Model->selectRecords(ENTITYDISCLAIMER,array('fk_entity_id' => $data['pd_master_details'][0]['fk_lender_id']));
$data['applicants_details'] = $this->PD_Model->getApplicantsDetails($pdid);
$data['pd_additional_requirements'] = $this->PD_Model->getPDAdditionalRequirements($pdid);
@ -6272,11 +6273,11 @@ public function getPDFormDetailsJSON_post()
// {
// echo 'NOR';
// print_r($data['pd_master_details']);die();
if($data['pd_master_details'][0]['lender_short_name'] == 'CSLFL'){
$entity_geo_location = $this->PD_Model->getEntityAddr($data['pd_master_details'][0]['fk_lender_id']);
$entity_geo_location = $this->PD_Model->getEntityAddr($data['pd_master_details'][0]['fk_lender_id']);
if($entity_geo_location != 0){
$pd_location = $data['pd_master_details'][0]['start_location'];
$data['distances'] = satellite_image::getdistancematrix($entity_geo_location,$pd_location);
}
}else{ $data['distances'] = ""; }
$pd_type = $data['pd_master_details'][0]['fk_pd_type'] == 3 ? 3 : 1;
$data['lender_disclaimer'] = $this->PD_Model->selectRecords(ENTITYDISCLAIMER,array('fk_entity_id' => ($data['pd_master_details'][0]['sub_entity_id'] ? $data['pd_master_details'][0]['sub_entity_id'] : $data['pd_master_details'][0]['fk_lender_id']),'fk_pd_type' => $pd_type));
//}

View File

@ -2255,16 +2255,23 @@ class PD_Model extends SPARQ_Model {
}
function getEntityAddr($Eid){
$this->db->select('geo_loc');
$this->db->from(ENTITYBILLING.' as ENTITYBILLING');
$this->db->where('fk_entity_id',$Eid);
$this->db->select('is_dist_cal_enabled');
$this->db->from(ENTITY.' as ENTITY');
$this->db->where('entity_id',$Eid);
$this->db->where('isactive',1);
$this->db->where('is_dist_cal_enable',1);
$query = $this->db->get();
if ($query->num_rows() > 0) {
$result = $query->row()->geo_loc;
if ($query->num_rows() > 0 && $query->row()->is_dist_cal_enabled == 1 ) {
$this->db->select('geo_loc');
$this->db->from(ENTITYBILLING.' as ENTITYBILLING');
$this->db->where('fk_entity_id',$Eid);
$this->db->where('isactive',1);
$this->db->where('is_dist_cal_enabled',1);
$query = $this->db->get();
if ($query->num_rows() > 0) {
$result = $query->row()->geo_loc;
}else{ $result = 0; }
}else{ $result = 0; }
return $result;
return $result;
}
// SELECT as full_address FROM sineedgedemo.m_entity_billing where fk_entity_id = 43 and isactive = 1 and is_dist_cal_enable = 1;

View File

@ -1056,7 +1056,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -1062,7 +1062,7 @@ font-weight: bolder;;
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -1080,7 +1080,7 @@ if ( isset($pdf) ) {
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -1304,7 +1304,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -1073,7 +1073,7 @@ if ( isset($pdf) ) {
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -851,7 +851,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -851,7 +851,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -854,7 +854,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];

View File

@ -861,7 +861,7 @@ font-weight: bolder;;
echo '<b>PD Location Address : </b>'.$pd_address['address'].', '.$pd_address['city_master'].', '.$pd_address['state_master'].' - '.$pincode.'.';
}
if($pd_master_details[0]['lender_short_name'] == 'CSLFL'){
if(!empty($distances['distance'])){
echo '<br><br><b> Distance to PD location : </b>'.$distances['distance'];
}
echo '<br><br><b> GPS Coordinates of location where PD Visit was done : </b>'.$pd_master_details[0]['start_location'];