<!-- 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 -->
<!-- begin page-header -->
<h1 class="page-header">
<a onclick="showAjaxModal('<?php echo base_url(); ?>modal/popup/modal_add_inventory');" href="javascript:;" class="btn btn-inverse m-r-5">
<i class="fa fa-plus"></i> Add Inventory Item
</a>
</h1>
<!-- end page-header -->
<!-- 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>Quantity</th>
<th>Created On</th>
<th>Created By</th>
<th>Updated On</th>
<th>Updated By</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
$count = 1;
$this->db->order_by('timestamp', 'desc');
$inventory = $this->security->xss_clean($this->db->get('inventory')->result_array());
foreach ($inventory as $row) :
?>
<tr>
<td><?php echo $count++; ?></td>
<td><?php echo html_escape($row['item']); ?></td>
<td><?php echo $row['description'] ? html_escape($row['description']) : 'N/A'; ?></td>
<td><?php echo html_escape($row['quantity']); ?></td>
<td><?php echo date('d M, Y', $row['created_on']); ?></td>
<td>
<?php
$staff_id = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $row['created_by']))->row()->staff_id);
$is_doctor = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $row['created_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>
<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>
<td>
<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_inventory/<?php echo $row['inventory_id']; ?>');" href="javascript:;">Edit Item</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" onclick="confirm_modal('<?php echo base_url(); ?>inventory/delete/<?php echo $row['inventory_id']; ?>');" href="javascript:;">Remove</a>
</div>
</div>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
<!-- end panel -->
</div>
<!-- end col-12 -->
</div>
<!-- end row -->
</div>
<!-- end #content --> |