132 lines
5.6 KiB
PHP
132 lines
5.6 KiB
PHP
<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('name') ? 'has-error' : '' ?>">
|
|
<label for="name">Name</label>
|
|
<input type="text"
|
|
value="<?php echo set_value('name', (isset($item) && isset($item['name'])) ? $item['name'] : null); ?>"
|
|
name="name"
|
|
class="form-control"
|
|
>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('name') ? form_error('name') : '' ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group mb-3 <?php echo form_error('country_code') ? 'has-error' : '' ?>">
|
|
<label for="country_code">Country</label>
|
|
<select name="country_code"
|
|
id="country-code"
|
|
class="form-control <?php echo form_error('country_code') ? 'is-invalid' : ''; ?>"
|
|
data-toggle="select2">
|
|
<option value="">Select</option>
|
|
<?php
|
|
foreach($countryList as $country) {
|
|
$selected = set_value('country_code', $item['country_code']) == $country->code ? 'selected' : '';
|
|
echo '<option value="' . $country->code . '"' . $selected . '>' . $country->country . '</option>';
|
|
}
|
|
?>
|
|
</select>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('country_code') ? form_error('country_code') : '' ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group mb-3 <?php echo form_error('longitude') ? 'has-error' : '' ?>">
|
|
<label for="longitude">Longitude</label>
|
|
<input type="text"
|
|
value="<?php echo set_value('longitude', (isset($item) && isset($item['longitude'])) ? $item['longitude'] : null); ?>"
|
|
name="longitude"
|
|
class="form-control"
|
|
>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('longitude') ? form_error('longitude') : '' ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group mb-3 <?php echo form_error('type') ? 'has-error' : '' ?>">
|
|
<label for="type">Geofencing area types</label>
|
|
<select name="type"
|
|
class="form-control <?php echo form_error('type') ? 'is-invalid' : ''; ?>"
|
|
data-toggle="select2">
|
|
<option value="">Select</option>
|
|
<?php
|
|
foreach($geofencingAreaTypes as $type) {
|
|
$selected = set_value('type', $item['type']) == $type ? 'selected' : '';
|
|
echo '<option value="' . $type . '"' . $selected . '>' . ucfirst($type) . '</option>';
|
|
}
|
|
?>
|
|
</select>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('type') ? form_error('type') : '' ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-6">
|
|
<div class="form-group mb-3 <?php echo form_error('area') ? 'has-error' : '' ?>">
|
|
<label for="area">Area</label>
|
|
<input type="text"
|
|
value="<?php echo set_value('area', (isset($item) && isset($item['area'])) ? $item['area'] : null); ?>"
|
|
name="area"
|
|
class="form-control"
|
|
>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('area') ? form_error('area') : '' ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group mb-3 <?php echo form_error('city_id') ? 'has-error' : '' ?>">
|
|
<label for="city-id">City</label>
|
|
<select name="city_id"
|
|
id="city-id"
|
|
class="form-control <?php echo form_error('city_id') ? 'is-invalid' : ''; ?>"
|
|
data-toggle="select2">
|
|
<option value="">Select</option>
|
|
<?php
|
|
foreach($cityList as $city) {
|
|
$selected = set_value('city_id', $item['city_id']) == $city->id ? 'selected' : '';
|
|
echo '<option value="' . $city->id . '" ' . $selected . '>' . $city->city . '</option>';
|
|
}
|
|
?>
|
|
</select>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('city_id') ? form_error('city_id') : '' ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group mb-3 <?php echo form_error('latitude') ? 'has-error' : '' ?>">
|
|
<label for="latitude">Latitude</label>
|
|
<input type="text"
|
|
name="latitude"
|
|
value="<?php echo set_value('latitude', (isset($item) && isset($item['latitude'])) ? $item['latitude'] : null); ?>"
|
|
class="form-control <?php echo form_error('latitude') ? 'is-invalid' : ''; ?>"
|
|
>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('latitude') ? form_error('latitude') : '' ?>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group mb-3 <?php echo form_error('boundaries') ? 'has-error' : '' ?>">
|
|
<label for="boundaries">Boundaries</label>
|
|
<textarea name="boundaries" cols="30" rows="10" placeholder="Enter a json format" class="form-control"><?php echo set_value('boundaries', (isset($item) && isset($item['boundaries'])) ? $item['boundaries'] : null); ?></textarea>
|
|
<p class="text-muted">Note: please enter a Json format</p>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('boundaries') ? form_error('boundaries') : '' ?>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/assets/js/pages/geofence_area/_form.js" type="text/javascript"></script>
|