101 lines
4.1 KiB
PHP
101 lines
4.1 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('city') ? 'has-error' : '' ?>">
|
|
<label for="city">City name</label>
|
|
<input type="text"
|
|
value="<?php echo set_value('city', (isset($item) && isset($item['city_name'])) ? $item['city_name'] : null); ?>"
|
|
name="city"
|
|
class="form-control"
|
|
>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('city') ? form_error('city') : '' ?>
|
|
</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('radius') ? 'has-error' : '' ?>">
|
|
<label for="radius">Radius</label>
|
|
<input
|
|
type="text"
|
|
name="radius"
|
|
class="form-control"
|
|
value="<?php echo set_value('radius', (isset($item) && isset($item['radius'])) ? $item['radius'] : null); ?>"
|
|
>
|
|
<div class="invalid-feedback text-danger">
|
|
<?php echo form_error('radius') ? form_error('radius') : '' ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-lg-6">
|
|
<div class="form-group mb-3 <?php echo form_error('country_code') ? 'has-error' : '' ?>">
|
|
<label for="country_code">Country</label>
|
|
<select name="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('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('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>
|