<!-- begin #content -->
<div id="content" class="content">
<!-- begin breadcrumb -->
<ol class="breadcrumb pull-right">
<li class="breadcrumb-item"><a href="<?php echo base_url(); ?>">Dashboard</a></li>
<li class="breadcrumb-item active"><?php echo $this->security->xss_clean($page_title); ?></li>
</ol>
<!-- end breadcrumb -->
<?php if ($this->session->userdata('user_type') == 'staff'): ?>
<!-- begin page-header -->
<h1 class="page-header">
<a onclick="showAjaxModal('<?php echo base_url(); ?>modal/popup/modal_add_invoice_request');" href="javascript:;" class="btn btn-inverse m-r-5">
<i class="fa fa-plus"></i> Add Invoice Request
</a>
</h1>
<!-- end page-header -->
<?php else: ?>
<!-- begin page-header -->
<h1 class="page-header">
Your Invoice Request Details
</h1>
<!-- end page-header -->
<?php endif; ?>
<!-- begin row -->
<div class="row">
<!-- begin col-12 -->
<div class="col-md-12">
<!-- begin panel -->
<div class="panel panel-inverse">
<div class="panel-body">
<table id="data-table-buttons" class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>Item Name</th>
<th>Description</th>
<th>Cost (<?php echo $this->security->xss_clean($this->db->get_where('setting', array('item' => 'currency'))->row()->content); ?>)</th>
<th>Occurance</th>
<th>Total (<?php echo $this->security->xss_clean($this->db->get_where('setting', array('item' => 'currency'))->row()->content); ?>)</th>
<th>Status</th>
<th>PID</th>
<th>Patient Name</th>
<th>Type</th>
<th>Updated On</th>
<th>Updated By</th>
<?php if ($this->session->userdata('user_type') == 'staff'): ?>
<th></th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php
$count = 1;
$this->db->order_by('timestamp', 'desc');
if ($this->session->userdata('user_type') == 'staff') {
$invoice_requests = $this->security->xss_clean($this->db->get('invoice_request')->result_array());
} else {
$invoice_requests = $this->security->xss_clean($this->db->get_where('invoice_request', array('patient_id' => $this->session->userdata('user_id')))->result_array());
}
foreach ($invoice_requests as $row) :
?>
<tr>
<td><?php echo $count++; ?></td>
<td><?php echo $row['item']; ?></td>
<td><?php echo $row['content']; ?></td>
<td><?php echo $row['amount']; ?></td>
<td><?php echo $row['quantity']; ?></td>
<td><?php echo $row['amount'] * $row['quantity']; ?></td>
<td>
<?php
if ($row['status'] == 0) {
echo '<span class="badge badge-warning">Unpaid</span>';
} elseif ($row['status'] == 1) {
echo '<span class="badge badge-success">Paid</span>';
}
?>
</td>
<td><?php echo $this->security->xss_clean($this->db->get_where('patient', array('patient_id' => $row['patient_id']))->row()->pid); ?></td>
<td><?php echo $this->security->xss_clean($this->db->get_where('patient', array('patient_id' => $row['patient_id']))->row()->name); ?></td>
<td>
<?php
if ($row['is_custom']) {
echo '<span class="badge badge-yellow">Custom</span>';
} else {
echo '<span class="badge badge-success">Regular</span>';
}
?>
</td>
<td><?php echo date('d M, Y', $row['timestamp']); ?></td>
<td>
<?php
$staff_id = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $row['updated_by']))->row()->staff_id);
$is_doctor = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $row['updated_by']))->row()->is_doctor);
if ($is_doctor)
echo $this->security->xss_clean($this->db->get_where('doctor', array('doctor_id' => $staff_id))->row()->name);
else
echo $this->security->xss_clean($this->db->get_where('staff', array('staff_id' => $staff_id))->row()->name);
?>
</td>
<?php if ($this->session->userdata('user_type') == 'staff'): ?>
<td>
<?php if ($row['is_custom']) : ?>
<div class="btn-group">
<button type="button" class="btn btn-white btn-xs">Action</button>
<button type="button" class="btn btn-white btn-xs dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" onclick="showAjaxModal('<?php echo base_url(); ?>modal/popup/modal_edit_invoice_request/<?php echo $row['invoice_request_id']; ?>');" href="javascript:;">Edit Invoice Request</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" onclick="confirm_modal('<?php echo base_url(); ?>invoice_requests/delete/<?php echo $row['invoice_request_id']; ?>');" href="javascript:;">Remove</a>
</div>
</div>
<?php else : ?>
<div class="btn-group">
<button type="button" class="btn btn-white btn-xs">Action</button>
<button type="button" class="btn btn-white btn-xs dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="sr-only">Toggle Dropdown</span>
</button>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item" onclick="showAjaxModal('<?php echo base_url(); ?>modal/popup/modal_edit_invoice_request_occurance/<?php echo $row['invoice_request_id']; ?>');" href="javascript:;">Edit Invoice Occurance</a>
</div>
</div>
<?php endif; ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<!-- end panel -->
</div>
<!-- end col-12 -->
</div>
<!-- end row -->
</div>
<!-- end #content --> |