<!-- 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"><a href="<?php echo base_url(); ?>transport_categories">Transport Categories</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_transport/<?php echo $transport_category_id; ?>');" href="javascript:;" class="btn btn-inverse m-r-5">
<i class="fa fa-plus"></i> Add <?php echo $this->security->xss_clean($this->db->get_where('transport_category', array('transport_category_id' => $transport_category_id))->row()->name); ?>
</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>Transport Number</th>
<th>Status</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');
$transports = $this->security->xss_clean($this->db->get_where('transport', array('transport_category_id' => $transport_category_id))->result_array());
foreach ($transports as $transport) :
?>
<tr>
<td><?php echo $count++; ?></td>
<td><?php echo $transport['transport_number']; ?></td>
<td>
<?php
if ($transport['status'] == 0)
echo '<span class="badge badge-warning">Inactive</span>';
elseif ($transport['status'] == 1)
echo '<span class="badge badge-success">Active</span>';
?>
</td>
<td><?php echo date('d M, Y', $transport['created_on']); ?></td>
<td>
<?php
$staff_id = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $transport['updated_by']))->row()->staff_id);
$is_doctor = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $transport['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><?php echo date('d M, Y', $transport['timestamp']); ?></td>
<td>
<?php
$staff_id = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $transport['updated_by']))->row()->staff_id);
$is_doctor = $this->security->xss_clean($this->db->get_where('user', array('user_id' => $transport['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_transport/<?php echo $transport['transport_category_id']; ?>/<?php echo $transport['transport_id']; ?>');" href="javascript:;">Edit Details</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" onclick="confirm_modal('<?php echo base_url(); ?>transports/delete/<?php echo $transport['transport_category_id']; ?>/<?php echo $transport['transport_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 --> |