Merge branch 'master' of https://bitbucket.org/venbaittech/sparqapi
This commit is contained in:
commit
a86be1652c
@ -153,7 +153,7 @@ else if(ENVIRONMENT == 'production')
|
||||
defined('PDF_ATTACHEMENT_URL') OR define('PDF_ATTACHEMENT_URL','https://api.pdgenie.com/sparqprod/api/short?dat=');
|
||||
defined('GOOGLE_DISTANCE_MATRIX_API_KEY') OR define('GOOGLE_DISTANCE_MATRIX_API_KEY',getenv('GOOGLE_DISTANCE_MATRIX_API_KEY'));
|
||||
defined('OPTIMIZED_IMAGE_BUCKET_NAME') OR define('OPTIMIZED_IMAGE_BUCKET_NAME','optimized-images-live');
|
||||
defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://wlaax92nne.execute-api.ap-south-1.amazonaws.com/demo');
|
||||
defined('IMAGE_OPTIMIZE_LAMBDA_URL') OR define('IMAGE_OPTIMIZE_LAMBDA_URL','https://4u9t03hvfb.execute-api.ap-south-1.amazonaws.com/live');
|
||||
}
|
||||
|
||||
/*********************END of AWS resources Constants*************************************************/
|
||||
|
||||
@ -20,7 +20,7 @@ class PD_Controller extends REST_Controller {
|
||||
|
||||
//class level variable declaration
|
||||
//protected $external_path;
|
||||
private $photo_names = array('selfie_with_person_met' => array('Person met','18',0,0),'person_met_id' => array('Person met ID Proof','18',0,0),'address_proof_visited' => array('Address Proof','5',0,0),'name_board_seen' => array('Name Board Seen','13',0,0),'machinery_image' => array('Machinery Image','22',0,0),'gst_Regn_cert_pic' => array('GST Regn Cert','13',0,0),'pf_regn_pic' => array('PF Regn','13',0,0),'esic_regn_pic' => array('ESIC Regn','13',0,0),'export_import_cert_pic' => array('Export Import Cert','13',0,0),'factory_cert_pic' => array('Factory Cert','13',0,0),'shop_eat_act_cert_pic' => array('Shop Est Act Cert','13',0,0),'eb_bill_pic' => array('EB Bill','13',0,0),'practice_cert_pic' => array('Cert of Practice','13',0,0),'fire_noc_pic' => array('Fire NOC','13',0,0),'stock_image' => array('Stock image','11',1,1),'client_image' => array('Client Bills','2',1,1),'supplier_image' => array('Supplier Bills','1',1,1),'office_setup' => array('Office/Business Setup','13',1,1));
|
||||
private $photo_names = array('selfie_with_person_met' => array('Person met','18',0,0),'person_met_id' => array('Person met ID Proof','18',0,0),'address_proof_visited' => array('Address Proof','5',0,0),'name_board_seen' => array('Name Board Seen','13',0,0),'machinery_image' => array('Machinery Image','22',0,0),'gst_Regn_cert_pic' => array('GST Regn Cert','13',0,0),'pf_regn_pic' => array('PF Regn','13',0,0),'esic_regn_pic' => array('ESIC Regn','13',0,0),'export_import_cert_pic' => array('Export Import Cert','13',0,0),'factory_cert_pic' => array('Factory Cert','13',0,0),'shop_eat_act_cert_pic' => array('Shop Est Act Cert','13',0,0),'eb_bill_pic' => array('EB Bill','13',0,0),'practice_cert_pic' => array('Cert of Practice','13',0,0),'fire_noc_pic' => array('Fire NOC','13',0,0),'stock_image' => array('Stock image','11',1,1),'client_image' => array('Client Bills','2',1,1),'supplier_image' => array('Supplier Bills','1',1,1),'office_setup' => array('Office/Business Setup','13',1,1),'additional_photos' => array('Additional Photographs','13',1,1));
|
||||
private $existing_imges = array();
|
||||
|
||||
function __construct()
|
||||
|
||||
@ -61,21 +61,21 @@ class satellite_image
|
||||
$geo_location = preg_replace('/\s+/', '', $geo_location);
|
||||
$url = "https://maps.googleapis.com/maps/api/staticmap?center=".$geo_location."&zoom=14&markers=color:red|".$geo_location."&size=800x300&maptype=roadmap&key=".$google_map_static_api_key;
|
||||
//echo $url;
|
||||
$ou = file_put_contents($path_to_check.'/satellite.png', file_get_contents($url));
|
||||
$ou = file_put_contents($path_to_check.'/satellite.jpeg', file_get_contents($url));
|
||||
$satellite_script = $url;
|
||||
//echo $url;
|
||||
|
||||
|
||||
// //convert as base 64 image.
|
||||
$satellite_image_png_path = $path_to_check.'/satellite.png';
|
||||
$satellite_image_png_path = $path_to_check.'/satellite.jpeg';
|
||||
//echo 'all done';
|
||||
//die();
|
||||
if($pd_type == 1 )
|
||||
{
|
||||
|
||||
$bucketname = LENDER_BUCKET_NAME_PREFIX.$pdmas[0]['fk_lender_id'];
|
||||
$key = 'pd'.$pdid.'/'.'satellite.png';
|
||||
$bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$CI->external_path.'/pd_reports/'.$pdid.'/satellite.png');
|
||||
$key = 'pd'.$pdid.'/'.'satellite.jpeg';
|
||||
$bucket_data = array('bucket_name'=>$bucketname,'key'=>$key,'sourcefile'=>$CI->external_path.'/pd_reports/'.$pdid.'/satellite.jpeg');
|
||||
|
||||
$s3result= $CI->aws_s3->uploadFileToS3Bucket($bucket_data);
|
||||
|
||||
@ -83,7 +83,7 @@ class satellite_image
|
||||
{
|
||||
|
||||
$CI->PD_Model->updateRecords(array('isactive' => 0),PDDOCUMENTS,array('pd_document_title' => 'satellite','fk_pd_id' => $pd_id));
|
||||
$record_data = array('fk_pd_id' => $pdid,'pd_document_title'=>'satellite','pd_document_name'=>'satellite.png','fk_form_id'=>null,'rental_count_id' => null,'location' => null);
|
||||
$record_data = array('fk_pd_id' => $pdid,'pd_document_title'=>'satellite','pd_document_name'=>'satellite.jpeg','fk_form_id'=>null,'rental_count_id' => null,'location' => null);
|
||||
$id = $CI->PD_Model->saveRecords($record_data,PDDOCUMENTS);
|
||||
$api_return = $id;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user