169 lines
6.8 KiB
PHP
169 lines
6.8 KiB
PHP
<!-- 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="/geofence_area_city/create" class="btn btn-success">New geofence area city</a>
|
||
</div>
|
||
<h4 class="page-title">Geofence area city</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" role="alert">
|
||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
<?php echo $this->session->flashdata('success') ?>
|
||
</div>
|
||
</div>
|
||
<?php }?>
|
||
<?php if ($this->session->flashdata('warning')) {?>
|
||
<div class="col-12">
|
||
<div class="alert alert-warning alert-dismissible bg-waring" role="alert">
|
||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||
<span aria-hidden="true">×</span>
|
||
</button>
|
||
<?php echo $this->session->flashdata('warning') ?>
|
||
</div>
|
||
</div>
|
||
<?php }?>
|
||
<!-- end alert -->
|
||
|
||
<div class="row">
|
||
<div class="col-12">
|
||
<div class="card">
|
||
<div class="card-body">
|
||
<form class="search-block form-inline" action="/geofence_area_city" method="get">
|
||
<div class="row">
|
||
<div class="form-row">
|
||
<div class="form-group">
|
||
<label for="search_text">Keywords</label>
|
||
<input type="text" class="form-control" name="search_text" value='<?=isset($filterData['search_text'])?$filterData['search_text']:''?>'>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="country_code">Country</label>
|
||
<select name="country_code"
|
||
class="form-control"
|
||
data-toggle="select2">
|
||
<option value="">Select</option>
|
||
<?php
|
||
foreach ($countryList as $country) {
|
||
$selected = set_value('country_code', $filterData['country_code']) == $country->code ? 'selected' : '';
|
||
echo '<option value="' . $country->code . '"' . $selected . '>' . $country->country . '</option>';
|
||
}
|
||
?>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<label for="status">Status</label>
|
||
<select name="status"
|
||
class="form-control"
|
||
data-toggle="select2">
|
||
<option value="">Select</option>
|
||
<?php
|
||
foreach ($cityStatus as $status=>$status_name) {
|
||
echo '<option value="' . $status . '"' . ((isset($filterData['status']) && $filterData['status'] == $status) ? 'selected' : '') . '>' .$status_name . '</option>';
|
||
}
|
||
?>
|
||
</select>
|
||
</div>
|
||
<div class="form-group">
|
||
<button class="btn btn-primary btn-search" type="submit">Search</button>
|
||
</div>
|
||
<div class="form-group">
|
||
<button class="btn btn-warning" type="button" onclick="cleanUp()">CleanUp</button>
|
||
</div>
|
||
</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>Id</th>
|
||
<th>City name</th>
|
||
<th>Country name</th>
|
||
<th>Latitude</th>
|
||
<th>Longitude</th>
|
||
<th>Radius</th>
|
||
<th>Status</th>
|
||
<th class="actions">Actions</th>
|
||
</tr>
|
||
</thead>
|
||
|
||
<tbody class="table-striped">
|
||
<?php foreach ($list as $item): ?>
|
||
<tr>
|
||
<td><?php echo $item->id ?></td>
|
||
<td id="lbl_city_name_<?php echo $item->id ?>"><?php echo $item->city_name ?></td>
|
||
<td><?php echo $item->country_name ?></td>
|
||
<td><?php echo $item->latitude ?></td>
|
||
<td><?php echo $item->longitude ?></td>
|
||
<td><?php echo $item->radius ?></td>
|
||
<td>
|
||
<?php
|
||
if ($item->status == Geofence_area_city_model::ACTIVE_STATUS) {
|
||
echo 'Active';
|
||
} else {
|
||
echo 'Inactive';
|
||
}
|
||
?>
|
||
</td>
|
||
<td class="actions">
|
||
<a href="/geofence_area_city/<?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-city-name="<?php echo $item->city_name ?>"
|
||
data-toggle="modal"
|
||
data-target="#remove-geofence-area-city-modal"
|
||
>Remove</button>
|
||
<button
|
||
onclick ="correctName('lbl_city_name_<?php echo $item->id ?>','<?php echo $item->id ?>','<?php echo $item->latitude ?>','<?php echo $item->longitude ?>');"
|
||
type="button"
|
||
class="btn btn-success btn-remove">Correct</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 -->
|
||
|
||
<div id="remove-geofence-area-city-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/app.js" type="text/javascript"></script>
|
||
<script src="/assets/js/pages/geofence_area_city/list.js" type="text/javascript"></script>
|