Code cleanup and revert to php version 7.3 support
parent
7d57b449b4
commit
8e179e7b0b
|
@ -3,9 +3,9 @@
|
||||||
RewriteEngine On
|
RewriteEngine On
|
||||||
|
|
||||||
#RewriteRule ^/v1/?([*a-zA-Z0-9_-]+)$ /api/index.php?slug1=$1 [L]
|
#RewriteRule ^/v1/?([*a-zA-Z0-9_-]+)$ /api/index.php?slug1=$1 [L]
|
||||||
RewriteRule ^([*a-zA-Z0-9_-]+)(?:\/|)$ index.php?fi=$1 [L]
|
RewriteRule ^([*a-zA-Z0-9_-]+)(?:/|)$ index.php?fi=$1 [L]
|
||||||
RewriteRule ^([*a-zA-Z0-9_-]+)/([*a-zA-Z0-9_-]+)(?:\/|)$ index.php?fi=$1&sc=$2 [L]
|
RewriteRule ^([*a-zA-Z0-9_-]+)/([*a-zA-Z0-9_-]+)(?:/|)$ index.php?fi=$1&sc=$2 [L]
|
||||||
RewriteRule ^([*a-zA-Z0-9_-]+)/([*a-zA-Z0-9_-]+)/([*a-zA-Z0-9_-]+)(?:\/|)$ index.php?fi=$1&sc=$2&th=$3 [L]
|
RewriteRule ^([*a-zA-Z0-9_-]+)/([*a-zA-Z0-9_-]+)/([*a-zA-Z0-9_-]+)(?:/|)$ index.php?fi=$1&sc=$2&th=$3 [L]
|
||||||
#RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?slug=$1 [L]
|
#RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?slug=$1 [L]
|
||||||
|
|
||||||
#RewriteRule ^project/$ projects/index.php [L]
|
#RewriteRule ^project/$ projects/index.php [L]
|
||||||
|
|
|
@ -98,12 +98,12 @@ class Product {
|
||||||
return $results;
|
return $results;
|
||||||
}
|
}
|
||||||
|
|
||||||
private int $product_id;
|
private $product_id; // int
|
||||||
private int $variant_id;
|
private $variant_id; // int
|
||||||
private string $product_name;
|
private $product_name; // string
|
||||||
public ?float $price = null;
|
public $price = null; // ?float
|
||||||
public ?DateTime $price_updated = null;
|
public $price_updated = null; // ?DateTime
|
||||||
public ?int $price_age = null;
|
public $price_age = null; // ?int
|
||||||
|
|
||||||
public function __construct(int $product_id, string $product_name, int $variant_id = 0){
|
public function __construct(int $product_id, string $product_name, int $variant_id = 0){
|
||||||
$this->product_id = $product_id;
|
$this->product_id = $product_id;
|
||||||
|
@ -111,7 +111,7 @@ class Product {
|
||||||
$this->variant_id = $variant_id;
|
$this->variant_id = $variant_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getPrice(): int|false {
|
public function getPrice() { // : int|false
|
||||||
global $db;
|
global $db;
|
||||||
if(!empty($this->price)){ return $this->price; }
|
if(!empty($this->price)){ return $this->price; }
|
||||||
|
|
||||||
|
@ -138,7 +138,7 @@ class Product {
|
||||||
$productArray = array();
|
$productArray = array();
|
||||||
$productArray['name'] = $this->product_name;
|
$productArray['name'] = $this->product_name;
|
||||||
if($this->price){
|
if($this->price){
|
||||||
$productArray['price']['price'] = $this->price;
|
$productArray['price']['price'] = (float) $this->price;
|
||||||
$productArray['price']['updated'] = $this->price_updated->format('Y-m-d');
|
$productArray['price']['updated'] = $this->price_updated->format('Y-m-d');
|
||||||
$productArray['price']['age'] = $this->price_age;
|
$productArray['price']['age'] = $this->price_age;
|
||||||
$productArray['price']['store'] = "store_id";
|
$productArray['price']['store'] = "store_id";
|
||||||
|
@ -149,6 +149,6 @@ class Product {
|
||||||
}
|
}
|
||||||
|
|
||||||
class ProductGroup {
|
class ProductGroup {
|
||||||
private string $name;
|
private $name; // string
|
||||||
|
|
||||||
}
|
}
|
|
@ -40,13 +40,15 @@ class Draggable {
|
||||||
this.activeDragging = true;
|
this.activeDragging = true;
|
||||||
this.draggingElem = $(ev.currentTarget);
|
this.draggingElem = $(ev.currentTarget);
|
||||||
|
|
||||||
if($(".elemHolder").length < 1){
|
let holderElem = $(".elemHolder");
|
||||||
|
|
||||||
|
if(holderElem.length < 1){
|
||||||
$("body").append(elemHolderHtml);
|
$("body").append(elemHolderHtml);
|
||||||
}
|
}
|
||||||
this.draggingElem.clone().appendTo(".elemHolder");
|
this.draggingElem.clone().appendTo(".elemHolder");
|
||||||
this.draggingElem.css('opacity', '30%');
|
this.draggingElem.css('opacity', '30%');
|
||||||
|
|
||||||
$(".elemHolder").css('height', '').css('height', ($(".elemHolder").height()+10)+"px");
|
holderElem.css('height', '').css('height', (holderElem.height()+10)+"px");
|
||||||
}
|
}
|
||||||
else if(ev.type === "panend" && this.activeDragging){
|
else if(ev.type === "panend" && this.activeDragging){
|
||||||
// console.log("end", ev);
|
// console.log("end", ev);
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#addEmptyStore").click(ev => {
|
$("#addEmptyStore").on('click', ev => {
|
||||||
stores.push(new Store());
|
stores.push(new Store());
|
||||||
addStoreModal.hide();
|
addStoreModal.hide();
|
||||||
});
|
});
|
||||||
|
|
|
@ -121,7 +121,7 @@
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
var myModal = new bootstrap.Modal($("#receiptModal"));
|
const myModal = new bootstrap.Modal($("#receiptModal"));
|
||||||
|
|
||||||
$(".openModal").on('click', () => { myModal.show(); });
|
$(".openModal").on('click', () => { myModal.show(); });
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<?php
|
<?php
|
||||||
$projectRoot = isset($projectRoot)?$projectRoot:"";
|
$projectRoot = $projectRoot ?? "";
|
||||||
$activePage = $_SERVER['REQUEST_URI'];
|
$activePage = $_SERVER['REQUEST_URI'];
|
||||||
if($activePage == "/index.php"){ $activePage = "/"; }
|
if($activePage == "/index.php"){ $activePage = "/"; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue