diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 9c0cba1e..47a78fdc 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5859,7 +5859,7 @@ public function getPDFormDetailsJSON_post() public function codeigniterViewTest_post() { - //print_r($this->aws_s3->createNewBucket('len3'));die(); + //print_r($this->aws_s3->createNewBucket('xmldatatest007'));die(); //satellite_image::getSatelliteImage(1213);die(); //echo $this->assignPDTempalate(1325);die(); //$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com @@ -5870,6 +5870,13 @@ public function getPDFormDetailsJSON_post() // $this->load->helper('push_notification'); // PUSH_NOTIFICATION::notifyWeb("fJJeUjCWSSs:APA91bHJIHVBJ4KuBbz5sEQSTXG171KpUyraekuejPedkCVrFrULvh8R8JmIHZlovA3QJogr007Yv6IN0Bhja_oBScMBFS2MAWAyPOWLDwsY-OeoPbOx8vzNalvJ7yt0jcB_atJcTbAD","The New PD 255 has been triggered...",array());die(); // print_r($this->db->error());die(); + //$s3result= $this->aws_s3->uploadFileToS3Bucket(array('bucket_name' =>'xmldatatest007' ,'key' => 'packages/tourone.xml','sourcefile' => 'C:\xampp\htdocs\XMLTOARRAY\mydata.xml',));die(); + //$singed_uri = $this->aws_s3->getSingleObjectInaBucketAsSignedURI('xmldatatest007','packages/tourone.xml','+1 minutes'); + //echo $singed_uri; + // $new = simplexml_load_string(file_get_contents($singed_uri)); + // $con = json_decode(json_encode($new),true); + // print_r($con) ; + // die(); set_time_limit(60); $records = $this->post('records'); $pdid = $records['pd_id']; @@ -6124,9 +6131,9 @@ public function getPDFormDetailsJSON_post() $t = $this->load->view('report_templates/JSONTOREPORT_DI_AI_ADDON',$data,true); } //$t = $this->load->view('temp_html.html',null,true); - echo $t; + //echo $t; - die(); + //die(); $total_replaces = substr_count($t,''); for($i = 0 ;$i < $total_replaces;$i++) @@ -6142,7 +6149,7 @@ public function getPDFormDetailsJSON_post() $t = substr_replace($t,'',strpos($t,''),(strlen(''))); } - //echo $t; + //echo $t;die(); //$t = file_get_contents($this->external_path ."/pd_reports/" . $pdid . "/sample.html"); // $start_pos = strpos($t,''); @@ -6308,7 +6315,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } } // $company_list = array( array('company_order_id' => 1)); - //print_r($company_list); + //print_r($company_list);die(); $form_array = array(); if($ai_flag == 0) // DI case @@ -6369,6 +6376,8 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() $this->db->WHERE('PDFORMDETAILSJSON.company_id',$company['company_order_id']); $this->db->WHERE('PDFORMDETAILSJSON.isactive',1); $template_forms_count = $this->db->GET()->result_array(); + print_r($this->db->last_query());die(); + } else { @@ -7157,6 +7166,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() { + log_message('ERROR','###PDIMAGE saveBase64Images function called'.$pd_id.' - '.$form_id); $count = 0; $result = array(); $pks = array(); @@ -7183,11 +7193,12 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() } $temp_file_name = $randomString.date('Y-m-d-H-i-s').'.jpeg'; - + log_message('ERROR','###PDIMAGE writing started'.$pd_id.' - '.$form_id); $ifp = fopen( $output_file, 'wb' ); $temp_data = explode( ',', $temp_base64_string ); fwrite( $ifp, base64_decode( $temp_data[ 1 ] ) ); fclose( $ifp ); + log_message('ERROR','###PDIMAGE writing done'.$pd_id.' - '.$form_id); // // ################### start img water marking with text @@ -7217,7 +7228,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() // imagejpeg($curret_file,$output_file,100);// save png image in specified location // //###########end of image water marking with logo - + log_message('ERROR','###PDIMAGE uploading to S3'.$pd_id.' - '.$form_id); $tempdoc = $output_file; $tempdocname = $temp_file_name; $bucketname = LENDER_BUCKET_NAME_PREFIX.$pd_details[0]['fk_lender_id']; @@ -7233,6 +7244,7 @@ public function getCompaniesListsFromGeneralFormRawJSON_post() if(is_object($s3result) && $s3result['ObjectURL'] != '' && $s3result['@metadata']['statusCode'] == 200) { + log_message('ERROR','###PDIMAGE stored in S3'.$pd_id.' - '.$form_id); $record_data = array('fk_pd_id' => $pd_id,'pd_document_title'=>$title,'pd_document_name'=>$tempdocname,'fk_form_id'=>$form_id,'is_show_report' =>$is_show_report,'rental_count_id' => $rental_count_id,'location' => $doc['link'],'co_applicant_id' => $co_applicant_id,'img_type' => $img_type); $record_data['company_id'] = $company_id ? $company_id : null; $id = $this->PD_Model->saveRecords($record_data,PDDOCUMENTS); diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 9ea8a46d..5c8753f3 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -212,8 +212,8 @@ class Sales_PD_Controller extends REST_Controller { //End of PDF Gen using DOM PDF $output_file = $this->external_path ."/sales_pd/" . $sales_pd_id . "/temp.pdf"; $bytes = file_put_contents($output_file, $pdf_doc); - // echo $bytes; - // die(); + // echo $bytes; + // die(); $bucket_data = array('bucket_name'=>$bucket_name,'key'=>$key,'sourcefile'=>$this->external_path.'/sales_pd/'.$sales_pd_id.'/temp.pdf'); log_message('ERROR','####SALES PD REPORT UPLOAD TO S3'.$sales_pd_id); $s3result= $this->aws_s3->uploadFileToS3Bucket($bucket_data); @@ -591,7 +591,7 @@ class Sales_PD_Controller extends REST_Controller { $this->prepareSalesPDReport($records['sales_pd_id'],false); sleep(10); - log_message('ERROR','####SALESPD AFTER 10 PREPARED REPORT'.$sales_pd_id); + log_message('ERROR','####SALESPD AFTER 10 PREPARED REPORT'.$records['sales_pd_id']); //echo 'afetr 10'; //trigger mail function PDALERTS::sendSalesPDMail($this,$records['sales_pd_id']); diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 6c5fd495..fcaac30a 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -524,7 +524,7 @@ class PDALERTS public static function sendSalesPDMail($CI,$salespd_id) { - log_message('ERROR','####SALESPD MAIL CALLED'.$sales_pd_id); + log_message('ERROR','####SALESPD MAIL CALLED'.$salespd_id); $mail = $CI->phpmailer_library->load(); $mail_contents = SELF::salesPDMailContentGrabber($CI,$salespd_id); //echo "$msg"; diff --git a/api/application/helpers/push_notification_helper.php b/api/application/helpers/push_notification_helper.php index a7f3a8b8..6b0f5653 100644 --- a/api/application/helpers/push_notification_helper.php +++ b/api/application/helpers/push_notification_helper.php @@ -27,7 +27,7 @@ class PUSH_NOTIFICATION $web_msg = array ( - 'title'=> $additional_data['to_whom'] .' - '. $additional_data['pd_status'], + 'title'=> 'Hi, '.$additional_data['to_whom'] .' - PD was '. $additional_data['pd_status'], 'body'=> $msg, 'icon' => 'https://pdgenie.com/logo/sinelogo.png', 'img' => 'https://pdgenie.com/logo/sinelogo.png' @@ -43,7 +43,8 @@ class PUSH_NOTIFICATION $app_msg = array ( 'message'=> $msg, - 'title'=> $additional_data['pd_status'], + 'body'=> $msg, + 'title'=> $msg, 'subtitle'=> $msg, 'tickerText'=> $msg, 'vibrate'=>1, diff --git a/api/application/models/PD_Model.php b/api/application/models/PD_Model.php index 3af895ae..45e1eca6 100644 --- a/api/application/models/PD_Model.php +++ b/api/application/models/PD_Model.php @@ -1889,6 +1889,12 @@ class PD_Model extends SPARQ_Model { function getLenderContactPersons($lender_id,$pd_branch_id) { + + // check CLIX group - this script for is lender is whether clix or clix housing, then have to bring both lender contact persons, otherwise pull contact persons belongs to single entity + $is_lenderid_clix_group = ENVIRONMENT == 'production' && ($lender_id == 5 || $lender_id == 9) ? true : (($lender_id == 16 || $lender_id == 38) ? true : false); + $clix = ENVIRONMENT == 'production' ? 5 : 16;$clixhousing = ENVIRONMENT == 'production' ? 9 : 38; + // check CLIX group + $this->db->select('USERPROFILE.userid, concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as user_name,USERPROFILE.fk_entity_id,USERPROFILE.fk_city,USERPROFILEROLES.user_role,USERPROFILE.fk_entity_type_id,ROLES.role_name,if( POSITION("credit" IN ROLES.role_name),"CREDIT","SALES") as role_type'); $this->db->from(USERPROFILE.' as USERPROFILE'); //$this->db->join(ENTITYLENDERBRANCH.' as ENTITYLENDERBRANCH',"USERPROFILE.fk_entity_id = ENTITYLENDERBRANCH.fk_entity_id and ENTITYLENDERBRANCH.isactive = 1 and ENTITYLENDERBRANCH.fk_city_id = USERPROFILE.fk_city and ENTITYLENDERBRANCH.entity_lender_branch_id = $pd_branch_id"); @@ -1898,14 +1904,23 @@ class PD_Model extends SPARQ_Model { $this->db->join(USERPROFILEROLES. ' as USERPROFILEROLES','USERPROFILEROLES.fk_userid = USERPROFILE.userid and USERPROFILEROLES.isactive =1'); $this->db->join(ROLES.' as ROLES','ROLES.role_id = USERPROFILEROLES.user_role'); //$this->db->where('USERPROFILE.fk_city',$pd_branch_id); - $this->db->where('USERPROFILE.fk_entity_id',$lender_id); + if(!$is_lenderid_clix_group) + { + $this->db->where('USERPROFILE.fk_entity_id',$lender_id); + } + else + { + $this->db->where('USERPROFILE.fk_entity_id',$clix); + $this->db->or_where('USERPROFILE.fk_entity_id',$clixhousing); + } + if($pd_branch_id) { - $this->db->where('USERPROFILE.fk_lender_branch_id',$pd_branch_id); + //$this->db->where('USERPROFILE.fk_lender_branch_id',$pd_branch_id); } $this->db->where('USERPROFILE.isactive',1); $result = $this->db->get()->result_array(); - //print_r($this->db->last_query()); + // print_r($this->db->last_query()); return $result; } diff --git a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php index d8c1c80e..145542b2 100644 --- a/api/application/views/report_templates/JSONTOREPORT_DI_AI.php +++ b/api/application/views/report_templates/JSONTOREPORT_DI_AI.php @@ -1120,9 +1120,9 @@ if ( isset($pdf) ) { 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. 'Address Form - Type of Address of the loan applicants. '; - echo 'The '.$address_type.'Address Form - Type of Address is '.$property_owner_type.'Business Assest Form - Owner of the Property and the business has been in operation from here for the last '.$yrs_being_run.'Business Assest Form - Business running Yrs in this premise .'; - echo '

The '.$address_type.'Address Form - Type of Address is located in '.$locality.'Address Form - Locality of Address '.($estimated_area != 0? 'and the estimated area of the '.$address_type.'Address Form - Type of Address is '.$estimated_area.'Address Form - Estimated Area .' : ''); + echo 'The PD visit was done at '. $address_type. 'Address Form - Type of Address of the loan applicants.'; + echo 'The '.$address_type.'Address Form - Type of Address is '.$property_owner_type.'Business Assest Form - Owner of the Property and the business has been in operation from here for the last '.$yrs_being_run.'Business Assest Form - Business running Yrs in this premise .'; + echo '

The '.$address_type.'Address Form - Type of Address is located in '.$locality.'Address Form - Locality of Address '.($estimated_area != 0? 'and the estimated area of the '.$address_type.'Address Form - Type of Address is '.$estimated_area.'Address Form - Estimated Area .' : ''); echo '

The PD location was '. $pd_address['pd_location_master'].'Address Form - Approach to PD location . ' . 'As Per PD Officer, the '.$address_type .'Address Form - Type of Address is situated in '.$comment_locality_master .'Address Form - Comment on locality Locality.'; echo '

The PD officer also made the following observations:' ; echo '

    '; @@ -2941,7 +2941,7 @@ if($total_no_of_business > 0) { - $supplier_fourth_row .= $raw['person_stdcode'] && $raw['person_landline'] ? ''. $raw['person_stdcode'].' '.$raw['person_landline'].'' : ''.'Not Provided'.''; + $supplier_fourth_row .= $raw['person_stdcode'] && $raw['person_landline'] ? ''. $raw['person_stdcode'].' '.$raw['person_landline'].'' : ''.'Not Provided'.''; diff --git a/api/index.php b/api/index.php index 8a50586d..5cecb88b 100644 --- a/api/index.php +++ b/api/index.php @@ -72,9 +72,8 @@ } else if(isset($_SERVER['HTTP_HOST']) && !strcasecmp($_SERVER['HTTP_HOST'],'localhost') && isset($_SERVER['REQUEST_URI']) && substr_count($_SERVER['REQUEST_URI'], 'sparqapi') == 1) { - define('ENVIRONMENT','testing'); + define('ENVIRONMENT','testing'); define('XLPATH',$_SERVER['DOCUMENT_ROOT'].'/ssa_external_data/'.ENVIRONMENT); - } else {