|
@@ -1,77 +1,128 @@
|
|
|
|
|
+<?php
|
|
|
|
|
+$tabs = [
|
|
|
|
|
+ ["details", "Details"],
|
|
|
|
|
+ ["photos", "Photos"],
|
|
|
|
|
+ ["misc", "Misc."],
|
|
|
|
|
+];
|
|
|
|
|
+?>
|
|
|
|
|
+
|
|
|
<div class="container mt-3 py-4">
|
|
<div class="container mt-3 py-4">
|
|
|
<h2><?=($location->id ? "Edit" : "Add")?> Location</h2>
|
|
<h2><?=($location->id ? "Edit" : "Add")?> Location</h2>
|
|
|
|
|
|
|
|
<form method="post" enctype="multipart/form-data">
|
|
<form method="post" enctype="multipart/form-data">
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-lg mb-3">
|
|
|
|
|
|
|
|
|
|
- <h3>Details</h3>
|
|
|
|
|
|
|
+ <ul class="nav nav-tabs mb-3" id="location-tabs" role="tablist">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($tabs as $index => $tab_options) {
|
|
|
|
|
+ list($id, $display) = $tab_options;
|
|
|
|
|
+ $active = ($index == 0) ? "active" : "";
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link <?=$active?>" id="<?=$id?>-tab" data-toggle="tab" href="#<?=$id?>" role="tab"><?=htmlspecialchars($display)?></a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </ul>
|
|
|
|
|
|
|
|
- <div class="row mb-1">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="name">Name</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control" type="text" name="name" id="name" placeholder="Enter name" value="<?=htmlspecialchars($location->name)?>" required />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="tab-content mb-3" id="tab-content">
|
|
|
|
|
+ <div class="tab-pane fade show active" id="details" role="tabpanel" aria-labelledby="details-tab">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-lg mb-3 mb-lg-0">
|
|
|
|
|
|
|
|
- <div class="row mb-1">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="address-1">Address Line 1</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control" type="text" name="address_1" id="address-1" placeholder="Enter address line 1" value="<?=htmlspecialchars($location->address_1)?>" required />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="row mb-1">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="address-2">Address Line 2</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control" type="text" name="address_2" id="address-2" placeholder="Enter address line 2" value="<?=htmlspecialchars($location->address_2)?>" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="row mb-1">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="city">City</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control" type="text" name="city" id="city" placeholder="Enter city" value="<?=htmlspecialchars($location->city)?>" required />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="row mb-1">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="county">County</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control" type="text" name="county" id="county" placeholder="Enter county" value="<?=htmlspecialchars($location->county)?>" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="row mb-1">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="postal-code">Postal Code</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control" type="text" name="postal_code" id="postal-code" placeholder="Enter postal code" value="<?=htmlspecialchars($location->postal_code)?>" required />
|
|
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="name">Name</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="name" id="name" placeholder="Enter name" value="<?=htmlspecialchars($location->name)?>" required />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="legal-entity-name">Legal Entity Name</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="legal_entity_name" id="legal-entity-name" placeholder="Enter legal entity name" value="<?=htmlspecialchars($location->legal_entity_name)?>" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="address-1">Address Line 1</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="address_1" id="address-1" placeholder="Enter address line 1" value="<?=htmlspecialchars($location->address_1)?>" required />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="address-2">Address Line 2</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="address_2" id="address-2" placeholder="Enter address line 2" value="<?=htmlspecialchars($location->address_2)?>" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="city">City</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="city" id="city" placeholder="Enter city" value="<?=htmlspecialchars($location->city)?>" required />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="county">County</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="county" id="county" placeholder="Enter county" value="<?=htmlspecialchars($location->county)?>" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="postal-code">Postal Code</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="postal_code" id="postal-code" placeholder="Enter postal code" value="<?=htmlspecialchars($location->postal_code)?>" required />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="shop-left">Shop Name (Left)</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="shop_left" id="shop-left" placeholder="Enter shop name (left)" value="<?=htmlspecialchars($location->shop_left)?>" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="shop-right">Shop Name (Right)</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="shop_right" id="shop-right" placeholder="Enter shop name (right)" value="<?=htmlspecialchars($location->shop_right)?>" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
- <div class="row mb-1">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="shop-left">Shop Name (Left)</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control" type="text" name="shop_left" id="shop-left" placeholder="Enter shop name (left)" value="<?=htmlspecialchars($location->shop_left)?>" />
|
|
|
|
|
|
|
+ <div class="col-lg">
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(empty($location->id)) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="alert alert-info">
|
|
|
|
|
+ <i class="fal fa-fw fa-info-circle"></i> Map will become available when location is added.
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="mb-3" id="map" style="height: 330px;" data-maps data-lat="<?=$location->latitude?>" data-lng="<?=$location->longitude?>" data-zoom="14" data-marker="true" data-marker-draggable="true" data-marker-dragend-target="#map-data"></div>
|
|
|
|
|
+
|
|
|
|
|
+ <div id="map-data">
|
|
|
|
|
+ <input type="hidden" name="latitude" data-latitude value="<?=$location->latitude?>" />
|
|
|
|
|
+ <input type="hidden" name="longitude" data-longitude value="<?=$location->longitude?>" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="tab-pane fade" id="photos" role="tabpanel" aria-labelledby="photos-tab">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if($location->id) {
|
|
|
|
|
+ ?>
|
|
|
<div class="row mb-3">
|
|
<div class="row mb-3">
|
|
|
- <label class="col-sm-4 col-form-label" for="shop-right">Shop Name (Right)</label>
|
|
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="photo">JPEG File</label>
|
|
|
<div class="col-sm">
|
|
<div class="col-sm">
|
|
|
- <input class="form-control" type="text" name="shop_right" id="shop-right" placeholder="Enter shop name (right)" value="<?=htmlspecialchars($location->shop_right)?>" />
|
|
|
|
|
|
|
+ <input class="form-control-file" type="file" name="photo" id="photo" />
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
-
|
|
|
|
|
- <?php
|
|
|
|
|
- if($location->id) {
|
|
|
|
|
- ?>
|
|
|
|
|
- <h3>Add Photo</h3>
|
|
|
|
|
-
|
|
|
|
|
- <div class="row mb-3">
|
|
|
|
|
- <label class="col-sm-4 col-form-label" for="photo">JPEG File</label>
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <input class="form-control-file" type="file" name="photo" id="photo" />
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
-
|
|
|
|
|
<?php
|
|
<?php
|
|
|
if(!empty($photos)) {
|
|
if(!empty($photos)) {
|
|
|
?>
|
|
?>
|
|
@@ -98,35 +149,40 @@
|
|
|
</div>
|
|
</div>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
?>
|
|
?>
|
|
|
- </div>
|
|
|
|
|
- <div class="col-lg">
|
|
|
|
|
-
|
|
|
|
|
- <h3>Map</h3>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ <div class="alert alert-info">
|
|
|
|
|
+ <i class="fal fa-fw fa-info-circle"></i> Adding photos will become available when location is added.
|
|
|
|
|
+ </div>
|
|
|
<?php
|
|
<?php
|
|
|
- if(empty($location->id)) {
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="alert alert-info">
|
|
|
|
|
- <i class="fal fa-fw fa-info-circle"></i> Map will become available when location is added.
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="tab-pane fade" id="misc" role="tabpanel" aria-labelledby="misc-tab">
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="region">Region</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="region" id="region" placeholder="Enter region" value="<?=htmlspecialchars($location->region)?>" />
|
|
|
</div>
|
|
</div>
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="mb-3" id="map" style="height: 330px;" data-maps data-lat="<?=$location->latitude?>" data-lng="<?=$location->longitude?>" data-zoom="14" data-marker="true" data-marker-draggable="true" data-marker-dragend-target="#map-data"></div>
|
|
|
|
|
-
|
|
|
|
|
- <div id="map-data">
|
|
|
|
|
- <input type="hidden" name="latitude" data-latitude value="<?=$location->latitude?>" />
|
|
|
|
|
- <input type="hidden" name="longitude" data-longitude value="<?=$location->longitude?>" />
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="internal-id">Internal ID</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="internal_id" id="internal-id" placeholder="Enter internal ID" value="<?=htmlspecialchars($location->internal_id)?>" />
|
|
|
</div>
|
|
</div>
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
-
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="row mb-1">
|
|
|
|
|
+ <label class="col-sm-4 col-form-label" for="area-manager">Area Manager</label>
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <input class="form-control" type="text" name="area_manager" id="area-manager" placeholder="Enter area manager" value="<?=htmlspecialchars($location->area_manager)?>" />
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
+
|
|
|
<button class="btn btn-primary" type="submit" name="submit" value="<?=$_SESSION["csrf_token"]?>">Submit</button>
|
|
<button class="btn btn-primary" type="submit" name="submit" value="<?=$_SESSION["csrf_token"]?>">Submit</button>
|
|
|
</form>
|
|
</form>
|
|
|
</div>
|
|
</div>
|