Jelajahi Sumber

Added opening hours field.

Alan Lam 8 tahun lalu
induk
melakukan
03ed579a2e

+ 1 - 0
controllers/location_add.php

@@ -26,6 +26,7 @@ if($submit) {
 		$location->city = http::value("city", "trim");
 		$location->city = http::value("city", "trim");
 		$location->county = http::value("county", "trim");
 		$location->county = http::value("county", "trim");
 		$location->postal_code = http::value("postal_code", "trim");
 		$location->postal_code = http::value("postal_code", "trim");
+		$location->opening_hours = http::value("opening_hours", "trim");
 
 
 		$location->shop_left = http::value("shop_left", "trim");
 		$location->shop_left = http::value("shop_left", "trim");
 		$location->shop_right = http::value("shop_right", "trim");
 		$location->shop_right = http::value("shop_right", "trim");

+ 1 - 0
controllers/location_edit.php

@@ -21,6 +21,7 @@ if($submit) {
 		$location->city = http::value("city", "trim");
 		$location->city = http::value("city", "trim");
 		$location->county = http::value("county", "trim");
 		$location->county = http::value("county", "trim");
 		$location->postal_code = http::value("postal_code", "trim");
 		$location->postal_code = http::value("postal_code", "trim");
+		$location->opening_hours = http::value("opening_hours", "trim");
 
 
 		$location->shop_left = http::value("shop_left", "trim");
 		$location->shop_left = http::value("shop_left", "trim");
 		$location->shop_right = http::value("shop_right", "trim");
 		$location->shop_right = http::value("shop_right", "trim");

+ 1 - 1
engine/location.php

@@ -4,7 +4,7 @@ class Location extends Model {
 
 
 	protected static $table = "location";
 	protected static $table = "location";
 	protected static $id_field = "id";
 	protected static $id_field = "id";
-	protected static $fillable_fields = ["customer_id", "name", "legal_entity_name", "address_1", "address_2", "city", "county", "postal_code", "state", "country", "email", "phone", "shop_left", "shop_right", "region", "internal_id", "area_manager", "latitude", "longitude", "dts_verified"];
+	protected static $fillable_fields = ["customer_id", "name", "legal_entity_name", "address_1", "address_2", "city", "county", "postal_code", "state", "country", "email", "phone", "opening_hours", "shop_left", "shop_right", "region", "internal_id", "area_manager", "latitude", "longitude", "dts_verified"];
 
 
 	protected static $field_map = [
 	protected static $field_map = [
 	];
 	];

+ 7 - 0
views/location_form.php

@@ -88,6 +88,13 @@ $tabs = [
 								<input class="form-control" type="text" name="phone" id="phone" placeholder="Enter contact number" value="<?=htmlspecialchars($location->phone)?>" />
 								<input class="form-control" type="text" name="phone" id="phone" placeholder="Enter contact number" value="<?=htmlspecialchars($location->phone)?>" />
 							</div>
 							</div>
 						</div>
 						</div>
+
+						<div class="row mb-1">
+							<label class="col-sm-4 col-form-label" for="opening-hours">Opening Hours</label>
+							<div class="col-sm">
+								<textarea class="form-control" name="opening_hours" id="opening-hours" placeholder="Enter opening hours" rows="4" maxlength="100"><?=htmlspecialchars($location->opening_hours)?></textarea>
+							</div>
+						</div>
 					</div>
 					</div>
 					<div class="col-lg">
 					<div class="col-lg">