CHANGE_SERVICE_GROUP_ISSUE : AADHAVAN

This commit is contained in:
aadhavan valli 2024-07-09 11:22:00 +05:30
parent 22ae8a7db4
commit af1998bd5b
2 changed files with 34 additions and 29 deletions

View File

@ -347,18 +347,18 @@ class MasterController extends BaseController
->findAll(); ->findAll();
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll(); $data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
foreach ($data['serviceGroupData'] as $key => $value) { // foreach ($data['serviceGroupData'] as $key => $value) {
$check_its_okay = 0; // $check_its_okay = 0;
foreach (json_decode($value['business_id']) as $values) { // foreach (json_decode($value['business_id']) as $values) {
if($values == $business_id){ // if($values == $business_id){
$check_its_okay =1; // $check_its_okay =1;
} // }
} // }
if($check_its_okay == 0){ // if($check_its_okay == 0){
unset($data['serviceGroupData'][$key]); // unset($data['serviceGroupData'][$key]);
} // }
$check_its_okay = 0; // $check_its_okay = 0;
} // }
}else{ }else{
$business_id = $this->session->get('logged_in_staff_business_id'); $business_id = $this->session->get('logged_in_staff_business_id');
@ -400,18 +400,18 @@ class MasterController extends BaseController
->findAll(); ->findAll();
$data['serviceGroupData'] = $this->ServiceGroupModel->findAll(); $data['serviceGroupData'] = $this->ServiceGroupModel->findAll();
foreach ($data['serviceGroupData'] as $key => $value) { // foreach ($data['serviceGroupData'] as $key => $value) {
$check_its_okay = 0; // $check_its_okay = 0;
foreach (json_decode($value['business_id']) as $values) { // foreach (json_decode($value['business_id']) as $values) {
if($values == $business_id){ // if($values == $business_id){
$check_its_okay =1; // $check_its_okay =1;
} // }
} // }
if($check_its_okay == 0){ // if($check_its_okay == 0){
unset($data['serviceGroupData'][$key]); // unset($data['serviceGroupData'][$key]);
} // }
$check_its_okay = 0; // $check_its_okay = 0;
} // }
} }
foreach ($data['doc_list'] as $doc) { foreach ($data['doc_list'] as $doc) {
@ -722,12 +722,16 @@ class MasterController extends BaseController
$documentUrl = base_url(); $documentUrl = base_url();
helper('url'); helper('url');
$url ='<a href="' . generate_signed_url('preview', ['doc_id'=> md5($doc_id)], 36000) . '">Preview and Approve Document</a>'; $url ='<a href="' . generate_signed_url('preview', ['doc_id'=> md5($doc_id)], 36000) . '">Preview and Approve Document</a>';
$businessData = $this->BranchModel->select('branches.* , business.business_name ') // $businessData = $this->BranchModel->select('branches.* , business.business_name ')
->join('business', 'branches.business_id = business.business_id', 'left') // ->join('business', 'branches.business_id = business.business_id', 'left')
->where('branches.branch_id',$this->session->get('logged_in_staff_branch_id')) // ->where('branches.branch_id',$this->session->get('logged_in_staff_branch_id'))
// ->get()->getRow();
$businessData = $this->BusinessModel->select('branches.* , business.business_name ')
->join('branches', 'business.business_id = branches.business_id', 'left')
->where('business.business_id',$this->session->get('logged_in_staff_business_id'))
->get()->getRow(); ->get()->getRow();
$subject = 'BB-Sign Verify Document'; $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; $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_send = $MailHelper->send_url_email($clientData->email , $businessData->email, $subject, $message); $mail_send = $MailHelper->send_url_email($clientData->email , $businessData->email, $subject, $message);
@ -750,6 +754,7 @@ class MasterController extends BaseController
$statusData['status'] = 'Revert'; $statusData['status'] = 'Revert';
$this->DocsStatusModel->insert($statusData); $this->DocsStatusModel->insert($statusData);
} }
$updated = $this->ClientDocsModel->update($doc_id, $data); $updated = $this->ClientDocsModel->update($doc_id, $data);
if ($updated) { if ($updated) {
return $this->response->setJSON(['status' => 'success','code' => 200,'data' => true],200); return $this->response->setJSON(['status' => 'success','code' => 200,'data' => true],200);

View File

@ -596,7 +596,7 @@
data: formData, data: formData,
dataType: 'json', dataType: 'json',
success: function(response) { success: function(response) {
// console.log(response); console.log(response.data);
if (response.data) { if (response.data) {
window.location.reload(); window.location.reload();
} }