Compare commits
No commits in common. "9e68ef8f833a1dc7fe43f5a2c1ca826e1e2a5d0f" and "ffaa98cb0043f8c4db43946224abbb786e6cea9d" have entirely different histories.
9e68ef8f83
...
ffaa98cb00
3
.env
3
.env
@ -73,7 +73,8 @@ database.default.port = 3306
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
whatsAppToken = 'EAARGyzEtu2kBO1mK3ILZAvZCd8D3QNpHo2uU5SWZBXbZC3eNL9hFpZA5WebolazilZA0RfU0zdu6gNZAW1yGCYiXFgZBC1YQfZBErv0QKAYQAT9wMOTy2f0C3m4ZAK8ZCwt3mGlURfa6m2uUCyNK4qEUy2Evx7scd8aanXLFr8MJUbVNJP8BPPSpUJW4A0dZAaci56lrPGnw0hV7jV9ISGmDLNYZD';
|
WAAI_INSTANCE = '66712908EB75A'
|
||||||
|
WAAI_TOKEN = '667128c844c48'
|
||||||
|
|
||||||
|
|
||||||
API_KEY = 'HgvlULWCIrs'; // Your API key
|
API_KEY = 'HgvlULWCIrs'; // Your API key
|
||||||
|
|||||||
@ -76,8 +76,6 @@ use CodeIgniter\Router\RouteCollection;
|
|||||||
$routes->get('client_docs_histroy/(:any)','MasterController::client_docs_histroy/$1');
|
$routes->get('client_docs_histroy/(:any)','MasterController::client_docs_histroy/$1');
|
||||||
$routes->match(['get','post'],'/change_doc_status','MasterController::change_doc_status');
|
$routes->match(['get','post'],'/change_doc_status','MasterController::change_doc_status');
|
||||||
$routes->match(['get','post'],'/rememeber_notification','MasterController::rememeber_notification');
|
$routes->match(['get','post'],'/rememeber_notification','MasterController::rememeber_notification');
|
||||||
$routes->match(['get','post'],'/createSharedLink','MasterController::createSharedLink');
|
|
||||||
$routes->match(['get','post'],'/delete_doc','MasterController::delete_doc');
|
|
||||||
$routes->match(['get','post'],'/test','MasterController::test');
|
$routes->match(['get','post'],'/test','MasterController::test');
|
||||||
$routes->post('doc_generate_otp','MasterController::doc_generate_otp');
|
$routes->post('doc_generate_otp','MasterController::doc_generate_otp');
|
||||||
$routes->post('doc_verify_otp','MasterController::doc_verify_otp');
|
$routes->post('doc_verify_otp','MasterController::doc_verify_otp');
|
||||||
|
|||||||
@ -176,9 +176,8 @@ class BusinessController extends BaseController
|
|||||||
$mail_config = $this->request->getPost();
|
$mail_config = $this->request->getPost();
|
||||||
$r_mail = $this->request->getPost('r_email');
|
$r_mail = $this->request->getPost('r_email');
|
||||||
$MailHelper = new MailHelper();
|
$MailHelper = new MailHelper();
|
||||||
$mail_check_status = $MailHelper->check_mail_config($r_mail, $mail_config);
|
print_r($MailHelper->check_mail_config($r_mail, $mail_config));die;
|
||||||
|
|
||||||
return $mail_check_status;
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
return $this->respond(['status' => 'failed','code' => 500,'data' => $exception],500);
|
return $this->respond(['status' => 'failed','code' => 500,'data' => $exception],500);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -161,7 +161,8 @@ class ClientController extends BaseController
|
|||||||
$message = 'Login OTP is: ' . $otp;
|
$message = 'Login OTP is: ' . $otp;
|
||||||
if($client_branch_data['whatsapp'] == 1){
|
if($client_branch_data['whatsapp'] == 1){
|
||||||
try {
|
try {
|
||||||
|
$notificationHelper->sendWhatsAppMessage($number, $message);
|
||||||
|
// return $this->respond(['success' => true, 'otp' => $otp]);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return $this->respond(['Error' => $e->getMessage()]);
|
return $this->respond(['Error' => $e->getMessage()]);
|
||||||
}
|
}
|
||||||
@ -261,7 +262,7 @@ class ClientController extends BaseController
|
|||||||
public function client_branch_list()
|
public function client_branch_list()
|
||||||
{
|
{
|
||||||
// if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); }
|
// if(!$this->session->has('is_staff_logged_in')){ return redirect()->to(base_url().'staff'); }
|
||||||
$data['clientBranchList'] = $this->ClientBranchModel->select('client_branch.*, client.name as client_name, client.mobile_no as client_mobile_no,client.email as client_email')
|
$data['clientBranchList'] = $this->ClientBranchModel->select('client_branch.*, client.name as client_name, client.mobile_no as client_mobile_no')
|
||||||
->join('client', 'client.client_id = client_branch.client_id', 'left')
|
->join('client', 'client.client_id = client_branch.client_id', 'left')
|
||||||
->findAll();
|
->findAll();
|
||||||
|
|
||||||
|
|||||||
@ -529,14 +529,14 @@ class MasterController extends BaseController
|
|||||||
}else if($this->session->has('is_client_logged_in')){
|
}else if($this->session->has('is_client_logged_in')){
|
||||||
$userData = $this->ClientBranchModel->where('id',$this->session->get('is_client_logged_in'))->get()->getRow();
|
$userData = $this->ClientBranchModel->where('id',$this->session->get('is_client_logged_in'))->get()->getRow();
|
||||||
}
|
}
|
||||||
|
// dd();
|
||||||
$doc_id = $this->request->getVar('doc_id');
|
$doc_id = $this->request->getVar('doc_id');
|
||||||
if(!empty($this->request->getVar('view_from')) && $this->request->getVar('view_from') == 'client'){
|
if(!empty($this->request->getVar('view_from')) && $this->request->getVar('view_from') == 'client'){
|
||||||
$data['docData'] = $this->ClientDocsModel->clientDocPreview($doc_id);
|
$data['docData'] = $this->ClientDocsModel->clientDocPreview($doc_id);
|
||||||
}else{
|
}else{
|
||||||
$data['docData'] = $this->ClientDocsModel->docPreview($doc_id);
|
$data['docData'] = $this->ClientDocsModel->docPreview($doc_id);
|
||||||
}
|
}
|
||||||
|
// dd($data['docData']);
|
||||||
$data['clientData'] = $this->ClientBranchModel->select('client.name , client.pan_no ,
|
$data['clientData'] = $this->ClientBranchModel->select('client.name , client.pan_no ,
|
||||||
client_branch.gst_no , client_branch.mobile_no ,
|
client_branch.gst_no , client_branch.mobile_no ,
|
||||||
client_branch.email , client_branch.address ,
|
client_branch.email , client_branch.address ,
|
||||||
@ -546,15 +546,13 @@ class MasterController extends BaseController
|
|||||||
->where('client_branch.id',$data['docData']->client_branch_id)
|
->where('client_branch.id',$data['docData']->client_branch_id)
|
||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
if($data['clientData']->individual == 1){
|
if($data['clientData']->individual == 1){
|
||||||
$clientData = $this->ClientBranchModel->select('client.email , client.mobile_no')
|
$data['clientData'] = $this->ClientBranchModel->select('client.name , client.pan_no ,
|
||||||
|
client.mobile_no ,
|
||||||
|
client.email , client.individual')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
->where('client_branch.id',$data['docData']->client_branch_id)
|
->where('client_branch.id',$data['docData']->client_branch_id)
|
||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
$data['clientData']->email = $clientData->email;
|
|
||||||
$data['clientData']->mobile_no = $clientData->mobile_no;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$data['header_html'] = $data['docData']->header_html;
|
$data['header_html'] = $data['docData']->header_html;
|
||||||
$data['footer_html'] = $data['docData']->footer_html;
|
$data['footer_html'] = $data['docData']->footer_html;
|
||||||
$data['body_html'] = $data['docData']->body_html;
|
$data['body_html'] = $data['docData']->body_html;
|
||||||
@ -573,8 +571,6 @@ class MasterController extends BaseController
|
|||||||
$placeHolder = '%'.$key.'%';
|
$placeHolder = '%'.$key.'%';
|
||||||
$data['body_html'] = str_replace($placeHolder,$value,$data['body_html']);
|
$data['body_html'] = str_replace($placeHolder,$value,$data['body_html']);
|
||||||
}
|
}
|
||||||
$data['business_list'] = $this->BusinessModel->findAll();
|
|
||||||
|
|
||||||
echo view('layout/header', ['Data'=>$userData]);
|
echo view('layout/header', ['Data'=>$userData]);
|
||||||
echo view('client_docs_preview',$data);
|
echo view('client_docs_preview',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
@ -665,48 +661,44 @@ class MasterController extends BaseController
|
|||||||
public function change_doc_status()
|
public function change_doc_status()
|
||||||
{
|
{
|
||||||
|
|
||||||
try {
|
// try {
|
||||||
|
|
||||||
$doc_id = $this->request->getPost('doc_id');
|
$doc_id = $this->request->getPost('doc_id');
|
||||||
$is_active = $this->request->getPost('is_active');
|
$is_active = $this->request->getPost('is_active');
|
||||||
$data['is_active'] = $is_active;
|
$data['is_active'] = $is_active;
|
||||||
$MailHelper = new MailHelper();
|
|
||||||
$notificationHelper = new NotificationHelper();
|
|
||||||
if($is_active == 1){
|
if($is_active == 1){
|
||||||
$DateAndYears = $this->dateAndYearPlaceholder();
|
$DateAndYears = $this->dateAndYearPlaceholder();
|
||||||
$data['place_holder_object'] = $DateAndYears;
|
$data['place_holder_object'] = $DateAndYears;
|
||||||
|
$MailHelper = new MailHelper();
|
||||||
|
|
||||||
|
|
||||||
//get Client Data
|
$clientData = $this->ClientDocsModel->select('client.name as client_name, client_branch.email, client_branch.*')
|
||||||
$clientData = $this->ClientDocsModel->select('client.name as client_name,
|
|
||||||
client.email as client_email,
|
|
||||||
client_branch.email as client_branch_email,
|
|
||||||
client.mobile_no as client_mobile_no,
|
|
||||||
client_branch.mobile_no as client_branch_mobile_no,
|
|
||||||
client.individual as individual,
|
|
||||||
client_branch.whatsapp as whatsapp,
|
|
||||||
client_branch.sms as sms,')
|
|
||||||
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
->where('client_docs.id', $doc_id)->get()->getRow();
|
->where('client_docs.id', $doc_id)->get()->getRow();
|
||||||
|
|
||||||
if($clientData->individual == 1){
|
if($clientData->individual == 1){
|
||||||
$client_mail_id = $clientData->client_email;
|
$clientData = $this->ClientDocsModel->select('client.name as client_name, client.*, client_branch.sms, client_branch.whatsapp')
|
||||||
$client_mobile_no = $clientData->client_mobile_no;
|
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
||||||
}else{
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
$client_mail_id = $clientData->client_branch_email;
|
->where('client_docs.id', $doc_id)->get()->getRow();
|
||||||
$client_mobile_no = $clientData->client_branch_mobile_no;
|
|
||||||
}
|
}
|
||||||
|
$documentUrl = base_url();
|
||||||
|
// helper('url');
|
||||||
|
|
||||||
|
$url ='<a href="' . generate_signed_url('preview', ['doc_id'=> md5((string)$doc_id)], 36000) . '">Preview and Approve Document</a>';
|
||||||
|
// $businessData = $this->BranchModel->select('branches.* , business.business_name ')
|
||||||
//get Business and mail confic data
|
// ->join('business', 'branches.business_id = business.business_id', 'left')
|
||||||
|
// ->where('branches.branch_id',$this->session->get('logged_in_staff_branch_id'))
|
||||||
|
// ->get()->getRow();
|
||||||
$businessData = $this->BusinessModel->select('branches.* , business.business_name ,business.smtp_host, business.smtp_user, business.smtp_pass, business.smtp_port, business.email as business_mail')
|
$businessData = $this->BusinessModel->select('branches.* , business.business_name ,business.smtp_host, business.smtp_user, business.smtp_pass, business.smtp_port, business.email as business_mail')
|
||||||
->join('branches', 'business.business_id = branches.business_id', 'left')
|
->join('branches', 'business.business_id = branches.business_id', 'left')
|
||||||
->where('business.business_id',$this->session->get('logged_in_staff_business_id'))
|
->where('business.business_id',$this->session->get('logged_in_staff_business_id'))
|
||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
|
$subject = 'BB-Sign Verify Document';
|
||||||
|
// print_r($businessData);die;
|
||||||
|
$message = "Dear " . $clientData->client_name . ",<br>" . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve.<br><br>" . $url;
|
||||||
|
// print_r($clientData->email);die;
|
||||||
$mail_config = [
|
$mail_config = [
|
||||||
'protocol' => 'smtp',
|
|
||||||
'mailType' => 'html',
|
|
||||||
'SMTPHost' => $businessData->smtp_host,
|
'SMTPHost' => $businessData->smtp_host,
|
||||||
'SMTPUser' => $businessData->smtp_user,
|
'SMTPUser' => $businessData->smtp_user,
|
||||||
'SMTPPass' => $businessData->smtp_pass,
|
'SMTPPass' => $businessData->smtp_pass,
|
||||||
@ -714,47 +706,19 @@ class MasterController extends BaseController
|
|||||||
'sender_email' => $businessData->business_mail,
|
'sender_email' => $businessData->business_mail,
|
||||||
'sender_name' => $businessData->business_name
|
'sender_name' => $businessData->business_name
|
||||||
];
|
];
|
||||||
|
$MailHelper->send_url_email($clientData->email , '', $subject, $message, $mail_config);
|
||||||
|
$notificationHelper = new NotificationHelper();
|
||||||
// send mail
|
$number ='91'. $clientData->mobile_no; // Replace with dynamic recipient number
|
||||||
$subject = 'Verify Document';
|
|
||||||
$url = generate_signed_url('preview', ['doc_id'=> md5((string)$doc_id)], 259200);
|
|
||||||
$message = "Dear " . $clientData->client_name . ",<br>" . $businessData->business_name . " has requested your approval for a document. Please click the button below to preview and approve.<br><br>";
|
|
||||||
$html = view('email_templates',['message'=>$message,'url'=>$url]);
|
|
||||||
|
|
||||||
$mail_status = $MailHelper->send_url_email($client_mail_id , '', $subject, $html, $mail_config);
|
|
||||||
|
|
||||||
|
|
||||||
//send whatsapp message
|
|
||||||
$number ='91'. $client_mobile_no;
|
|
||||||
if($clientData->whatsapp == 1){
|
if($clientData->whatsapp == 1){
|
||||||
$result = $notificationHelper->send_whatsapp_message($number, $clientData->client_name , $businessData->business_name , $url);
|
$whatsApp_message = "Dear " . substr($clientData->client_name, 0, 20) . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
||||||
if ($result['status_code'] == 200) {
|
// $notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
||||||
//echo 'Message sent successfully';
|
|
||||||
} else {
|
|
||||||
// echo 'Failed to send message. Status Code: ' . $result['status_code'];
|
|
||||||
// print_r($result['response']);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//create history data for documet sharing
|
|
||||||
$statusData['client_docs_id'] = $doc_id;
|
$statusData['client_docs_id'] = $doc_id;
|
||||||
$statusData['is_staff'] = 1;
|
$statusData['is_staff'] = 1;
|
||||||
$statusData['created_by'] = $this->session->get('is_staff_logged_in');
|
$statusData['created_by'] = $this->session->get('is_staff_logged_in');
|
||||||
$statusData['status'] = 'Shared';
|
$statusData['status'] = 'Shared';
|
||||||
$this->DocsStatusModel->insert($statusData);
|
$this->DocsStatusModel->insert($statusData);
|
||||||
|
|
||||||
|
|
||||||
//create history data for mail sending status
|
|
||||||
$statusData['note'] = $client_mail_id;
|
|
||||||
if($mail_status['status'] == 'success'){ $statusData['status'] = 'Mail Success';
|
|
||||||
}else{ $statusData['status'] = 'Mail Failed'; }
|
|
||||||
$this->DocsStatusModel->insert($statusData);
|
|
||||||
|
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$statusData['client_docs_id'] = $doc_id;
|
$statusData['client_docs_id'] = $doc_id;
|
||||||
$statusData['is_staff'] = 1;
|
$statusData['is_staff'] = 1;
|
||||||
@ -765,18 +729,14 @@ class MasterController extends BaseController
|
|||||||
|
|
||||||
$updated = $this->ClientDocsModel->update($doc_id, $data);
|
$updated = $this->ClientDocsModel->update($doc_id, $data);
|
||||||
if ($updated) {
|
if ($updated) {
|
||||||
if($is_active == 1){
|
return $this->response->setJSON(['status' => 'success','code' => 200,'data' => true],200);
|
||||||
return $this->response->setJSON(['status' => 'success','code' => 200,'data' => "Document Shared",'mail_status'=>$mail_status['status'],'mail'=>$client_mail_id ],200);
|
|
||||||
}else{
|
|
||||||
return $this->response->setJSON(['status' => 'success','code' => 200,'data' => "Document Reverted"],200);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$result = "No Match's";
|
$result = "No Match's";
|
||||||
return $this->response->setJSON(['status' => 'failed','code' => 404,'data' => $result],404);
|
return $this->response->setJSON(['status' => 'failed','code' => 404,'data' => $result],404);
|
||||||
}
|
}
|
||||||
} catch (\Exception $exception) {
|
// } catch (\Exception $exception) {
|
||||||
return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500);
|
// return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500);
|
||||||
}
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
public function rememeber_notification()
|
public function rememeber_notification()
|
||||||
@ -785,36 +745,31 @@ class MasterController extends BaseController
|
|||||||
$doc_id = $this->request->getPost('doc_id');
|
$doc_id = $this->request->getPost('doc_id');
|
||||||
$MailHelper = new MailHelper();
|
$MailHelper = new MailHelper();
|
||||||
|
|
||||||
//get Client Data
|
$clientData = $this->ClientDocsModel->select('client.name as client_name, client_branch.email, client_branch.mobile_no, client_branch.whatsapp, client.individual, client_docs.business_id')
|
||||||
$clientData = $this->ClientDocsModel->select('client.name as client_name,
|
|
||||||
client.email as client_email,
|
|
||||||
client_branch.email as client_branch_email,
|
|
||||||
client.mobile_no as client_mobile_no,
|
|
||||||
client_branch.mobile_no as client_branch_mobile_no,
|
|
||||||
client.individual as individual,
|
|
||||||
client_branch.whatsapp as whatsapp,
|
|
||||||
client_branch.sms as sms,
|
|
||||||
client_docs.business_id')
|
|
||||||
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
->where('client_docs.id', $doc_id)->get()->getRow();
|
->where('client_docs.id', $doc_id)->get()->getRow();
|
||||||
if($clientData->individual == 1){
|
if($clientData->individual == 1){
|
||||||
$client_mail_id = $clientData->client_email;
|
$clientData = $this->ClientDocsModel->select('client.name as client_name, client.email, client.mobile_no, client_branch.whatsapp, client.individual, client_docs.business_id')
|
||||||
$client_mobile_no = $clientData->client_mobile_no;
|
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
||||||
}else{
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
$client_mail_id = $clientData->client_branch_email;
|
->where('client_docs.id', $doc_id)->get()->getRow();
|
||||||
$client_mobile_no = $clientData->client_branch_mobile_no;
|
|
||||||
}
|
}
|
||||||
|
// helper('url');
|
||||||
|
$url ='<a href="' . generate_signed_url('preview', ['doc_id'=>md5((string)$doc_id)], 36000) . '">Preview and Approve Document</a>';
|
||||||
//get Business and mail confic data
|
// $businessData = $this->BranchModel->select('branches.* , business.business_name ')
|
||||||
|
// ->join('business', 'branches.business_id = business.business_id', 'left')
|
||||||
|
// ->where('branches.branch_id',$this->session->get('logged_in_staff_branch_id'))
|
||||||
|
// ->get()->getRow();
|
||||||
$businessData = $this->BusinessModel->select('business.*')
|
$businessData = $this->BusinessModel->select('business.*')
|
||||||
// ->where('business.business_id',$this->session->get('logged_in_staff_business_id'))
|
// ->where('business.business_id',$this->session->get('logged_in_staff_business_id'))
|
||||||
->where('business_id', $clientData->business_id)
|
->where('business_id', $clientData->business_id)
|
||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
|
// print_r($businessData);die;
|
||||||
|
$subject = 'BB-Sign Verify Document';
|
||||||
|
$message = "Dear " . $clientData->client_name . ",<br>" . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve.<br><br>" . $url;
|
||||||
|
|
||||||
$mail_config = [
|
$mail_config = [
|
||||||
'protocol' => 'smtp',
|
|
||||||
'mailType' => 'html',
|
|
||||||
'SMTPHost' => $businessData->smtp_host,
|
'SMTPHost' => $businessData->smtp_host,
|
||||||
'SMTPUser' => $businessData->smtp_user,
|
'SMTPUser' => $businessData->smtp_user,
|
||||||
'SMTPPass' => $businessData->smtp_pass,
|
'SMTPPass' => $businessData->smtp_pass,
|
||||||
@ -822,47 +777,19 @@ class MasterController extends BaseController
|
|||||||
'sender_email' => $businessData->email,
|
'sender_email' => $businessData->email,
|
||||||
'sender_name' => $businessData->business_name
|
'sender_name' => $businessData->business_name
|
||||||
];
|
];
|
||||||
|
// print_r($mail_config);die;
|
||||||
|
|
||||||
// send mail
|
$mail_send = $MailHelper->send_url_email($clientData->email , '', $subject, $message, $mail_config);
|
||||||
$subject = 'Verify Document';
|
if (!$mail_send) {
|
||||||
$url = generate_signed_url('preview', ['doc_id'=> md5((string)$doc_id)], 259200);
|
throw new \Exception('Email sending failed.');
|
||||||
$message = "Dear " . $clientData->client_name . ",<br>" . $businessData->business_name . " has requested your approval for a document. Please click the button below to preview and approve.<br><br>";
|
}
|
||||||
$html = view('email_templates',['message'=>$message,'url'=>$url]);
|
$notificationHelper = new NotificationHelper();
|
||||||
|
$number = '91'.$clientData->mobile_no; // Replace with dynamic recipient number
|
||||||
$mail_status = $MailHelper->send_url_email($client_mail_id , '', $subject, $html, $mail_config);
|
|
||||||
|
|
||||||
|
|
||||||
//send whatsapp message
|
|
||||||
$number ='91'. $client_mobile_no;
|
|
||||||
if($clientData->whatsapp == 1){
|
if($clientData->whatsapp == 1){
|
||||||
|
$whatsApp_message = "Dear " . substr($clientData->client_name, 0, 20) . "," . $businessData->business_name . " has requested your approval for a document. Please click the link below to preview and approve." ;
|
||||||
|
//$notificationHelper->sendWhatsAppMessage($number, $whatsApp_message, $url);
|
||||||
}
|
}
|
||||||
|
return $this->respond(['success' => true, 'data' => 'Remember Send Successfully']);
|
||||||
return $this->response->setJSON(['status' => 'success','code' => 200,'mail_status'=>$mail_status['status'],'mail'=>$client_mail_id ],200);
|
|
||||||
|
|
||||||
} catch (\Exception $exception) {
|
|
||||||
return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createSharedLink()
|
|
||||||
{
|
|
||||||
$doc_id = $this->request->getPost('doc_id');
|
|
||||||
$link = generate_signed_url('preview', ['doc_id'=> md5((string)$doc_id)], 259200);
|
|
||||||
return $this->response->setJSON(['status' => 'success','code' => 200,'link'=>$link ],200);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function delete_doc()
|
|
||||||
{
|
|
||||||
try {
|
|
||||||
$doc_id = $this->request->getPost('doc_id');
|
|
||||||
|
|
||||||
$delete_doc = $this->ClientDocsModel->where('id', $doc_id)->delete();
|
|
||||||
$delete_history = $this->DocsStatusModel->where('client_docs_id', $doc_id)->delete();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return $this->respond(['success' => true, 'data' => 'Doc Deleted SuccessFully']);
|
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500);
|
return $this->response->setJSON(['status' => 'failed','code' => 500,'data' => $exception],500);
|
||||||
}
|
}
|
||||||
@ -872,32 +799,12 @@ class MasterController extends BaseController
|
|||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$mobile_no = $this->request->getPost('mobile_no');
|
$mobile_no = $this->request->getPost('mobile_no');
|
||||||
$doc_id = $this->request->getPost('doc_id');
|
$client_data = $this->ClientBranchModel->where('mobile_no', $mobile_no )->first();
|
||||||
$clientData = $this->ClientDocsModel->select('client.name as client_name,
|
if($client_data){
|
||||||
client.email as client_email,
|
|
||||||
client_branch.email as client_branch_email,
|
|
||||||
client.mobile_no as client_mobile_no,
|
|
||||||
client_branch.mobile_no as client_branch_mobile_no,
|
|
||||||
client.individual as individual,
|
|
||||||
client_branch.whatsapp as whatsapp,
|
|
||||||
client_branch.sms as sms,
|
|
||||||
client_docs.business_id')
|
|
||||||
->join('client_branch', 'client_docs.client_branch_id = client_branch.id', 'left')
|
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
|
||||||
->where('client_docs.id', $doc_id)->get()->getRow();
|
|
||||||
if($clientData->individual == 1){
|
|
||||||
$client_mail_id = $clientData->client_email;
|
|
||||||
$client_mobile_no = $clientData->client_mobile_no;
|
|
||||||
}else{
|
|
||||||
$client_mail_id = $clientData->client_branch_email;
|
|
||||||
$client_mobile_no = $clientData->client_branch_mobile_no;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($clientData) {
|
|
||||||
$id = $this->request->getPost('doc_id');
|
$id = $this->request->getPost('doc_id');
|
||||||
$otp = mt_rand(100000, 999999);
|
$otp = mt_rand(100000, 999999);
|
||||||
$data = ['otp' => $otp];
|
$data = ['otp' => $otp];
|
||||||
$client_full_data = $this->ClientDocsModel->select('client_docs.* , services.service_name , service_group.group_name , client_branch.name as client_branch_name , client.name as client_name')
|
$clint_full_data = $this->ClientDocsModel->select('client_docs.* , services.service_name , service_group.group_name , client_branch.name as client_branch_name , client.name as client_name')
|
||||||
->join('template', 'template.template_id = client_docs.template_id', 'left')
|
->join('template', 'template.template_id = client_docs.template_id', 'left')
|
||||||
->join('services', 'services.service_id = template.service_id', 'left')
|
->join('services', 'services.service_id = template.service_id', 'left')
|
||||||
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
->join('service_group', 'service_group.service_group_id = template.service_group_id', 'left')
|
||||||
@ -910,11 +817,11 @@ class MasterController extends BaseController
|
|||||||
$notificationHelper = new NotificationHelper();
|
$notificationHelper = new NotificationHelper();
|
||||||
$number = '91'.$mobile_no; // Replace with dynamic recipient number
|
$number = '91'.$mobile_no; // Replace with dynamic recipient number
|
||||||
$message = 'Document Verification OTP : ' . $otp;
|
$message = 'Document Verification OTP : ' . $otp;
|
||||||
if($clientData->whatsapp == 1){
|
if($client_data['whatsapp'] == 1){
|
||||||
|
// $notificationHelper->sendWhatsAppMessage($number, $message);
|
||||||
}
|
}
|
||||||
if($clientData->sms == 1){
|
if($client_data['sms'] == 1){
|
||||||
$data = $notificationHelper->sendSms($number, $clientData->client_name , $otp, '', 'doc_verify',$client_full_data);
|
$data = $notificationHelper->sendSms($number, $client_data['name'] , $otp, '', 'doc_verify',$clint_full_data);
|
||||||
}
|
}
|
||||||
return $this->respond(['success' => true]);
|
return $this->respond(['success' => true]);
|
||||||
}
|
}
|
||||||
@ -1015,15 +922,4 @@ class MasterController extends BaseController
|
|||||||
return $this->fail('Invalid request method', 405);
|
return $this->fail('Invalid request method', 405);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function test(){
|
|
||||||
$notificationHelper = new NotificationHelper();
|
|
||||||
$result = $notificationHelper->send_whatsapp_message('919884002190','','','');
|
|
||||||
if ($result['status_code'] == 200) {
|
|
||||||
echo 'Message sent successfully';
|
|
||||||
} else {
|
|
||||||
echo 'Failed to send message. Status Code: ' . $result['status_code'];
|
|
||||||
print_r($result['response']);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -98,12 +98,10 @@ class TestController extends Controller
|
|||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
|
|
||||||
if($data['clientData']->individual == 1){
|
if($data['clientData']->individual == 1){
|
||||||
$clientData = $this->ClientBranchModel->select('client.email , client.mobile_no')
|
$data['clientData'] = $this->ClientBranchModel->select('client.name ,client.individual, client.pan_no, client.mobile_no , client.email ')
|
||||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||||
->where('client_branch.id',$data['docData']->client_branch_id)
|
->where('client_branch.id',$data['docData']->client_branch_id)
|
||||||
->get()->getRow();
|
->get()->getRow();
|
||||||
$data['clientData']->email = $clientData->email;
|
|
||||||
$data['clientData']->mobile_no = $clientData->mobile_no;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -15,14 +15,14 @@ class MailHelper
|
|||||||
try {
|
try {
|
||||||
$email = \Config\Services::email();
|
$email = \Config\Services::email();
|
||||||
|
|
||||||
// $email->initialize([
|
$email->initialize([
|
||||||
// 'protocol' => $config['protocol'],
|
'protocol' => $config['protocol'],
|
||||||
// 'SMTPHost' => $config['SMTPHost'],
|
'SMTPHost' => $config['SMTPHost'],
|
||||||
// 'SMTPUser' => $config['SMTPUser'],
|
'SMTPUser' => $config['SMTPUser'],
|
||||||
// 'SMTPPass' => $config['SMTPPass'],
|
'SMTPPass' => $config['SMTPPass'],
|
||||||
// 'SMTPPort' => $config['SMTPPort'],
|
'SMTPPort' => $config['SMTPPort'],
|
||||||
// // 'mailType' => $config['mailType']
|
// 'mailType' => $config['mailType']
|
||||||
// ]);
|
]);
|
||||||
|
|
||||||
// $email->setFrom($config['sender_email'], $config['sender_name']);/
|
// $email->setFrom($config['sender_email'], $config['sender_name']);/
|
||||||
$email->setMailType('html');
|
$email->setMailType('html');
|
||||||
@ -48,27 +48,41 @@ class MailHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function send_url_email($email_id, $branch_email, $subject, $html, $mail_config = [])
|
public static function send_url_email($email_id, $branch_email, $subject, $message, $mail_config = [])
|
||||||
{
|
{
|
||||||
|
// print_r("helllo");die;
|
||||||
|
|
||||||
// try {
|
// try {
|
||||||
|
$default_config = [
|
||||||
|
'protocol' => 'smtp',
|
||||||
|
'SMTPHost' => 'mail.venbait.in',
|
||||||
|
'SMTPUser' => 'bbone@venbait.in',
|
||||||
|
'SMTPPass' => 'xk!L(N_-R#};',
|
||||||
|
'SMTPPort' => 465,
|
||||||
|
'mailType' => 'html',
|
||||||
|
'sender_email' => 'bbone@venbait.in',
|
||||||
|
'sender_name' => 'BB-Sign'
|
||||||
|
];
|
||||||
|
|
||||||
// Merge default config with provided config
|
// Merge default config with provided config
|
||||||
|
$config = array_merge($default_config, $mail_config);
|
||||||
|
|
||||||
$email = \Config\Services::email();
|
$email = \Config\Services::email();
|
||||||
|
|
||||||
|
|
||||||
$email->initialize([
|
$email->initialize([
|
||||||
'protocol' => $mail_config['protocol'],
|
'protocol' => $config['protocol'],
|
||||||
'SMTPHost' => $mail_config['SMTPHost'],
|
'SMTPHost' => $config['SMTPHost'],
|
||||||
'SMTPUser' => $mail_config['SMTPUser'],
|
'SMTPUser' => $config['SMTPUser'],
|
||||||
'SMTPPass' => $mail_config['SMTPPass'],
|
'SMTPPass' => $config['SMTPPass'],
|
||||||
'SMTPPort' => (int)$mail_config['SMTPPort'],
|
'SMTPPort' => (int)$config['SMTPPort'],
|
||||||
'mailType' => $mail_config['mailType']
|
'mailType' => $config['mailType']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$email->setFrom($mail_config['sender_email'], $mail_config['sender_name']);
|
$email->setFrom($config['sender_email'], $config['sender_name']);
|
||||||
$email->setTo($email_id);
|
$email->setTo($email_id);
|
||||||
$email->setSubject($subject);
|
$email->setSubject($subject);
|
||||||
$email->setMessage($html);
|
$email->setMessage($message);
|
||||||
|
|
||||||
if ($email->send()) {
|
if ($email->send()) {
|
||||||
return ['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $email_id];
|
return ['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $email_id];
|
||||||
@ -85,24 +99,31 @@ class MailHelper
|
|||||||
|
|
||||||
public static function check_mail_config($r_email, $mail_config = [])
|
public static function check_mail_config($r_email, $mail_config = [])
|
||||||
{
|
{
|
||||||
if (empty($mail_config['protocol']) || empty($mail_config['SMTPHost']) ||
|
$default_config = [
|
||||||
empty($mail_config['SMTPUser']) || empty($mail_config['SMTPPass']) ||
|
'protocol' => 'smtp',
|
||||||
empty($mail_config['SMTPPort']) || empty($mail_config['mailType']) ||
|
'SMTPHost' => 'mail.venbait.in',
|
||||||
empty($mail_config['sender_email']) ) {
|
'SMTPUser' => 'bbone@venbait.in',
|
||||||
return json_encode(['status' => 'failed', 'code' => 400, 'message' => 'Incomplete Mail Configuration', 'data' => $r_email]);
|
'SMTPPass' => 'xk!L(N_-R#};',
|
||||||
}
|
'SMTPPort' => 465,
|
||||||
|
'mailType' => 'html',
|
||||||
|
'sender_email' => 'bbone@venbait.in',
|
||||||
|
'sender_name' => 'BB-Sign'
|
||||||
|
];
|
||||||
|
|
||||||
|
// Merge default config with provided config
|
||||||
|
$config = array_merge($default_config, $mail_config);
|
||||||
$email = \Config\Services::email();
|
$email = \Config\Services::email();
|
||||||
|
|
||||||
$email->initialize([
|
$email->initialize([
|
||||||
'protocol' => $mail_config['protocol'],
|
'protocol' => $config['protocol'],
|
||||||
'SMTPHost' => $mail_config['SMTPHost'],
|
'SMTPHost' => $config['SMTPHost'],
|
||||||
'SMTPUser' => $mail_config['SMTPUser'],
|
'SMTPUser' => $config['SMTPUser'],
|
||||||
'SMTPPass' => $mail_config['SMTPPass'],
|
'SMTPPass' => $config['SMTPPass'],
|
||||||
'SMTPPort' => (int)$mail_config['SMTPPort'],
|
'SMTPPort' => (int)$config['SMTPPort'],
|
||||||
'mailType' => $mail_config['mailType']
|
'mailType' => $config['mailType']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$email->setFrom($mail_config['sender_email'], '');
|
$email->setFrom($config['sender_email'], "Sender Name");
|
||||||
$email->setTo($r_email);
|
$email->setTo($r_email);
|
||||||
$email->setSubject("Test Mail Configuration");
|
$email->setSubject("Test Mail Configuration");
|
||||||
$email->setMessage("Test Mail Configuration");
|
$email->setMessage("Test Mail Configuration");
|
||||||
@ -111,11 +132,10 @@ class MailHelper
|
|||||||
return json_encode(['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $r_email]);
|
return json_encode(['status' => 'success', 'code' => 200, 'message' => 'Email Sent Successfully...', 'data' => $r_email]);
|
||||||
} else {
|
} else {
|
||||||
log_message('error', 'Email sending failed: ' . $email->printDebugger(['headers']));
|
log_message('error', 'Email sending failed: ' . $email->printDebugger(['headers']));
|
||||||
return json_encode(['status' => 'failed', 'code' => 404, 'message' => 'Email Sent Failed...', 'data' => $r_email]);
|
return ['status' => 'failed', 'code' => 404, 'message' => 'Email Sent Failed...', 'data' => $r_email];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
namespace App\Helpers;
|
namespace App\Helpers;
|
||||||
use CodeIgniter\API\ResponseTrait;
|
use CodeIgniter\API\ResponseTrait;
|
||||||
use CodeIgniter\HTTP\ClientInterface;
|
|
||||||
class NotificationHelper
|
class NotificationHelper
|
||||||
{
|
{
|
||||||
protected $email;
|
protected $email;
|
||||||
@ -18,7 +18,70 @@ class NotificationHelper
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function sendWhatsAppMessage($number, $message, $client_login_url = '')
|
||||||
|
{
|
||||||
|
// Extract plain text message
|
||||||
|
$plainTextMessage = strip_tags($message);
|
||||||
|
|
||||||
|
// Extract URL from message
|
||||||
|
preg_match('/<a\s+(?:[^>]*?\s+)?href="([^"]*)"/i', $client_login_url, $match);
|
||||||
|
$client_login_url = isset($match[1]) ? $match[1] : '';
|
||||||
|
// Prepare the data to send
|
||||||
|
$instance_id = $_ENV['WAAI_INSTANCE'];
|
||||||
|
$access_token = $_ENV['WAAI_TOKEN'];
|
||||||
|
$url = 'https://waai.in/api/send';
|
||||||
|
|
||||||
|
// Prepare the text for WhatsApp
|
||||||
|
if($client_login_url){
|
||||||
|
$whatsappMessage = $plainTextMessage . "\n\nClick here - " . $client_login_url;
|
||||||
|
}else{
|
||||||
|
$whatsappMessage = $plainTextMessage ;
|
||||||
|
}
|
||||||
|
// Prepare JSON payload
|
||||||
|
$postdata = json_encode([
|
||||||
|
'number' => $number,
|
||||||
|
'type' => 'text',
|
||||||
|
'message' => $whatsappMessage,
|
||||||
|
'instance_id' => $instance_id,
|
||||||
|
'access_token' => $access_token
|
||||||
|
]);
|
||||||
|
|
||||||
|
// Initialize cURL session
|
||||||
|
$ch = curl_init($url);
|
||||||
|
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
|
||||||
|
curl_setopt($ch, CURLOPT_POSTFIELDS, $postdata);
|
||||||
|
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($ch, CURLOPT_HTTPHEADER, [
|
||||||
|
'Content-Type: application/json',
|
||||||
|
'Content-Length: ' . strlen($postdata)
|
||||||
|
]);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||||
|
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
|
||||||
|
|
||||||
|
// Execute cURL session
|
||||||
|
$response = curl_exec($ch);
|
||||||
|
|
||||||
|
// Check for cURL errors
|
||||||
|
if ($response === false) {
|
||||||
|
$this->logger->error('Failed to communicate with WhatsApp API: ' . curl_error($ch));
|
||||||
|
curl_close($ch);
|
||||||
|
throw new \Exception('Failed to communicate with WhatsApp API');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get HTTP response code
|
||||||
|
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
||||||
|
curl_close($ch);
|
||||||
|
|
||||||
|
// Check HTTP response code for success
|
||||||
|
if ($httpCode !== 200) {
|
||||||
|
$this->logger->error('Failed to send WhatsApp message. HTTP Code: ' . $httpCode);
|
||||||
|
throw new \Exception('Failed to send WhatsApp message. HTTP Code: ' . $httpCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Log success or handle further
|
||||||
|
$this->logger->info('WhatsApp message sent successfully to ' . $number);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
public function sendSms($number, $name= '', $otp='', $url ='', $message_type_name, $client_full_data='')
|
public function sendSms($number, $name= '', $otp='', $url ='', $message_type_name, $client_full_data='')
|
||||||
{
|
{
|
||||||
@ -56,76 +119,6 @@ class NotificationHelper
|
|||||||
return json_encode(['response' => $output]);
|
return json_encode(['response' => $output]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function send_whatsapp_message($to, $client_name , $business_name , $doc_url)
|
|
||||||
{
|
|
||||||
$url = 'https://graph.facebook.com/v20.0/355752820961010/messages';
|
|
||||||
$headers = [
|
|
||||||
'Authorization: Bearer '.$_ENV['whatsAppToken'],
|
|
||||||
'Content-Type: application/json'
|
|
||||||
];
|
|
||||||
|
|
||||||
$templateName = 'bbsigndoc';
|
|
||||||
$languageCode = 'en';
|
|
||||||
$parsedUrl = parse_url($doc_url, PHP_URL_QUERY);
|
|
||||||
|
|
||||||
$data = [
|
|
||||||
'messaging_product' => 'whatsapp',
|
|
||||||
'to' => $to,
|
|
||||||
'type' => 'template',
|
|
||||||
'template' => [
|
|
||||||
'name' => $templateName,
|
|
||||||
'language' => [
|
|
||||||
'code' => $languageCode
|
|
||||||
],
|
|
||||||
'components' => [
|
|
||||||
[
|
|
||||||
'type' => 'body',
|
|
||||||
'parameters' => [
|
|
||||||
[
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => $client_name
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => $business_name
|
|
||||||
]
|
|
||||||
]
|
|
||||||
],
|
|
||||||
[
|
|
||||||
'type' => 'button',
|
|
||||||
'sub_type' => 'url',
|
|
||||||
'index' => 0,
|
|
||||||
'parameters' => [
|
|
||||||
|
|
||||||
[
|
|
||||||
'type' => 'text',
|
|
||||||
'text' => $parsedUrl
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
]
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
$ch = curl_init();
|
|
||||||
curl_setopt($ch, CURLOPT_URL, $url);
|
|
||||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
|
||||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
|
||||||
curl_setopt($ch, CURLOPT_POST, true);
|
|
||||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
|
|
||||||
|
|
||||||
$response = curl_exec($ch);
|
|
||||||
$statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
|
|
||||||
curl_close($ch);
|
|
||||||
|
|
||||||
return [
|
|
||||||
'status_code' => $statusCode,
|
|
||||||
'response' => json_decode($response, true)
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
use Config\Services;
|
use Config\Services;
|
||||||
|
|
||||||
if (!function_exists('generate_signed_url')) {
|
if (!function_exists('generate_signed_url')) {
|
||||||
function generate_signed_url($route, $params = [], $expiresIn = 259200)
|
function generate_signed_url($route, $params = [], $expiresIn = 3600)
|
||||||
{
|
{
|
||||||
$secretKey = 'your-secret-key'; // Change this to your secret key
|
$secretKey = 'your-secret-key'; // Change this to your secret key
|
||||||
$expiresAt = time() + $expiresIn;
|
$expiresAt = time() + $expiresIn;
|
||||||
|
|||||||
@ -36,6 +36,9 @@
|
|||||||
<th>Branch Name</th>
|
<th>Branch Name</th>
|
||||||
<th>GST</th>
|
<th>GST</th>
|
||||||
<th>Address</th>
|
<th>Address</th>
|
||||||
|
<th>City</th>
|
||||||
|
<th>State</th>
|
||||||
|
<th>PIN Code</th>
|
||||||
<th>Contact</th>
|
<th>Contact</th>
|
||||||
<th>Status</th>
|
<th>Status</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
@ -49,12 +52,10 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><?= $value['branch_name']; ?></td>
|
<td><?= $value['branch_name']; ?></td>
|
||||||
<td><?= $value['gstno']; ?></td>
|
<td><?= $value['gstno']; ?></td>
|
||||||
<td>
|
<td><?= $value['address']; ?></td>
|
||||||
<?= $value['address']; ?></br>
|
<td><?= $value['city']; ?></td>
|
||||||
<?= $value['city']; ?>
|
<td><?= $value['state']; ?></td>
|
||||||
<?php if (!empty($value['state'])): ?>, <?= $value['state']; ?><?php endif; ?>
|
<td><?= $value['pin_code']; ?></td>
|
||||||
<?php if (!empty($value['pin_code'])): ?> - <?= $value['pin_code']; ?><?php endif; ?>
|
|
||||||
</td>
|
|
||||||
<td><?= $value['contact']; ?></td>
|
<td><?= $value['contact']; ?></td>
|
||||||
<td>
|
<td>
|
||||||
<?php if ($value['isactive'] == 0): ?>
|
<?php if ($value['isactive'] == 0): ?>
|
||||||
|
|||||||
@ -57,12 +57,9 @@
|
|||||||
<h5 class="mb-3 text-uppercase bg-light p-2 client_notification_area"><i class="fas fa-envelope mr-1"></i> Mail Settings</h5>
|
<h5 class="mb-3 text-uppercase bg-light p-2 client_notification_area"><i class="fas fa-envelope mr-1"></i> Mail Settings</h5>
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="subject-input">Sender Email</label>
|
<label for="subject-input">Email</label>
|
||||||
<input type="mail" id="email" class="form-control" value="<?= isset($business['email']) ? $business['email'] : '' ?>">
|
<input type="mail" id="email" class="form-control" value="<?= isset($business['email']) ? $business['email'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-6">
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="subject-input">User Name</label>
|
<label for="subject-input">User Name</label>
|
||||||
<input type="text" id="user_name" class="form-control" value="<?= isset($business['smtp_user']) ? $business['smtp_user'] : '' ?>">
|
<input type="text" id="user_name" class="form-control" value="<?= isset($business['smtp_user']) ? $business['smtp_user'] : '' ?>">
|
||||||
@ -80,30 +77,31 @@
|
|||||||
<input type="text" id="port" class="form-control" value="<?= isset($business['smtp_port']) ? $business['smtp_port'] : '' ?>">
|
<input type="text" id="port" class="form-control" value="<?= isset($business['smtp_port']) ? $business['smtp_port'] : '' ?>">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?php if(!isset($business['business_id'])){ ?>
|
||||||
<h5 class="mb-3 text-uppercase bg-light p-2 client_notification_area"><i class="fas fa-envelope-open-text mr-1"></i>Test Mail</h5>
|
<h5 class="mb-3 text-uppercase bg-light p-2 client_notification_area"><i class="fas fa-bell mr-1"></i>Test Mail</h5>
|
||||||
<div class="form-row" id="test_mail_config_div">
|
<div class="form-row" id="test_mail_config_div">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for="">Enter Your Mail-Id</label>
|
<label for="">Test Config Mail</label>
|
||||||
<input type="mail" class="form-control" id="r_email">
|
<input type="mail" class="form-control" id="r_email">
|
||||||
</div>
|
</div>
|
||||||
|
<?php }else{ ?>
|
||||||
|
<div class="form-row">
|
||||||
<div class="form-group col-md-6">
|
<div class="form-group col-md-6">
|
||||||
<label for=""></label>
|
<!-- <label for="">Test Config Mail</label> -->
|
||||||
|
<!-- <input type="mail" class="form-control" id="r_email"> -->
|
||||||
<button class="btn btn-primary" id="test-email-btn" type="button" style="margin-top: 29px;">Test Email</button>
|
|
||||||
<img src="<?= base_url()."public"; ?>/assets/images/submit-spin.svg" width="29px" height="29px" class="ml-2" id="submit-spin" style="display:none; margin-top: 2.1rem !important;"></img>
|
|
||||||
</div>
|
</div>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
<input type="hidden" id="business_id" name="business_id" value="<?= isset($business['business_id']) ? $business['business_id'] : '' ?>">
|
<input type="hidden" id="business_id" name="business_id" value="<?= isset($business['business_id']) ? $business['business_id'] : '' ?>">
|
||||||
<input type="hidden" id="header_html" value='<?= isset($business['business_id']) ? $business['header_html'] : '' ?>'>
|
<input type="hidden" id="header_html" value='<?= isset($business['business_id']) ? $business['header_html'] : '' ?>'>
|
||||||
<input type="hidden" id="footer_html" value='<?= isset($business['business_id']) ? $business['footer_html'] : '' ?>'>
|
<input type="hidden" id="footer_html" value='<?= isset($business['business_id']) ? $business['footer_html'] : '' ?>'>
|
||||||
<?php if(isset($business['business_id']) > 0){ ?>
|
<?php if(isset($business['business_id'])){?>
|
||||||
<button type="submit" id="savedata" class="btn btn-primary" style="float: right;">Submit</button>
|
<button type="submit" id="savedata" class="btn btn-primary">Submit</button>
|
||||||
<?php }else{ ?>
|
<?php }else{ ?>
|
||||||
<button type="submit" id="savedata" class="btn btn-primary" style="float: right;" disabled>Submit</button>
|
<button class="btn btn-primary" id="test-email-btn" type="button">Test Email</button>
|
||||||
|
<button type="submit" id="savedata" class="btn btn-primary" style="display:none;">Submit</button>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@ -121,7 +119,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
$('#summernote-header').summernote({
|
$('#summernote-header').summernote({
|
||||||
height: 150, // set the height of the editor
|
height: 150, // set the height of the editor
|
||||||
toolbar: [
|
toolbar: [
|
||||||
@ -166,22 +164,17 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#test-email-btn").on("click", function()
|
$("#test-email-btn").on("click", function()
|
||||||
{
|
{
|
||||||
$('#submit-spin').show();
|
|
||||||
$(this).hide();
|
|
||||||
|
|
||||||
formData ={
|
formData ={
|
||||||
sender_email : $('#email').val(),
|
sender_email : $('#email').val(),
|
||||||
r_email : $('#r_email').val(),
|
r_email : $('#r_email').val(),
|
||||||
SMTPHost : $('#host').val(),
|
smtp_host : $('#host').val(),
|
||||||
SMTPUser : $('#user_name').val(),
|
smtp_user : $('#user_name').val(),
|
||||||
SMTPPass : $('#password').val(),
|
smtp_pass : $('#password').val(),
|
||||||
SMTPPort : $('#port').val(),
|
smtp_port : $('#port').val(),
|
||||||
mailType : 'html',
|
|
||||||
protocol : 'smtp',
|
|
||||||
};
|
};
|
||||||
// console.log(formData);
|
// console.log(formData);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
@ -190,16 +183,16 @@
|
|||||||
data: formData,
|
data: formData,
|
||||||
json: true,
|
json: true,
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
console.log(response);
|
|
||||||
|
|
||||||
|
console.log(JSON.parse(response));
|
||||||
if(JSON.parse(response).status == 'success'){
|
if(JSON.parse(response).status == 'success'){
|
||||||
$('#savedata').prop('disabled', false);
|
$('#savedata').css('display','');
|
||||||
toastr.success('Mail Sent successfully ', 'Success');
|
$('#test-email-btn').css('display','none');
|
||||||
|
toastr.success('Data saved successfully ', 'Success');
|
||||||
// window.location.href = '<?= base_url()."business_list"; ?>';
|
// window.location.href = '<?= base_url()."business_list"; ?>';
|
||||||
|
|
||||||
}else{
|
}else{
|
||||||
$('#savedata').prop('disabled', true);
|
toastr.warning('Something went wrong', 'Warning');
|
||||||
toastr.warning('Mail sending failed. Please check your mail configuration.', 'Warning');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
@ -208,44 +201,10 @@
|
|||||||
console.error(xhr.responseText);
|
console.error(xhr.responseText);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
setTimeout(() => {
|
|
||||||
$('#submit-spin').hide();
|
|
||||||
$(this).show();
|
|
||||||
|
|
||||||
}, 2000);
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$("#savedata").on("click", function()
|
$("#savedata").on("click", function()
|
||||||
{
|
{
|
||||||
var isValid = true;
|
|
||||||
var firstEmptyField = null;
|
|
||||||
|
|
||||||
// Find all elements with 'required' attribute
|
|
||||||
$('form [required]').each(function() {
|
|
||||||
var field = $(this);
|
|
||||||
|
|
||||||
// Check if the field is empty
|
|
||||||
if (field.val().trim() === '') {
|
|
||||||
isValid = false;
|
|
||||||
if (!firstEmptyField) {
|
|
||||||
firstEmptyField = field;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Highlight the empty field
|
|
||||||
field.addClass('error');
|
|
||||||
} else {
|
|
||||||
// Remove error class if the field is not empty
|
|
||||||
field.removeClass('error');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!isValid) {
|
|
||||||
// Focus on the first empty field and show an error message
|
|
||||||
toastr.warning('Please fill in all required fields.', 'Warning');
|
|
||||||
firstEmptyField.focus();
|
|
||||||
return; // Prevent the AJAX call
|
|
||||||
}
|
|
||||||
|
|
||||||
var headerContent = $('#summernote-header').summernote('code');
|
var headerContent = $('#summernote-header').summernote('code');
|
||||||
var footerContent = $('#summernote-footer').summernote('code');
|
var footerContent = $('#summernote-footer').summernote('code');
|
||||||
|
|||||||
@ -35,10 +35,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Client</th>
|
<th>Client</th>
|
||||||
<th>Branch Name</th>
|
<th>Branch Name</th>
|
||||||
<th>GST</th>
|
<th>GST No</th>
|
||||||
<th>Mobile</th>
|
|
||||||
<th>Email</th>
|
|
||||||
<th>Address</th>
|
<th>Address</th>
|
||||||
|
<th>City</th>
|
||||||
|
<th>State</th>
|
||||||
|
<th>Pin Code</th>
|
||||||
|
<th>Mobile No</th>
|
||||||
<th>Active</th>
|
<th>Active</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
@ -47,19 +49,21 @@
|
|||||||
<?php foreach ($clientBranchList as $value) :?>
|
<?php foreach ($clientBranchList as $value) :?>
|
||||||
<tr>
|
<tr>
|
||||||
<td><?= $value['client_name']; ?></td>
|
<td><?= $value['client_name']; ?></td>
|
||||||
<td> <?php if($value['individual'] == 1) { ?><?= 'Individual' ?><?php }else{ ?> <?= $value['name']; ?><?php } ?></td>
|
<?php if($value['individual'] == 1) { ?>
|
||||||
|
<td><?= $value['client_name']; ?></td>
|
||||||
|
<?php }else{ ?>
|
||||||
|
<td><?= $value['name']; ?></td>
|
||||||
|
<?php } ?>
|
||||||
<td><?= $value['gst_no']; ?></td>
|
<td><?= $value['gst_no']; ?></td>
|
||||||
<td> <?php if($value['individual'] == 1) { ?><?= $value['client_mobile_no']; ?><?php }else{ ?> <?= $value['mobile_no']; ?><?php } ?></td>
|
<td><?= $value['address']; ?></td>
|
||||||
<td><?php if($value['individual'] == 1) { ?><?= $value['client_email']; ?><?php }else{ ?> <?= $value['email']; ?><?php } ?></td>
|
<td><?= $value['city']; ?></td>
|
||||||
|
<td><?= $value['state']; ?></td>
|
||||||
<td>
|
<td><?= $value['pin_code']; ?></td>
|
||||||
<?= $value['address']; ?></br>
|
<?php if($value['individual'] == 1) { ?>
|
||||||
<?= $value['city']; ?>
|
<td><?= $value['client_mobile_no']; ?></td>
|
||||||
<?php if (!empty($value['state'])): ?>, <?= $value['state']; ?><?php endif; ?>
|
<?php }else{ ?>
|
||||||
<?php if (!empty($value['pin_code'])): ?> - <?= $value['pin_code']; ?><?php endif; ?>
|
<td><?= $value['mobile_no']; ?></td>
|
||||||
</td>
|
<?php } ?>
|
||||||
|
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
<?php if ($value['is_active'] == 0): ?>
|
<?php if ($value['is_active'] == 0): ?>
|
||||||
<span style="color: red;">Inactive</span>
|
<span style="color: red;">Inactive</span>
|
||||||
@ -410,8 +414,6 @@
|
|||||||
$('#email').prop('required', false);
|
$('#email').prop('required', false);
|
||||||
$('#mobile_no').prop('required', false);
|
$('#mobile_no').prop('required', false);
|
||||||
}else{
|
}else{
|
||||||
$('.branch_hide_edit').show();
|
|
||||||
$('#individual').val('');
|
|
||||||
$('#branch_name').val(response.name);
|
$('#branch_name').val(response.name);
|
||||||
$('#gst_no').val(response.gst_no);
|
$('#gst_no').val(response.gst_no);
|
||||||
$('#email').val(response.email);
|
$('#email').val(response.email);
|
||||||
|
|||||||
@ -54,14 +54,9 @@
|
|||||||
<div class="col-8">
|
<div class="col-8">
|
||||||
<div class="page-title-box page-title-box-alt">
|
<div class="page-title-box page-title-box-alt">
|
||||||
<h4 class="page-title"><?php echo $docData->service_name; ?>
|
<h4 class="page-title"><?php echo $docData->service_name; ?>
|
||||||
<a class="download-btnn" style="color:#000;" title="Download">
|
<a class="download-btnn" style="color:#000;">
|
||||||
<i class="fas fa-download"></i>
|
<i class="fas fa-download"></i>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<?php if(isset($_SESSION['is_staff_logged_in']) && $_SESSION['is_staff_logged_in']) { ?>
|
|
||||||
<i class="mdi mdi-link-variant-plus" title="Create Share Link" data-id="<?php echo $docData->doc_id; ?>" onclick="createSharedLink(this)"></i>
|
|
||||||
<?php } ?>
|
|
||||||
|
|
||||||
</h4>
|
</h4>
|
||||||
<div class="page-title-right">
|
<div class="page-title-right">
|
||||||
<!-- <a onclick="window.history.back()" class="btn btn-secondary waves-effect waves-light" > Close </a> -->
|
<!-- <a onclick="window.history.back()" class="btn btn-secondary waves-effect waves-light" > Close </a> -->
|
||||||
@ -195,22 +190,6 @@
|
|||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
|
|
||||||
<div id="linkModal" class="modal" tabindex="-1" role="dialog">
|
|
||||||
<div class="modal-dialog" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
|
|
||||||
<div class="modal-body">
|
|
||||||
<p id="generatedLink" style="display:none;"></p>
|
|
||||||
Copy the document link by clicking the below button
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-primary" id="copyLinkButton">Copy Link</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
@ -453,30 +432,10 @@
|
|||||||
data: formData,
|
data: formData,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
$('.loader').fadeOut();
|
||||||
$('.loader-mask').fadeOut('slow');
|
$('.loader-mask').fadeOut('slow');
|
||||||
}, 1000);
|
|
||||||
console.log(response);
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
if (response.hasOwnProperty('mail_status')) {
|
window.location.reload();
|
||||||
|
|
||||||
if (response.mail_status == 'success')
|
|
||||||
{
|
|
||||||
toastr.success(response.data, 'Success');
|
|
||||||
toastr.success('Mail Send To '+response.mail, 'Success');
|
|
||||||
} else {
|
|
||||||
toastr.success(response.data, 'Success');
|
|
||||||
toastr.warning('Failed to send mail to '+response.mail, 'Warning');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
toastr.success(response.data, 'Success');
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(function() { window.location.reload(); }, 2000);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
error: function(xhr, status, error) {
|
error: function(xhr, status, error) {
|
||||||
@ -489,56 +448,6 @@
|
|||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function createSharedLink(params){
|
|
||||||
var doc_id = params.getAttribute('data-id');
|
|
||||||
$('.loader').fadeIn();
|
|
||||||
$('.loader-mask').fadeIn();
|
|
||||||
var formData = {
|
|
||||||
doc_id: doc_id,
|
|
||||||
};
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: '<?php echo base_url()."createSharedLink"?>',
|
|
||||||
data: formData,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(response) {
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
|
||||||
$('.loader-mask').fadeOut('slow');
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
|
|
||||||
if (response.status == 'success')
|
|
||||||
{
|
|
||||||
$('#generatedLink').text(response.link);
|
|
||||||
$('#linkModal').modal('show');
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
// Handle error response here
|
|
||||||
console.error(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$(document).on('click', '#copyLinkButton', function() {
|
|
||||||
const textToCopy = $('#generatedLink').text();
|
|
||||||
|
|
||||||
// Use the Clipboard API to copy the text
|
|
||||||
navigator.clipboard.writeText(textToCopy).then(() => {
|
|
||||||
// Success callback
|
|
||||||
console.log('Text copied to clipboard');
|
|
||||||
}).catch(err => {
|
|
||||||
// Error callback
|
|
||||||
console.error('Failed to copy text: ', err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,75 +0,0 @@
|
|||||||
|
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml"
|
|
||||||
style="font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
|
||||||
<head>
|
|
||||||
<meta name="viewport" content="width=device-width"/>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
|
||||||
<title>Minton - Responsive Bootstrap 4 Admin Dashboard</title>
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body itemscope itemtype="http://schema.org/EmailMessage"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; -webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; width: 100% !important; height: 100%; line-height: 1.6em; background-color: #f6f6f6; margin: 0;"
|
|
||||||
bgcolor="#f6f6f6">
|
|
||||||
|
|
||||||
<table class="body-wrap"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; width: 100%; background-color: #f6f6f6; margin: 0;"
|
|
||||||
bgcolor="#f6f6f6">
|
|
||||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
|
||||||
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;"
|
|
||||||
valign="top"></td>
|
|
||||||
<td class="container" width="600"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; display: block !important; max-width: 600px !important; clear: both !important; margin: 0 auto;"
|
|
||||||
valign="top">
|
|
||||||
<div class="content"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; max-width: 600px; display: block; margin: 0 auto; padding: 20px;">
|
|
||||||
<table class="main" width="100%" cellpadding="0" cellspacing="0"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; border-radius: 3px; background-color: #fff; margin: 0; border: 1px solid #e9e9e9;"
|
|
||||||
bgcolor="#fff">
|
|
||||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
|
||||||
<td class=""
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 16px; vertical-align: top; color: #fff; font-weight: 500; text-align: center; border-radius: 3px 3px 0 0; background-color: #38414a; margin: 0; padding: 20px;"
|
|
||||||
align="center" bgcolor="#71b6f9" valign="top">
|
|
||||||
|
|
||||||
<span style="margin-top: 10px;display: block;">Verify Document</span>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
|
||||||
<td class="content-wrap"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 20px;"
|
|
||||||
valign="top">
|
|
||||||
<table width="100%" cellpadding="0" cellspacing="0"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
|
||||||
|
|
||||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
|
||||||
<td class="content-block"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
|
|
||||||
valign="top">
|
|
||||||
<?= $message; ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; margin: 0;">
|
|
||||||
<td class="content-block"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0; padding: 0 0 20px;"
|
|
||||||
valign="top">
|
|
||||||
<a href=" <?= $url; ?>" class="btn-primary"
|
|
||||||
style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; color: #FFF; text-decoration: none; line-height: 2em; font-weight: bold; text-align: center; cursor: pointer; display: inline-block; border-radius: 5px; text-transform: capitalize; background-color: #f1556c; margin: 0; border-color: #f1556c; border-style: solid; border-width: 8px 16px;">
|
|
||||||
Preview and Approve Document
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</td>
|
|
||||||
<td style="font-family: 'Helvetica Neue',Helvetica,Arial,sans-serif; box-sizing: border-box; font-size: 14px; vertical-align: top; margin: 0;"
|
|
||||||
valign="top"></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@ -160,34 +160,22 @@
|
|||||||
|
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.dropdown-menu-right {
|
.dropdown-menu-right {
|
||||||
right: auto !important;
|
right: auto !important;
|
||||||
top: auto !important;
|
top: auto !important;
|
||||||
/* left: auto !important; */
|
/* left: auto !important; */
|
||||||
}
|
}
|
||||||
|
|
||||||
.modal-xg {
|
.modal-xg {
|
||||||
max-width: 70%; /* Adjust the percentage as needed */
|
max-width: 70%; /* Adjust the percentage as needed */
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<script>
|
|
||||||
$(window).on('load', function() {
|
|
||||||
// setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
|
||||||
$('.loader-mask').fadeOut('slow');
|
|
||||||
// }, 500);
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<body class="loading" data-layout-mode="horizontal" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": true}'>
|
<body class="loading" data-layout-mode="horizontal" data-layout='{"mode": "light", "width": "fluid", "menuPosition": "fixed", "topbar": {"color": "dark"}, "showRightSidebarOnPageLoad": true}'>
|
||||||
|
|
||||||
<!-- <div class="loader-mask">
|
|
||||||
<div class="loader">
|
|
||||||
<img src="<?= base_url() . "public" ?>/assets/images/submit-spin.svg" height="40" width="40" alt="Loading...">
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<!-- Begin page -->
|
<!-- Begin page -->
|
||||||
<div id="wrapper">
|
<div id="wrapper">
|
||||||
|
|
||||||
|
|||||||
@ -77,12 +77,13 @@
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th style="width:10px">Client</th>
|
<th style="width:10px">Client Name</th>
|
||||||
|
<th>Client Branch Name</th>
|
||||||
<th>Service Group</th>
|
<th>Service Group</th>
|
||||||
<th>Service</th>
|
<th>Service Name</th>
|
||||||
<th>Document</th>
|
<th>Document Name</th>
|
||||||
<th>Doc Status</th>
|
<th>Doc Status</th>
|
||||||
<th>Approval Date</th>
|
<th>Approve Date</th>
|
||||||
<th>Action</th>
|
<th>Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -93,7 +94,8 @@
|
|||||||
<?php foreach ($doc_list as $key => $value) { ?>
|
<?php foreach ($doc_list as $key => $value) { ?>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td style="width:10px"> <?= $value['client_name']; ?> <?php if (!empty($value['client_branch_name'])): ?>- <?= $value['client_branch_name']; ?><?php endif; ?> </td>
|
<td style="width:10px"> <?php echo $value['client_name']; ?></td>
|
||||||
|
<td> <?php echo $value['client_branch_name']; ?></td>
|
||||||
<td> <?php echo $value['group_name']; ?></td>
|
<td> <?php echo $value['group_name']; ?></td>
|
||||||
<td> <?php echo $value['service_name']; ?></td>
|
<td> <?php echo $value['service_name']; ?></td>
|
||||||
<td> <?php echo $value['document_name']; ?></td>
|
<td> <?php echo $value['document_name']; ?></td>
|
||||||
@ -131,7 +133,7 @@
|
|||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|
||||||
<a id="doc_history_button" data-id="<?php echo $value['id']; ?>" class="dropdown-item" data-toggle="modal" data-target="#bike_make_login-modal" data-title="History">
|
<a id="doc_history_button" data-id="<?php echo $value['id']; ?>" class="dropdown-item" data-toggle="modal" data-target="#bike_make_login-modal" data-title="Share">
|
||||||
<i class="mdi mdi-history" style="margin-right: 16px !important;"></i>History
|
<i class="mdi mdi-history" style="margin-right: 16px !important;"></i>History
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
@ -144,16 +146,7 @@
|
|||||||
<a class="dropdown-item" data-id="<?php echo $value['id']; ?>" data-isactive="<?php echo $value['is_active']; ?>" title="Remember" onclick="rememberNotification(this)">
|
<a class="dropdown-item" data-id="<?php echo $value['id']; ?>" data-isactive="<?php echo $value['is_active']; ?>" title="Remember" onclick="rememberNotification(this)">
|
||||||
<i class="mdi mdi-email-send" style="margin-right: 16px !important; margin-left: 5px;"></i>Reminder
|
<i class="mdi mdi-email-send" style="margin-right: 16px !important; margin-left: 5px;"></i>Reminder
|
||||||
</a>
|
</a>
|
||||||
<?php } ?>
|
|
||||||
<?php if($value['is_active'] == 1 && $value['is_approved'] == 0){ ?>
|
|
||||||
<a class="dropdown-item" data-id="<?php echo $value['id']; ?>" data-isactive="<?php echo $value['is_active']; ?>" title="Create Link" onclick="createSharedLink(this)">
|
|
||||||
<i class="mdi mdi-link-variant-plus" style="margin-right: 16px !important; margin-left: 5px;"></i>Create Link
|
|
||||||
</a>
|
|
||||||
<?php } ?>
|
|
||||||
<?php if($value['is_active'] == 0 ) { ?>
|
|
||||||
<a class="dropdown-item" data-id="<?php echo $value['id']; ?>" title="Delete" onclick="DeleteDoc(this)">
|
|
||||||
<i class="mdi mdi-delete" style="margin-right: 16px !important; margin-left: 5px;"></i>Delete
|
|
||||||
</a>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -304,21 +297,6 @@
|
|||||||
</div><!-- /.modal-dialog -->
|
</div><!-- /.modal-dialog -->
|
||||||
</div><!-- /.modal -->
|
</div><!-- /.modal -->
|
||||||
|
|
||||||
<div id="linkModal" class="modal" tabindex="-1" role="dialog">
|
|
||||||
<div class="modal-dialog" role="document">
|
|
||||||
<div class="modal-content">
|
|
||||||
|
|
||||||
<div class="modal-body">
|
|
||||||
<p id="generatedLink" style="display:none;"></p>
|
|
||||||
Copy the document link by clicking the below button
|
|
||||||
</div>
|
|
||||||
<div class="modal-footer">
|
|
||||||
<button type="button" class="btn btn-primary" id="copyLinkButton">Copy Link</button>
|
|
||||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- ============================================================== -->
|
<!-- ============================================================== -->
|
||||||
@ -615,8 +593,6 @@
|
|||||||
if(status == 1){
|
if(status == 1){
|
||||||
var is_active= 0;
|
var is_active= 0;
|
||||||
}else{
|
}else{
|
||||||
$('.loader').fadeIn();
|
|
||||||
$('.loader-mask').fadeIn();
|
|
||||||
var is_active= 1;
|
var is_active= 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -629,141 +605,6 @@
|
|||||||
url: '<?php echo base_url()."change_doc_status"?>',
|
url: '<?php echo base_url()."change_doc_status"?>',
|
||||||
data: formData,
|
data: formData,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function(response) {
|
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
|
||||||
$('.loader-mask').fadeOut('slow');
|
|
||||||
}, 1000);
|
|
||||||
console.log(response);
|
|
||||||
if (response.data) {
|
|
||||||
if (response.hasOwnProperty('mail_status')) {
|
|
||||||
|
|
||||||
if (response.mail_status == 'success')
|
|
||||||
{
|
|
||||||
toastr.success(response.data, 'Success');
|
|
||||||
toastr.success('Mail Sent To '+response.mail, 'Success');
|
|
||||||
} else {
|
|
||||||
toastr.success(response.data, 'Success');
|
|
||||||
toastr.warning('Failed to sent mail to '+response.mail, 'Warning');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
|
||||||
toastr.success(response.data, 'Success');
|
|
||||||
}
|
|
||||||
|
|
||||||
setTimeout(function() { window.location.reload(); }, 2000);
|
|
||||||
|
|
||||||
}
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
// Handle error response here
|
|
||||||
console.error(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function rememberNotification(params) {
|
|
||||||
var doc_id = params.getAttribute('data-id');
|
|
||||||
$('.loader').fadeIn();
|
|
||||||
$('.loader-mask').fadeIn();
|
|
||||||
var formData = {
|
|
||||||
doc_id: doc_id,
|
|
||||||
};
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: '<?php echo base_url()."rememeber_notification"?>',
|
|
||||||
data: formData,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(response) {
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
|
||||||
$('.loader-mask').fadeOut('slow');
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
|
|
||||||
if (response.mail_status == 'success')
|
|
||||||
{
|
|
||||||
toastr.success('Mail Send To '+response.mail, 'Success');
|
|
||||||
} else {
|
|
||||||
toastr.warning('Failed to send mail to '+response.mail, 'Warning');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
// Handle error response here
|
|
||||||
console.error(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function createSharedLink(params){
|
|
||||||
var doc_id = params.getAttribute('data-id');
|
|
||||||
$('.loader').fadeIn();
|
|
||||||
$('.loader-mask').fadeIn();
|
|
||||||
var formData = {
|
|
||||||
doc_id: doc_id,
|
|
||||||
};
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: '<?php echo base_url()."createSharedLink"?>',
|
|
||||||
data: formData,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(response) {
|
|
||||||
|
|
||||||
setTimeout(function() {
|
|
||||||
$('.loader').fadeOut();
|
|
||||||
$('.loader-mask').fadeOut('slow');
|
|
||||||
}, 1000);
|
|
||||||
|
|
||||||
|
|
||||||
if (response.status == 'success')
|
|
||||||
{
|
|
||||||
$('#generatedLink').text(response.link);
|
|
||||||
$('#linkModal').modal('show');
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
|
||||||
error: function(xhr, status, error) {
|
|
||||||
// Handle error response here
|
|
||||||
console.error(xhr.responseText);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
$(document).on('click', '#copyLinkButton', function() {
|
|
||||||
const textToCopy = $('#generatedLink').text();
|
|
||||||
|
|
||||||
// Use the Clipboard API to copy the text
|
|
||||||
navigator.clipboard.writeText(textToCopy).then(() => {
|
|
||||||
// Success callback
|
|
||||||
console.log('Text copied to clipboard');
|
|
||||||
}).catch(err => {
|
|
||||||
// Error callback
|
|
||||||
console.error('Failed to copy text: ', err);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
function DeleteDoc(params) {
|
|
||||||
var doc_id = params.getAttribute('data-id');
|
|
||||||
|
|
||||||
var formData = {
|
|
||||||
doc_id: doc_id,
|
|
||||||
};
|
|
||||||
$.ajax({
|
|
||||||
type: 'POST',
|
|
||||||
url: '<?php echo base_url()."delete_doc"?>',
|
|
||||||
data: formData,
|
|
||||||
dataType: 'json',
|
|
||||||
success: function(response) {
|
success: function(response) {
|
||||||
console.log(response);
|
console.log(response);
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
@ -779,6 +620,33 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function rememberNotification(params) {
|
||||||
|
var doc_id = params.getAttribute('data-id');
|
||||||
|
|
||||||
|
var formData = {
|
||||||
|
doc_id: doc_id,
|
||||||
|
};
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: '<?php echo base_url()."rememeber_notification"?>',
|
||||||
|
data: formData,
|
||||||
|
dataType: 'json',
|
||||||
|
success: function(response) {
|
||||||
|
console.log(response);
|
||||||
|
if (response.data) {
|
||||||
|
window.location.reload();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
error: function(xhr, status, error) {
|
||||||
|
// Handle error response here
|
||||||
|
console.error(xhr.responseText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -812,9 +680,6 @@
|
|||||||
}else if(item.status == "Rejected"){
|
}else if(item.status == "Rejected"){
|
||||||
reason_or_ip = ' - Reason(';
|
reason_or_ip = ' - Reason(';
|
||||||
reason_or_ip_end = ')';
|
reason_or_ip_end = ')';
|
||||||
}else if(item.status == "Mail Success" || item.status == "Mail Failed"){
|
|
||||||
reason_or_ip = ' - Email-Id(';
|
|
||||||
reason_or_ip_end = ')';
|
|
||||||
}else{
|
}else{
|
||||||
reason_or_ip = '';
|
reason_or_ip = '';
|
||||||
reason_or_ip_end = '';
|
reason_or_ip_end = '';
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 114 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 114 KiB |
Loading…
Reference in New Issue
Block a user