GWM
This commit is contained in:
parent
5c72e37b58
commit
9a18363b99
@ -262,6 +262,7 @@ class MasterController extends BaseController
|
||||
$id = $this->request->getVar('template_id');
|
||||
$data['templateData'] = $this->TemplateModel->where('md5(template_id)',$id)->get()->getRow();
|
||||
$data['serviceData'] = $this->ServiceModel->where('service_id',$data['templateData']->service_id)->get()->getRow();
|
||||
$data['businessData'] = $this->BusinessModel->where('business_id',$data['templateData']->template_header_business)->get()->getRow();
|
||||
|
||||
$staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow();
|
||||
$data['body_html'] = $data['templateData']->body_html;
|
||||
@ -351,11 +352,12 @@ class MasterController extends BaseController
|
||||
|
||||
$doc_id = $this->request->getVar('doc_id');
|
||||
$data['docData'] = $this->ClientDocsModel->docPreview($doc_id);
|
||||
// dd( $data['docData']);
|
||||
|
||||
$data['clientData'] = $this->ClientBranchModel->select('client.* , client_branch.*')
|
||||
->join('client', 'client_branch.client_id = client.client_id', 'left')
|
||||
->where('client_branch.id',$data['docData']->client_branch_id)
|
||||
->get()->getRow();
|
||||
|
||||
$DateAndYears = $this->dateAndYearPlaceholder();
|
||||
|
||||
|
||||
|
||||
@ -14,7 +14,7 @@ class ClientDocsModel extends Model
|
||||
public function getTemplate($client_id){
|
||||
|
||||
|
||||
$this->select('template.template_name , template.template_id ,client_docs.is_approved ,client_docs.id as doc_id ,client_docs.created_at , services.service_name');
|
||||
$this->select('template.template_name , template.template_id ,client_docs.is_approved ,client_docs.id as doc_id ,client_docs.created_at ,client_docs.document_name, services.service_name');
|
||||
$this->join('template', 'template.template_id = client_docs.template_id');
|
||||
$this->join('services', 'services.service_id = template.service_id');
|
||||
$this->where('client_docs.is_active', 1);
|
||||
|
||||
@ -80,12 +80,36 @@
|
||||
$(document).ready(function() {
|
||||
$('#summernote-header').summernote({
|
||||
height: 150, // set the height of the editor
|
||||
placeholder: 'Write the header content here...'
|
||||
toolbar: [
|
||||
|
||||
['style', ['style']],
|
||||
['font', ['bold', 'italic', 'underline', 'clear' ]],
|
||||
['fontname', ['fontname']],
|
||||
['fontsize', ['fontsize']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph' , 'height']],
|
||||
['table', ['table']],
|
||||
['insert', [ 'picture']],
|
||||
['view', ['fullscreen', 'codeview', 'help']],
|
||||
['mybutton', ['customButton','Years']] // Custom button group
|
||||
],
|
||||
});
|
||||
|
||||
$('#summernote-footer').summernote({
|
||||
height: 150, // set the height of the editor
|
||||
placeholder: 'Write the footer content here...'
|
||||
toolbar: [
|
||||
|
||||
['style', ['style']],
|
||||
['font', ['bold', 'italic', 'underline', 'clear' ]],
|
||||
['fontname', ['fontname']],
|
||||
['fontsize', ['fontsize']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph' , 'height']],
|
||||
['table', ['table']],
|
||||
['insert', [ 'picture']],
|
||||
['view', ['fullscreen', 'codeview', 'help']],
|
||||
['mybutton', ['customButton','Years']] // Custom button group
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
@ -94,7 +118,7 @@ $(document).ready(function() {
|
||||
$('#summernote-header').summernote('code', $('#header_html').val());
|
||||
$('#summernote-footer').summernote('code', $('#footer_html').val());
|
||||
|
||||
}, 1000);
|
||||
}, 500);
|
||||
|
||||
|
||||
|
||||
|
||||
@ -11,7 +11,8 @@
|
||||
border-top: 1px dotted #000;
|
||||
padding-top: 3px;
|
||||
}
|
||||
</style>
|
||||
|
||||
</style>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/html2canvas/1.4.1/html2canvas.min.js"></script>
|
||||
|
||||
@ -19,37 +20,48 @@
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-2"> </div>
|
||||
<div class="col-8">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title"><?php echo $docData->service_name; ?>
|
||||
<a class="download-btnn" style="color:#000;">
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
|
||||
<div class="col-2">
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-8">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title"><?php echo $docData->service_name; ?>
|
||||
<a class="download-btnn" style="color:#000;">
|
||||
<i class="fas fa-download"></i>
|
||||
</a>
|
||||
</h4>
|
||||
<div class="page-title-right">
|
||||
<a onclick="window.history.back()" class="btn btn-secondary waves-effect waves-light"> Close </a>
|
||||
<div class="page-title-right">
|
||||
<a onclick="window.history.back()" class="btn btn-secondary waves-effect waves-light"> Close </a>
|
||||
|
||||
<?php if( $docData->is_active == 1 && $docData->is_approved == 0){ ?>
|
||||
<a data-id="<?php echo $docData->doc_id; ?>" data-isactive="<?php echo $docData->is_active; ?>" title="Share" onclick="statusChange(this)" class="btn btn-warning waves-effect waves-light"> Revert </a>
|
||||
<?php } else if( $docData->is_active == 0 ) { ?>
|
||||
<a data-id="<?php echo $docData->doc_id; ?>" data-isactive="<?php echo $docData->is_active; ?>" title="Share" onclick="statusChange(this)" class="btn btn-info waves-effect waves-light"> Share </a>
|
||||
<?php } ?>
|
||||
<?php if(isset($_SESSION['is_staff_logged_in']) && $_SESSION['is_staff_logged_in']) {
|
||||
if( $docData->is_active == 1 && $docData->is_approved == 0){ ?>
|
||||
<a data-id="<?php echo $docData->doc_id; ?>" data-isactive="<?php echo $docData->is_active; ?>" title="Share" onclick="statusChange(this)" class="btn btn-warning waves-effect waves-light"> Revert </a>
|
||||
<?php } else if( $docData->is_active == 0 ) { ?>
|
||||
<a data-id="<?php echo $docData->doc_id; ?>" data-isactive="<?php echo $docData->is_active; ?>" title="Share" onclick="statusChange(this)" class="btn btn-info waves-effect waves-light"> Share </a>
|
||||
<?php } } ?>
|
||||
|
||||
|
||||
|
||||
<?php if($docData->is_approved != 1){ ?>
|
||||
<a href="#" class="btn btn-danger waves-effect waves-light" data-toggle="modal" data-target="#reject-modal"> Reject </a>
|
||||
<a href="#" data-toggle="modal" data-target="#approve-modal" class="btn btn-primary waves-effect waves-light"> Approve </a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
|
||||
<?php if($docData->is_approved != 1){ ?>
|
||||
<a href="#" class="btn btn-danger waves-effect waves-light" data-toggle="modal" data-target="#reject-modal"> Reject </a>
|
||||
<a href="#" data-toggle="modal" data-target="#approve-modal" class="btn btn-primary waves-effect waves-light"> Approve </a>
|
||||
<?php } ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2"> </div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-2">
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
@ -76,7 +88,9 @@
|
||||
</div>
|
||||
</div>
|
||||
</div><!-- end col-->
|
||||
<div class="col-2"> </div>
|
||||
<div class="col-2 centered-div">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@
|
||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100 display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Service</th>
|
||||
<th>Document</th>
|
||||
<th>Shared at</th>
|
||||
<th>Status</th>
|
||||
@ -46,6 +47,7 @@
|
||||
|
||||
<tr>
|
||||
<td> <?php echo $value['service_name']; ?></td>
|
||||
<td> <?php echo $value['document_name']; ?></td>
|
||||
<td> <?php $date = new DateTime($value['created_at']); echo $date->format('d-M-Y h:i A'); ?></td>
|
||||
<td>
|
||||
<?php if ($value['is_approved'] == 1): ?>
|
||||
|
||||
@ -277,14 +277,6 @@
|
||||
<i class="ri-share-line"></i> Share Docs </a>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if($_SESSION['logged_in_staff_role'] == 'Admin' ) { ?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-Service" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@ -299,6 +291,13 @@
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<?php } ?>
|
||||
|
||||
<?php if($_SESSION['logged_in_staff_role'] == 'Admin' ) { ?>
|
||||
|
||||
|
||||
|
||||
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle arrow-none" href="#" id="topnav-my-visa" role="button"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<table id="datatable-buttons" class="table table-striped dt-responsive nowrap w-100 display">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Client Name</th>
|
||||
<th style="width:10px">Client Name</th>
|
||||
<th>Client Branch Name</th>
|
||||
<th>Service Group</th>
|
||||
<th>Service Name</th>
|
||||
@ -60,7 +60,7 @@
|
||||
<?php foreach ($doc_list as $key => $value) { ?>
|
||||
|
||||
<tr>
|
||||
<td> <?php echo $value['client_name']; ?></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['service_name']; ?></td>
|
||||
|
||||
@ -2,7 +2,26 @@
|
||||
<!-- ============================================================== -->
|
||||
<!-- Start Page Content here -->
|
||||
<!-- ============================================================== -->
|
||||
<style>
|
||||
.append-text-button {
|
||||
display: inline-block;
|
||||
padding: 10px 10px;
|
||||
font-size: 13px;
|
||||
color: black; /* Primary color */
|
||||
background-color: transparent;
|
||||
border: 2px solid #85a7c9; /* Border color */
|
||||
border-radius: 4px; /* Rounded corners */
|
||||
text-align: center;
|
||||
cursor: pointer; /* Pointer cursor to indicate it's clickable */
|
||||
transition: background-color 0.3s ease, color 0.3s ease; /* Smooth transition */
|
||||
}
|
||||
|
||||
.append-text-button:hover {
|
||||
background-color: #85a7c9; /* Background color on hover */
|
||||
color: #fff; /* Text color on hover */
|
||||
}
|
||||
|
||||
</style>
|
||||
<div class="content-page">
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
@ -37,7 +56,6 @@
|
||||
|
||||
<form id="template-form">
|
||||
<div class="form-row">
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="vs_category">Service Group<span class="text-danger">*</span></label>
|
||||
<select class="select2-dropdown form-control" id="service_group_id" required>
|
||||
@ -65,7 +83,7 @@
|
||||
</div>
|
||||
|
||||
<div class="form-group col-md-6">
|
||||
<label for="vs_category">Template Header<span class="text-danger">*</span></label>
|
||||
<label for="vs_category">Template Header and Footer<span class="text-danger">*</span></label>
|
||||
<select class="select2-dropdown form-control" id="template_header_business" required>
|
||||
<option value="">Select Business </option>
|
||||
<?php if(isset($AllBusinessData)){ foreach ($AllBusinessData as $key => $value) { ?>
|
||||
@ -121,43 +139,43 @@
|
||||
<div class="container">
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Client Name</div>
|
||||
<div class="col-sm-8">%name%</div>
|
||||
<div class="col-sm-8 append-text-button">%name%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">PAN No</div>
|
||||
<div class="col-sm-8">%pan_no%</div>
|
||||
<div class="col-sm-8 append-text-button">%pan_no%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">GST</div>
|
||||
<div class="col-sm-8">%gst_no%</div>
|
||||
<div class="col-sm-8 append-text-button">%gst_no%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Mobile No</div>
|
||||
<div class="col-sm-8">%mobile_no%</div>
|
||||
<div class="col-sm-8 append-text-button">%mobile_no%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Email</div>
|
||||
<div class="col-sm-8">%email%</div>
|
||||
<div class="col-sm-8 append-text-button">%email%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Address</div>
|
||||
<div class="col-sm-8">%address%</div>
|
||||
<div class="col-sm-8 append-text-button">%address%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Country</div>
|
||||
<div class="col-sm-8">%country%</div>
|
||||
<div class="col-sm-8 append-text-button">%country%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">State</div>
|
||||
<div class="col-sm-8">%state%</div>
|
||||
<div class="col-sm-8 append-text-button">%state%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">City</div>
|
||||
<div class="col-sm-8">%city%</div>
|
||||
<div class="col-sm-8 append-text-button">%city%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">PIN</div>
|
||||
<div class="col-sm-8">%pin_code%</div>
|
||||
<div class="col-sm-8 append-text-button">%pin_code%</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -178,35 +196,35 @@
|
||||
<div class="container">
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Current Date</div>
|
||||
<div class="col-sm-8">%CD%</div>
|
||||
<div class="col-sm-8 append-text-button">%CD%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Calandar Year</div>
|
||||
<div class="col-sm-8">%CY%</div>
|
||||
<div class="col-sm-8 append-text-button">%CY%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Financial Year</div>
|
||||
<div class="col-sm-8">%FY%</div>
|
||||
<div class="col-sm-8 append-text-button">%FY%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Accessment Year</div>
|
||||
<div class="col-sm-8">%AY%</div>
|
||||
<div class="col-sm-8 append-text-button">%AY%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Q1 Year</div>
|
||||
<div class="col-sm-8">%Q1%</div>
|
||||
<div class="col-sm-8 append-text-button">%Q1%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Q2 Year</div>
|
||||
<div class="col-sm-8">%Q2%</div>
|
||||
<div class="col-sm-8 append-text-button">%Q2%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Q3 Year</div>
|
||||
<div class="col-sm-8">%Q3%</div>
|
||||
<div class="col-sm-8 append-text-button">%Q3%</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<div class="col-sm-4 font-weight-bold">Q4 Year</div>
|
||||
<div class="col-sm-8">%Q4%</div>
|
||||
<div class="col-sm-8 append-text-button">%Q4%</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@ -228,7 +246,13 @@
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
|
||||
$('.select2-dropdown').select2();
|
||||
$('.append-text-button').on('click', function() {
|
||||
var textToInsert = $(this).text(); // Get the text content of the clicked element
|
||||
$('#summernote-basic').summernote('focus'); // Focus on the Summernote editor
|
||||
$('#summernote-basic').summernote('editor.insertText', textToInsert); // Insert the text at the cursor position
|
||||
});
|
||||
|
||||
$('.select2-dropdown').select2();
|
||||
|
||||
$("#service_group_id").on("change", function()
|
||||
{
|
||||
@ -266,15 +290,14 @@ $("#service_group_id").on("change", function()
|
||||
|
||||
$("#savedata").on("click", function()
|
||||
{
|
||||
$('.btn-codeview').click();
|
||||
var body_html = $('#summernote-basic').summernote('code');
|
||||
formData ={
|
||||
service_group_id : $('#service_group_id').val(),
|
||||
service_id : $('#service_id').val(),
|
||||
template_id : $('#template_id').val(),
|
||||
template_header_business : $('#template_header_business').val(),
|
||||
template_name : $('#template_name').val(),
|
||||
body_text : $('.note-editable > p:first').text(),
|
||||
body_html : $('.note-codable').val(),
|
||||
body_html : body_html,
|
||||
};
|
||||
|
||||
|
||||
@ -313,12 +336,13 @@ $(document).ready(function() {
|
||||
|
||||
|
||||
$('#summernote-basic').summernote({
|
||||
height: 500,
|
||||
height: 750,
|
||||
toolbar: [
|
||||
// [groupName, [list of button]]
|
||||
['style', ['style']],
|
||||
['font', ['bold', 'italic', 'underline', 'clear' ]],
|
||||
['fontname', ['fontname']],
|
||||
['fontsize', ['fontsize']],
|
||||
['color', ['color']],
|
||||
['para', ['ul', 'ol', 'paragraph' , 'height']],
|
||||
['table', ['table']],
|
||||
@ -357,10 +381,9 @@ $(document).ready(function() {
|
||||
|
||||
setTimeout(() =>
|
||||
{
|
||||
$('.btn-codeview').click();
|
||||
$('.note-codable').val($('#body_html').val());
|
||||
$('.btn-codeview').click();
|
||||
}, 1000);
|
||||
$('#summernote-basic').summernote('code', $('#body_html').val());
|
||||
|
||||
}, 500);
|
||||
|
||||
});
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box page-title-box-alt">
|
||||
<h4 class="page-title">Service And Templates </h4>
|
||||
<h4 class="page-title">Templates List</h4>
|
||||
<div class="page-title-right">
|
||||
<a href="<?= base_url('template_create'); ?>" class="btn btn-primary waves-effect waves-light">
|
||||
Create New
|
||||
|
||||
@ -4,12 +4,15 @@
|
||||
<div class="card-body">
|
||||
|
||||
<div class="template-header">
|
||||
<?php echo $businessData->header_html; ?>
|
||||
</div>
|
||||
|
||||
<div class="template-body">
|
||||
<?php echo $body_html; ?>
|
||||
</div>
|
||||
|
||||
<?php echo $body_html; ?>
|
||||
|
||||
<div class="template-footer">
|
||||
<?php echo $businessData->footer_html; ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user