GWM
This commit is contained in:
parent
6b8f8db560
commit
5087ed1aff
@ -237,21 +237,24 @@ class MasterController extends BaseController
|
|||||||
|
|
||||||
public function client_docs_preview()
|
public function client_docs_preview()
|
||||||
{
|
{
|
||||||
|
if($this->session->has('is_staff_logged_in')){
|
||||||
|
$userData = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow();
|
||||||
|
}else if($this->session->has('is_client_logged_in')){
|
||||||
|
$userData = $this->ClientModel->where('client_id',$this->session->get('is_client_logged_in'))->get()->getRow();
|
||||||
|
}
|
||||||
|
|
||||||
$doc_id = $this->request->getVar('doc_id');
|
$doc_id = $this->request->getVar('doc_id');
|
||||||
$data['docData'] = $this->ClientDocsModel->docPreview($doc_id);
|
$data['docData'] = $this->ClientDocsModel->docPreview($doc_id);
|
||||||
|
|
||||||
$clientData = $this->ClientModel->where('client_id',$data['docData']->client_id)->get()->getRow();
|
$data['clientData'] = $this->ClientModel->where('client_id',$data['docData']->client_id)->get()->getRow();
|
||||||
$data['body_html'] = $data['docData']->body_html;
|
$data['body_html'] = $data['docData']->body_html;
|
||||||
foreach ($clientData as $key => $value) {
|
foreach ($data['clientData'] as $key => $value) {
|
||||||
$placeHolder = '%'.$key.'%';
|
$placeHolder = '%'.$key.'%';
|
||||||
$data['body_html'] = str_replace($placeHolder,$value,$data['body_html']);
|
$data['body_html'] = str_replace($placeHolder,$value,$data['body_html']);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
echo view('layout/header', ['Data'=>$userData]);
|
||||||
$staffdata = $this->StaffModel->where('staff_id',$this->session->get('is_staff_logged_in'))->get()->getRow();
|
|
||||||
echo view('layout/header', ['Data'=>$staffdata]);
|
|
||||||
echo view('client_docs_preview',$data);
|
echo view('client_docs_preview',$data);
|
||||||
echo view('layout/footer');
|
echo view('layout/footer');
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class ClientDocsModel extends Model
|
|||||||
public function docPreview($doc_id){
|
public function docPreview($doc_id){
|
||||||
|
|
||||||
|
|
||||||
$this->select('client_docs.is_approved ,client_docs.id as doc_id,client_docs.client_id ,template.template_name,template.body_html , services.service_name');
|
$this->select('client_docs.is_approved ,client_docs.id as doc_id,client_docs.client_id ,client_docs.updated_at,template.template_name,template.body_html , services.service_name');
|
||||||
$this->join('template', 'template.template_id = client_docs.template_id');
|
$this->join('template', 'template.template_id = client_docs.template_id');
|
||||||
$this->join('services', 'services.service_id = template.service_id');
|
$this->join('services', 'services.service_id = template.service_id');
|
||||||
$this->where('client_docs.id', $doc_id);
|
$this->where('client_docs.id', $doc_id);
|
||||||
|
|||||||
@ -16,7 +16,9 @@
|
|||||||
<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>
|
||||||
<a href="<?= base_url(''); ?>" class="btn btn-danger waves-effect waves-light"> Reject </a>
|
<a href="<?= base_url(''); ?>" class="btn btn-danger waves-effect waves-light"> Reject </a>
|
||||||
|
<?php if($docData->is_approved != 1){ ?>
|
||||||
<a href="<?= base_url(''); ?>" class="btn btn-primary waves-effect waves-light"> Approve </a>
|
<a href="<?= base_url(''); ?>" class="btn btn-primary waves-effect waves-light"> Approve </a>
|
||||||
|
<?php } ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -40,6 +42,10 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<?php if($docData->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 119.22.334' ; } ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- end col-->
|
</div><!-- end col-->
|
||||||
|
|||||||
@ -55,7 +55,7 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td><a href="#"><i class='mdi mdi-eye-outline mr-1'></i>Preview</a></td>
|
<td><a href="<?php echo base_url().'client_docs_preview?doc_id='.$value['doc_id']; ?>"><i class='mdi mdi-eye-outline mr-1'></i>Preview</a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user