Files
dev-chiefworks f76abffdcd first commit
2022-05-31 16:21:53 -04:00

148 lines
6.4 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!-- Start Content-->
<div class="container-fluid">
<!-- start page title -->
<div class="row align-items-center">
<div class="col-12">
<div class="page-title-box">
<div class="page-title-right text-right action">
<a href="/trips/create" class="btn btn-success">Create trip</a>
</div>
<h4 class="page-title">Trips</h4>
</div>
</div>
</div>
<!-- end page title -->
<!-- start alert -->
<?php if ($this->session->flashdata('success')) { ?>
<div class="col-12">
<div class="alert alert-success alert-dismissible bg-success text-white border-0 fade show" role="alert">
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<?php echo $this->session->flashdata('success') ?>
</div>
</div>
<?php } ?>
<!-- end alert -->
<div class="row">
<div class="col-12">
<div class="card">
<div class="card-body">
<form action="/trips" method="get" class="filter-block py-3">
<div class="row">
<div class="col-sm-5 col-lg-3">
<div class="form-group">
<label for="travel-date-filter">Travel date</label>
<input type="text" name="travel_date" class="form-control date" value="<?php echo empty($filterData['travel_date']) ? '' : $filterData['travel_date']; ?>" id="travel-date-filter" data-cancel-class="btn-warning">
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label for="duration">Duration (days)</label>
<input type="text" value="<?php echo empty($filterData['duration']) ? '' : $filterData['duration']; ?>" class="form-control" id="duration" name="duration">
</div>
</div>
<div class="col-sm-2">
<div class="form-group">
<label for="distance">Distance (Km)</label>
<input type="text" value="<?php echo empty($filterData['distance']) ? '' : $filterData['distance']; ?>" class="form-control" id="distance" name="distance">
</div>
</div>
<div class="col-sm-3 col-lg-2">
<div class="form-group">
<label for="cost">Cost (USD)</label>
<input class="form-control search-input" value="<?php echo empty($filterData['cost']) ? '' : $filterData['cost']; ?>" id="cost" name="cost" type="text" placehoder="Cost" />
</div>
</div>
<div class="col-sm-3">
<div class="form-group">
<label for="cost">Transport provider</label>
<select name="transport_provider_id" class="form-control select2" data-toggle="select2">
<option value="">Select</option>
<optgroup label="Public transport">
<option value="1" <?php echo (!empty($filterData['transport_provider_id']) && $filterData['transport_provider_id'] == '1') ? 'selected' : '' ?>>Bus</option>
<option value="2" <?php echo (!empty($filterData['transport_provider_id']) && $filterData['transport_provider_id'] == '2') ? 'selected' : '' ?>>Trains</option>
</optgroup>
</select>
</div>
</div>
<div class="col-12 text-right">
<button type="button" class="btn-reset-fitler-form btn btn-danger mt-2">Reset</button>
<button type="submit" class="btn btn-primary mt-2">Filter</button>
</div>
</div>
</form>
<div class="table-responsive-sm">
<table id="trips-datatable" class="table table-sm table-centered mb-0" width="100%">
<thead>
<tr>
<th>Start Date</th>
<th>End Date</th>
<th>Start place</th>
<th>End place</th>
<th>Distance</th>
<th>Cost</th>
<th class="actions">Actions</th>
</tr>
</thead>
<tbody class="table-striped">
<?php foreach($list as $item): ?>
<tr>
<td><?php echo $item['travel_date'] ?></td>
<td><?php echo $item['travel_date_end'] ?></td>
<td><?php echo $item['location_start_id'] ?></td>
<td><?php echo $item['location_end_id'] ?></td>
<td><?php echo $item['distance'] ?></td>
<td><?php echo $item['cost'] ?></td>
<td class="actions">
<a href="/trips/<?php echo $item['id']; ?>/edit" class="btn btn-primary">View</a>
<button
type="button"
class="btn btn-danger btn-remove"
data-id="<?php echo $item['id'] ?>"
data-toggle="modal"
data-target="#remove-trip-warning-modal"
>Remove</button>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<?php echo $pagination ?>
</div> <!-- end card body-->
</div> <!-- end card -->
</div><!-- end col-->
</div>
<!-- end row-->
</div> <!-- container -->
<!-- remove trip modal -->
<div id="remove-trip-warning-modal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="warning-header-modalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header modal-colored-header bg-warning">
<h4 class="modal-title" id="warning-header-modalLabel"></h4>
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
</div>
<div class="modal-body">
<h5 class="mt-0">Remove warning</h5>
<p>This can not be undone. Do you want to conitnue?</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-light" data-dismiss="modal">Close</button>
<button type="button" class="btn btn-warning" id="removeBtn" data-id="">Continue</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<script src="/assets/js/pages/trips/trips.js"></script>