first commit
This commit is contained in:
@@ -0,0 +1,101 @@
|
||||
<div class="row">
|
||||
<?php if ($this->session->flashdata('error')) { ?>
|
||||
<div class="col-12">
|
||||
<div class="alert alert-danger alert-dismissible bg-danger text-white border-0 fade show" role="alert">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<strong>Error - </strong> <?php echo $this->session->flashdata('error') ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('city') ? 'has-error' : '' ?>">
|
||||
<label for="city">City</label>
|
||||
<?php if (isset($editing) && $editing) { ?>
|
||||
<input class="form-control" type="text" value="<?php echo $item['city_name'] ?>" disabled />
|
||||
<?php } else { ?>
|
||||
<select name="city" id="city_selection"
|
||||
class="form-control <?php echo form_error('city') ? 'is-invalid' : ''; ?>"
|
||||
data-toggle="select2"
|
||||
>
|
||||
<?php
|
||||
if (!empty($item) && !empty($item['city']) && !empty($item['city_name'])) {
|
||||
echo '<option value="' . $item['city'] . '"' . 'selected >' . $item['city_name'] . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<?php } ?>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('city') ? form_error('city') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="city">City hero image</label>
|
||||
<input class="form-control" type="text" name="image_url" value="<?php echo $item['image_url'] ?? ''?>" />
|
||||
<?php
|
||||
if(!empty($item) && !empty($item['image_url'])) {
|
||||
$image_src = strpos($item['image_url'], 'http') >= 0 ? $item['image_url'] : ($storage . $item['image_url']);
|
||||
echo '<img class="city-img" src="' . $image_src . '" style="max-width: 100%; max-height: 300px;">';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
<div class="form-group mb-3 <?php echo form_error('status') ? 'has-error' : '' ?>">
|
||||
<label for="country_code">Status</label>
|
||||
<select name="status"
|
||||
class="form-control <?php echo form_error('status') ? 'is-invalid' : ''; ?>"
|
||||
data-toggle="select2">
|
||||
<?php
|
||||
foreach($cityStatus as $name => $value) {
|
||||
$selected = set_value('status', $item['status']) == $value ? 'selected' : '';
|
||||
echo '<option value="' . $value . '"' . $selected . '>' . $name . '</option>';
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<div class="invalid-feedback text-danger">
|
||||
<?php echo form_error('status') ? form_error('status') : '' ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script src="/assets/js/plugins/forms/selects/select2.min.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
window.addEventListener('load', function () {
|
||||
$('#city_selection').select2({
|
||||
placeholder: "Search by city",
|
||||
allowClear: true,
|
||||
maximumSelectionSize: 1,
|
||||
minimumInputLength: 2,
|
||||
ajax: {
|
||||
url: "/geofence_area_city/getcityAjax",
|
||||
type: "GET",
|
||||
dataType: "json",
|
||||
delay: 250,
|
||||
data: function(params) {
|
||||
const query = {
|
||||
city_name: params.term,
|
||||
page: params.page || 1,
|
||||
per_page: 20,
|
||||
};
|
||||
return query;
|
||||
},
|
||||
processResults: function(res, params) {
|
||||
const { data, total } = res;
|
||||
params.page = params.page || 1;
|
||||
return {
|
||||
results: data.map(item => ({ id: item.id, text: item.city })),
|
||||
pagination: {
|
||||
more: params.page * 20 < +total
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,35 @@
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<h4 class="page-title">Geofence area city</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title">Create new geofence area city settings</h4>
|
||||
<form action="/geofence_area_city_settings/store" method="post">
|
||||
<?php include '_form.php'; ?>
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="submit" class="btn btn-primary mr-2">Create</button>
|
||||
<a href="/geofence_area_city_settings" class="btn btn-danger">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end card-body -->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
</div> <!-- container -->
|
||||
@@ -0,0 +1,36 @@
|
||||
<!-- Start Content-->
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
<div class="row align-items-center">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box">
|
||||
<h4 class="page-title">Geofence area city</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h4 class="header-title">Edit geofence area city settings</h4>
|
||||
|
||||
<form action="/geofence_area_city_settings/<?php echo $itemId; ?>/update" method="post">
|
||||
<?php include '_form.php'; ?>
|
||||
<div class="row">
|
||||
<div class="pull-right">
|
||||
<div class="btn-group" role="group">
|
||||
<button type="submit" class="btn btn-primary mr-2">Edit</button>
|
||||
<a href="/geofence_area_city_settings" class="btn btn-danger">Cancel</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> <!-- end card-body -->
|
||||
</div> <!-- end card -->
|
||||
</div><!-- end col -->
|
||||
</div>
|
||||
<!-- end row-->
|
||||
</div> <!-- container -->
|
||||
@@ -0,0 +1,189 @@
|
||||
<style>
|
||||
.form-row + .form-row {
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.form-group label {
|
||||
width: 60px;
|
||||
}
|
||||
</style>
|
||||
<!-- 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_settings/create" class="btn btn-success">New settings</a>
|
||||
</div>
|
||||
<h4 class="page-title">Geofence area city settings</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 }?>
|
||||
<!-- end alert -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<form class="search-block form-inline search-form" action="/geofence_area_city_settings" 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" style="width: auto;">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>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<label for="lat">Latitude</label>
|
||||
<input class="form-control" type="text" name="lat" value="<?=isset($filterData['lat'])?$filterData['lat']:''?>" />
|
||||
<div class="invalid-feedback text-danger"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lat">Longitude</label>
|
||||
<input class="form-control" type="text" name="lng" value="<?=isset($filterData['lng'])?$filterData['lng']:''?>" />
|
||||
<div class="invalid-feedback text-danger"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="lat" style="width: auto;">Radius (Km)</label>
|
||||
<input class="form-control" type="number" name="radius" value="<?=isset($filterData['radius'])?$filterData['radius']:''?>" />
|
||||
<div class="invalid-feedback text-danger"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<div class="form-group">
|
||||
<button class="btn btn-primary btn-search" id="search" data-action="/geofence_area_city_settings" type="submit">Search</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<div class="table-responsive-sm">
|
||||
<table id="city-settings-datatable" class="table table-sm table-centered mb-0" width="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<th>City</th>
|
||||
<th>Country</th>
|
||||
<th>Latitude</th>
|
||||
<th>Longitude</th>
|
||||
<th>Status</th>
|
||||
<th>Image</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 ?></td>
|
||||
<td><?php echo $item->country ?></td>
|
||||
<td><?php echo $item->latitude ?></td>
|
||||
<td><?php echo $item->longitude ?></td>
|
||||
<td>
|
||||
<?php
|
||||
if ($item->status == Geofence_area_city_settings_model::ACTIVE_STATUS) {
|
||||
echo 'Active';
|
||||
} else {
|
||||
echo 'Inactive';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td>
|
||||
<?php
|
||||
if(!empty($item->image_url)) {
|
||||
$image_src = strpos($item->image_url, 'http') >= 0 ? $item->image_url : ($storage . $item->image_url);
|
||||
echo '<img class="city-img" src="' . $image_src . '" style="max-width: 100%; max-height: 300px;">';
|
||||
} else {
|
||||
echo '';
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td class="actions">
|
||||
<a href="/geofence_area_city_settings/<?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 ?>"
|
||||
data-toggle="modal"
|
||||
data-target="#remove-geofence-area-city-settings-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 -->
|
||||
|
||||
<div id="remove-geofence-area-city-settings-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_settings/list.js" type="text/javascript"></script>
|
||||
Reference in New Issue
Block a user