diff --git a/api/application/config/routes.php b/api/application/config/routes.php index cb6f9534..72040b61 100644 --- a/api/application/config/routes.php +++ b/api/application/config/routes.php @@ -266,4 +266,5 @@ $route['listSalesPD/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD'; $route['saveSalesPDImage'] = 'Sales_PD_Controller/saveSalesPDImage'; $route['saveSalesPDsection'] = 'Sales_PD_Controller/saveSalesPDsection'; $route['getSalesPDSectionData'] = 'Sales_PD_Controller/getSalesPDSectionData'; +$route['testAPISalesPD'] = 'Sales_PD_Controller/testAPISalesPD'; diff --git a/api/application/controllers/PD_Controller.php b/api/application/controllers/PD_Controller.php index 815f7d80..9b3c5fbb 100644 --- a/api/application/controllers/PD_Controller.php +++ b/api/application/controllers/PD_Controller.php @@ -5791,10 +5791,10 @@ public function getPDFormDetailsJSON_post() public function codeigniterViewTest_post() { //print_r($this->aws_s3->createNewBucket('len3'));die(); - //satellite_image::getSatelliteImage(886);die(); + //satellite_image::getSatelliteImage(2,2);die(); //echo $this->assignPDTempalate(1325);die(); //$this->getSatelliteImage(342);die();//velmurugan.s@venbainfotech.com - //PDALERTS::pdnotification(1483);die(); +// PDALERTS::sendSalesPDMail($this,2);die(); //$this->load->helper('applicantname_grabber'); // print_r(APPLICANTNAME_GRABBER::getLatestApplicantsName(1390));die(); //satellite_image::getSatelliteImage(1442);die(); diff --git a/api/application/controllers/Sales_PD_Controller.php b/api/application/controllers/Sales_PD_Controller.php index 6ce5a315..66751347 100644 --- a/api/application/controllers/Sales_PD_Controller.php +++ b/api/application/controllers/Sales_PD_Controller.php @@ -867,6 +867,11 @@ class Sales_PD_Controller extends REST_Controller { } } + + public function testAPISalesPD_post() + { + PDALERTS::sendSalesPDMail($this,2);die(); + } } diff --git a/api/application/helpers/getprocessedjson_helper.php b/api/application/helpers/getprocessedjson_helper.php index e32f4e7c..56f71262 100644 --- a/api/application/helpers/getprocessedjson_helper.php +++ b/api/application/helpers/getprocessedjson_helper.php @@ -2649,7 +2649,7 @@ class GETPROCESSEDJSON if(isset($records['bonus_frequency']) && $records['bonus_frequency'] != "") { - $cr = $CI->PD_Model->selectCustomRecords(array('*'),array('frequency_id' =>$records['designation_person_met'] ),FREQUENCY); + $cr = $CI->PD_Model->selectCustomRecords(array('*'),array('frequency_id' =>$records['bonus_frequency'] ),FREQUENCY); if($cr) { $records['bonus_frequency_master'] = $cr[0]['name']; diff --git a/api/application/helpers/pdalerts_helper.php b/api/application/helpers/pdalerts_helper.php index 5f96adb7..8d2450d9 100644 --- a/api/application/helpers/pdalerts_helper.php +++ b/api/application/helpers/pdalerts_helper.php @@ -520,7 +520,9 @@ class PDALERTS if(ENVIRONMENT == 'production') { $mail_id = 'cpa@smcfinance.com'; - $mail->addBCC("neville@sinemanagement.com"); + $mail->addBCC("neville@sinemanagement.com"); + $mail->addBCC("ssa@venbainfotech.com"); + //$mail->addBCC("vitvelz@gmail.com"); } // Name is optional } $mail->addAddress($mail_id); @@ -532,15 +534,17 @@ class PDALERTS $mail->Body = $mail_contents[2]; $mail->AltBody = $mail_contents[2]; $mail->addStringAttachment(file_get_contents($mail_contents[3]), $mail_contents[1]); - + //print_r($mail); //$logger = MYLOG::logFunction(null,$core_details[0]['pd_id']); if(!$mail->send()) { //$logger->error("Mailer Error:" ,array($mail->ErrorInfo)); + //echo 'not send'; log_message('ERROR','SALESPD MAIL NOT SEND'.$mail_contents[1]); } else { //$logger->info("Mailer Send:" ,array('mail_ID' => $lender_email,'Status' => 'SEND')); //echo 'DONE'; + //echo 'send'; log_message('ERROR','SALESPD MAIL SEND'.$mail_contents[1]); } } diff --git a/api/application/helpers/satellite_image_helper.php b/api/application/helpers/satellite_image_helper.php index b338882d..bc89fd34 100644 --- a/api/application/helpers/satellite_image_helper.php +++ b/api/application/helpers/satellite_image_helper.php @@ -6,6 +6,7 @@ class satellite_image public static function getSatelliteImage($pd_id,$pd_type = 1)//1 - credit PD,2 - sales pd { $pdid = $pd_id; + $CI =&get_instance(); $path_to_check = $pd_type == 1 ? $CI->external_path.'/pd_reports/'.$pdid : $CI->external_path.'/sales_pd/'.$pdid; $geo_location = null; @@ -82,8 +83,9 @@ 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->updateRecords(array('isactive' => 0),SALEPD_DOCS,array('img_name' => 'satellite','fk_sales_pd_id' => $pd_id)); $CI->Sales_PD_Model->saveRecords(array('img' => $satellite_base64,'img_name' => 'satellite','fk_sales_pd_id' => $pdid),SALEPD_DOCS); } //generate log diff --git a/api/application/views/report_templates/JSONTOREPORT_SAL.php b/api/application/views/report_templates/JSONTOREPORT_SAL.php index 0ebe3a83..bd17038f 100644 --- a/api/application/views/report_templates/JSONTOREPORT_SAL.php +++ b/api/application/views/report_templates/JSONTOREPORT_SAL.php @@ -1132,7 +1132,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); 'both bank and cash','bank_transfer' => 'bank transfer'); + $salary_mode_text = array('both_bank_transfer_cash' => 'both bank and cash','bank_transfer' => 'bank transfer','paid_in_cash' => 'cash'); if(isset($pd_processed_forms[12])) { $employeement_data = json_decode($pd_processed_forms[12][0]['processed_json'],true); @@ -1144,7 +1144,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); echo "

Employer Name : ". explode('-', $employeement_data['employer_name'])[1] ."

" ; echo "

Company Profile : ". $employeement_data['employer_in_brief'] ."

" ; - echo "

The applicant has served ". $employeement_data['how_long_year'] ." Years ".($employeement_data['how_long_month'] ? ' and '.$employeement_data['how_long_month'].' months' : '' )." as employee in this firm." ; + echo "

The applicant has served ". $employeement_data['how_long_year'] ." Years ".($employeement_data['how_long_month'] ? ' and '.$employeement_data['how_long_month'].' months' : '' )." as employee in this firm / company. " ; echo "Applicant has total work experience of ". $employeement_data['how_long_month']." years.

"; @@ -1177,18 +1177,20 @@ defined('BASEPATH') OR exit('No direct script access allowed'); // echo "entire salary is paid as bank transfer."; // } - echo "

Applicant gets monthly gross salary of". $rupee_symbol." ". MYUTIL::customIndianNumberFormat($employeement_data['gross_monthly_salary'])." and net monthly salary of ".$rupee_symbol."". MYUTIL::customIndianNumberFormat($employeement_data['net_monthly_salary'])."

"; + echo "

Applicant gets monthly gross salary of ". $rupee_symbol." ". MYUTIL::customIndianNumberFormat($employeement_data['gross_monthly_salary'])." and net monthly salary of ".$rupee_symbol." ". MYUTIL::customIndianNumberFormat($employeement_data['net_monthly_salary'])."

"; echo $employeement_data['check_validated'] == "not validated" ? "

The salary amount was not validated during visit because ".$employeement_data['why_was_it_not_validated']."

": "

The salary amount was validated during visit ".$employeement_data['how_was_it_validated']."

"; - echo $employeement_data['any_delays'] == 'Yes' ? '

As per person met, sometimes there is delay in salary payment.

' : '

Generally there is no delay in salary payment.

'; + echo $employeement_data['any_delays'] == 'yes' ? '

As per person met, sometimes there is delay in salary payment.

' : '

Generally, there is no delay in salary payment.

'; echo $employeement_data['bonus_incentive'] ? "

The applicant receives a bonus ( ".($employeement_data['bonus_type'] == 'others' ? $employeement_data['bonus_type_other']: $employeement_data['bonus_type']).") of ".$rupee_symbol." ".MYUTIL::customIndianNumberFormat($employeement_data['bonus_incentive'])." ".$employeement_data['bonus_frequency_master'].'.

': '

Applicant does not get any Bonus amount or Incentives.

'; - echo "

".$employeement_data['id_card_issued_company'] == 'yes' ? '

ID card issued by employer was seen by PD officer and same is available in zipped file enclosed with report.

': '

ID card issued by employer was not seen because,'.$employeement_data['why_company_id_proof_not_available'].'

'; + echo $employeement_data['id_card_issued_company'] == 'yes' ? '

ID card issued by employer was seen by PD officer and same is available in zipped file enclosed with report.

' : '

ID card issued by employer was not seen because, '.$employeement_data['why_company_id_proof_not_available'].'

'; //echo "
***********************************"; + + echo $employeement_data['employment_remarks'] != "" ? "

".$employeement_data['employment_remarks']."

": ""; }