Redirect email filtering : ps
This commit is contained in:
parent
7248e4aed5
commit
482445a5ae
@ -298,6 +298,7 @@ $route['(downloadSalesPDReport/:any)'] = 'Sales_PD_Controller/getSalesPDReport';
|
||||
$route['listSalesPD/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||
$route['listSalesPD/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||
$route['listSalesPD/(:any)/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||
$route['listSalesPD/(:any)/(:any)/(:any)/(:any)'] = 'Sales_PD_Controller/listSalesPD';
|
||||
$route['saveSalesPDImage'] = 'Sales_PD_Controller/saveSalesPDImage';
|
||||
$route['saveSalesPDsection'] = 'Sales_PD_Controller/saveSalesPDsection';
|
||||
$route['getSalesPDSectionData'] = 'Sales_PD_Controller/getSalesPDSectionData';
|
||||
|
||||
@ -558,6 +558,9 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
$lender_id = $this->uri->segment(2);
|
||||
$user_id = $this->uri->segment(3);
|
||||
$role = $this->uri->segment(4);
|
||||
$redirect_email = base64_decode($this->uri->segment(5)); # becoz email can't able to send in url. so encoded
|
||||
// echo base64_decode($redirect_email);
|
||||
|
||||
$columns = array('SALES_PD_DATA.sales_pd_id','SALES_PD_DATA.sales_pd_sno','SALES_PD_DATA.applicant_name','concat(USERPROFILE.first_name," ",USERPROFILE.last_name) as officer_name','SALES_PD_DATA.applicant_id','SALES_PD_DATA.lender_id','SALES_PD_DATA.product_id','SALES_PD_DATA.is_pdf','SALES_PD_DATA.is_edited','ENTITY.short_name','PRODUCT.abbr','SALES_PD_DATA.status','SALES_PD_DATA.sales_pd_type','SALES_PD_DATA.rand_string','SALES_PD_DATA.isactive','SALES_PD_DATA.city_id','CITY.name as city_name',
|
||||
'(CASE WHEN SALES_PD_DATA.status = "STARTED" THEN SALES_PD_DATA.createdon WHEN SALES_PD_DATA.status = "COMPLETED" THEN SALES_PD_DATA.completed_date ELSE NULL END) AS createdon'
|
||||
// ,"DATE_FORMAT(SALES_PD_DATA.createdon,'%Y-%m-%d') as modify","DATE_ADD(CURDATE(),INTERVAL '-10' DAY) as currd",
|
||||
@ -607,10 +610,19 @@ class Sales_PD_Controller extends REST_Controller {
|
||||
{
|
||||
$where_condition_array['SALES_PD_DATA.createdby'] = $user_id;
|
||||
}
|
||||
else if($user_id && is_string($user_id)){
|
||||
# here $user_id is numeric means createdby else redirect_email.becoz sales auto-login
|
||||
$where_condition_array['SALES_PD_DATA.redirect_email'] = base64_decode($user_id);
|
||||
}
|
||||
|
||||
if(!empty($redirect_email)){
|
||||
$or_where['SALES_PD_DATA.redirect_email'] = $redirect_email;
|
||||
}
|
||||
|
||||
}
|
||||
$order_by = 'SALES_PD_DATA.sales_pd_id';
|
||||
$sales_pd_data = $this->Sales_PD_Model->getJoinRecords($columns,$table,$joins,$where_condition_array,$order_by,'DESC','',$or_where);
|
||||
// print_r($sales_pd_data);
|
||||
// print_r($sales_pd_data);
|
||||
// print_r($this->db->last_query());die();
|
||||
|
||||
if(count($sales_pd_data))
|
||||
@ -1878,8 +1890,8 @@ public function filterSalesPDList_post() {
|
||||
$user_where_condition['email like'] = '%' . $usersemailid . '%';
|
||||
}
|
||||
$user_details = $this->Sales_PD_Model->getJoinRecords($columns, $table, $joins, $user_where_condition, $order_by, 'DESC', '', $or_where);
|
||||
$user_id = $user_details[0]['userid'];
|
||||
$role_id = $user_details[0]['role_id'];
|
||||
$user_id = !empty($user_details) ? $user_details[0]['userid'] : null ;
|
||||
$role_id = !empty($user_details) ? $user_details[0]['role_id'] : 19 ;
|
||||
$createdby = $user_id;
|
||||
if($applicantid != null && (!empty($applicantid))){
|
||||
$where_condition = array("applicant_id"=>$applicantid);
|
||||
@ -1908,7 +1920,10 @@ public function filterSalesPDList_post() {
|
||||
$salepd_serial_no .= '-' . (++$count[0]['count']);
|
||||
log_message('ERROR', '## 1) random string : ' . $randomString . ' serial No : ' . $salepd_serial_no);
|
||||
/*************Inserting Here ******************/
|
||||
$records = array("sales_pd_sno" => $salepd_serial_no, "rand_string" => $randomString, "lender_id" => $lenderid, "product_id" => $product_id, "sales_pd_type" => $sales_pd_type, "applicant_id" => $applicantid, "applicant_name" => $applicantname, "createdby" => $createdby, "isactive" => 1);
|
||||
$records = array("sales_pd_sno" => $salepd_serial_no, "rand_string" => $randomString, "lender_id" => $lenderid, "product_id" => $product_id, "sales_pd_type" => $sales_pd_type, "applicant_id" => $applicantid, "applicant_name" => $applicantname, "isactive" => 1);
|
||||
if($user_id != null){ $records["createdby"] = $createdby; }
|
||||
else{ $records["redirect_email"] = $usersemailid; }
|
||||
|
||||
$id = $this->Sales_PD_Model->saveRecords($records, SALES_PD_DATA);
|
||||
$salepdid = $id;
|
||||
// $id = 775; // 772,773,777,778
|
||||
@ -2036,10 +2051,10 @@ public function filterSalesPDList_post() {
|
||||
log_message('ERROR', '## 8) Redirect B4 '.$auth_user_id."#".$auth_password."#".$user_id."#".$role_id."#".$current_date."#".$usersemailid."#".$salepdid);
|
||||
// MwiseSales@yahoo.com#sine1234#293#19#06/07/2023 16:02:57#mwisesales1@sine.com#904
|
||||
// https://demo.pdgenie.com/salespdpwa/#/auto?token=TXdpc2VTYWxlc0B5YWhvby5jb20jc2luZTEyMzQjMjkzIzE5IzA2LzA3LzIwMjMgMTY6MDI6NTcjbXdpc2VzYWxlczFAc2luZS5jb20jOTA0
|
||||
// echo $redirect_uri;
|
||||
// die();
|
||||
echo $redirect_uri;
|
||||
die();
|
||||
log_message('ERROR', '## 9) Redirect Aftr `' . $redirect_uri . '`');
|
||||
header("Location: " . $redirect_uri);
|
||||
// header("Location: " . $redirect_uri);
|
||||
// $this->response($data,REST_Controller::HTTP_OK);
|
||||
//if($data['dataStatus']){ header("Location: https://sidharthindustries.com/SIA/"); }
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user