From 2370c64a1847510f83c4d9d3f8b6339343707526 Mon Sep 17 00:00:00 2001 From: bitbucket Date: Thu, 13 Jun 2024 10:39:33 +0530 Subject: [PATCH] template header and footer : GWM --- app/Controllers/MasterController.php | 8 ++++++-- app/Models/ClientDocsModel.php | 3 ++- app/Views/client_docs_preview.php | 15 ++++++++------- app/Views/template_form.php | 1 + 4 files changed, 17 insertions(+), 10 deletions(-) diff --git a/app/Controllers/MasterController.php b/app/Controllers/MasterController.php index 416bdb2..17b8887 100644 --- a/app/Controllers/MasterController.php +++ b/app/Controllers/MasterController.php @@ -215,7 +215,7 @@ class MasterController extends BaseController $id = $this->request->getVar('service_id'); $data['AllServiceGroupData'] = $this->ServiceGroupModel->findAll(); - $data['AllBusinessData'] = $this->BusinessModel->findAll(); + $data['AllBusinessData'] = $this->BusinessModel->where('isactive',1)->findAll(); $staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow(); echo view('layout/header', ['Data'=>$staffdata]); @@ -239,6 +239,9 @@ class MasterController extends BaseController $data['serviceGroupData'] = $this->ServiceGroupModel->where('service_group_id',$data['templateData']->service_group_id)->get()->getRow(); $data['AllServiceGroupData'] = $this->ServiceGroupModel->where('branch_id',$this->session->get('logged_in_staff_branch_id'))->findAll(); + $data['BusinessData'] = $this->BusinessModel->where('business_id',$data['templateData']->template_header_business)->where('isactive',1)->get()->getRow(); + $data['AllBusinessData'] = $this->BusinessModel->where('isactive',1)->findAll(); + $staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow(); echo view('layout/header', ['Data'=>$staffdata]); echo view('template_form',$data); @@ -347,7 +350,8 @@ class MasterController extends BaseController ->join('client', 'client_branch.client_id = client.client_id', 'left') ->where('client_branch.id',$data['docData']->client_branch_id)->get()->getRow(); - + $data['header_html'] = $data['docData']->header_html; + $data['footer_html'] = $data['docData']->footer_html; $data['body_html'] = $data['docData']->body_html; foreach ($data['clientData'] as $key => $value) { $placeHolder = '%'.$key.'%'; diff --git a/app/Models/ClientDocsModel.php b/app/Models/ClientDocsModel.php index 6c9991a..f1942ce 100644 --- a/app/Models/ClientDocsModel.php +++ b/app/Models/ClientDocsModel.php @@ -37,9 +37,10 @@ class ClientDocsModel extends Model public function docPreview($doc_id){ - $this->select('client_docs.is_approved ,client_docs.id as doc_id,client_docs.client_branch_id ,client_docs.updated_at,client_docs.ip_address,template.template_name,client_docs.body_html , services.service_name'); + $this->select('client_docs.is_approved ,client_docs.id as doc_id,client_docs.client_branch_id ,client_docs.updated_at,client_docs.ip_address,template.template_name,client_docs.body_html , services.service_name , business.header_html, business.footer_html'); $this->join('template', 'template.template_id = client_docs.template_id'); $this->join('services', 'services.service_id = template.service_id'); + $this->join('business', 'business.business_id = template.template_header_business'); $this->where('client_docs.id', $doc_id); return $this->get()->getRow(); diff --git a/app/Views/client_docs_preview.php b/app/Views/client_docs_preview.php index 5a0a228..e5d765c 100644 --- a/app/Views/client_docs_preview.php +++ b/app/Views/client_docs_preview.php @@ -51,19 +51,20 @@
- +
- - - + +
+ is_approved == 1){ echo '
Approved at '.date('d-m-Y H:i:s', strtotime($docData->updated_at)).' through OTP sent to '.$clientData->mobile_no.' from ip address '.$docData->ip_address.'
'; } ?> +
-
- is_approved == 1){ echo '
Approved at '.date('d-m-Y H:i:s', strtotime($docData->updated_at)).' through OTP sent to '.$clientData->mobile_no.' from ip address '.$docData->ip_address.'
'; } ?> + - +
diff --git a/app/Views/template_form.php b/app/Views/template_form.php index 379560c..55e96ad 100644 --- a/app/Views/template_form.php +++ b/app/Views/template_form.php @@ -259,6 +259,7 @@ $(document).ready(function() { $('#summernote-basic').summernote({ + height: 500, toolbar: [ // [groupName, [list of button]] ['style', ['style']],