diff --git a/admin/.htaccess b/admin/.htaccess
new file mode 100644
index 0000000..1dbe967
--- /dev/null
+++ b/admin/.htaccess
@@ -0,0 +1,16 @@
+
+AuthType Basic
+AuthName "Iolovolio ADMIN"
+AuthUserFile /www/iolovolio/admin/.htpasswd
+Require valid-user
+
+RewriteEngine On
+RewriteCond %{REQUEST_FILENAME} !-f
+RewriteRule ^([^\.]+)$ index.php?q=$1 [NC,L]
+
+#10l0v0l104dm1nPwd
+#
+# Rewritebase /
+# RewriteCond %{REQUEST_FILENAME} !-f
+# RewriteCond %{REQUEST_FILENAME} !-d
+# RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
diff --git a/admin/.htpasswd b/admin/.htpasswd
new file mode 100644
index 0000000..097cba8
--- /dev/null
+++ b/admin/.htpasswd
@@ -0,0 +1 @@
+admin:{SHA}7YC5wks0QslZEMixf4Zv25PucmU=
diff --git a/admin/index.php b/admin/index.php
new file mode 100644
index 0000000..c0f39f7
--- /dev/null
+++ b/admin/index.php
@@ -0,0 +1,48 @@
+
+
+
+
+
+
+ IoLovOlio
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/admin/orders.php b/admin/orders.php
new file mode 100644
index 0000000..6c50f9e
--- /dev/null
+++ b/admin/orders.php
@@ -0,0 +1,81 @@
+
+
+
+
+
+
+
Data
+
Articoli
+
Spedizione
+
Stato
+
Totale
+
Traking
+
+
+
+
+
+
+ = conv_date($r['date']);?>
+
+
+ pid);
+ $p = mysqli_fetch_array($qp);
+ ?>
+
+
= $p['name'];?>
+
= money_format('%.2n', $item->price);?>
+
x = $item->qty;?>
+
+
+
+
+
+
+
= $shipping->full_name;?>
+
= $shipping->address;?>
+
= $shipping->zip_code." - ".$shipping->city." (".$shipping->province.")";?>
+
+
+
+ = $r['status'];?>
+
+
+ = money_format('%.2n', $r['total']);?>
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/api/order_add.php b/api/order_add.php
index 0aa269f..820f308 100644
--- a/api/order_add.php
+++ b/api/order_add.php
@@ -15,16 +15,16 @@ $conn = $databaseService->getConnection();
$data = json_decode(file_get_contents("php://input"));
$shipping = array(
"full_name" => $data->profile->first_name." ".$data->profile->last_name,
- "address" => $data->address,
- "city" => $data->city,
- "zip_code" => $data->zip_code,
- "province" => $data->province
+ "address" => $data->profile->address,
+ "city" => $data->profile->city,
+ "zip_code" => $data->profile->zip_code,
+ "province" => $data->profile->province
);
$query = "INSERT INTO `orders`
(`id`, `uid`, `date`, `items`, `total`, `status`, `token`, `shipping`, `traking`)
VALUES (NULL, ".intval($data->uid).", NOW(), '".json_encode($data->cart)."', ".floatval($data->total).",
- 'PAID',
+ 'CREATED',
'".trim($data->token)."',
'".json_encode($shipping)."', '')";
diff --git a/components/thankyou/thankyou.html b/components/thankyou/thankyou.html
index c25b120..9670404 100644
--- a/components/thankyou/thankyou.html
+++ b/components/thankyou/thankyou.html
@@ -1,8 +1,16 @@
+ $url = $_SERVER[REQUEST_URI];
+ $url_components = parse_url($url);
+ parse_str($url_components['query'], $params);
+
+ if(isset($params['token'])) {
+ $q = mysqli_query($conn, "UPDATE orders SET status = 'PAID' WHERE token = '".$params['token']."'");
+ }
+
+?>
diff --git a/deploy.sh b/deploy.sh
index 4ef9f70..bc97809 100644
--- a/deploy.sh
+++ b/deploy.sh
@@ -15,4 +15,5 @@ done
cd ..
rsync -avz --delete --exclude '/cgi-bin/conn.conn' -e "ssh -i ./auth/marketmind.pem" ./public/* ubuntu@18.194.83.82:/var/www/iolovolio.com/
+rsync -avz --delete -e "ssh -i ./auth/marketmind.pem" ./admin/* ubuntu@18.194.83.82:/var/www/iolovolio.com/admin/
diff --git a/pages/.htaccess b/pages/.htaccess
index 74b5589..3b02d81 100644
--- a/pages/.htaccess
+++ b/pages/.htaccess
@@ -1,6 +1,8 @@
RewriteEngine On
+RewriteCond %{REQUEST_URI} !^/admin/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ index.php?q=$1 [NC,L]
+
#
# Rewritebase /
# RewriteCond %{REQUEST_FILENAME} !-f
diff --git a/src/scss/admin.scss b/src/scss/admin.scss
new file mode 100644
index 0000000..8346308
--- /dev/null
+++ b/src/scss/admin.scss
@@ -0,0 +1,10 @@
+.admin-list {
+ .list-row {
+ border-bottom: 1px solid $gray;
+ font-size: $font-14;
+
+ .col-border {
+ border-right: 1px dotted $gray;
+ }
+ }
+}
diff --git a/src/scss/forms.scss b/src/scss/forms.scss
index 7b5db9b..3c23456 100644
--- a/src/scss/forms.scss
+++ b/src/scss/forms.scss
@@ -93,6 +93,11 @@ select,
.input-text {
padding: 7px 20px;
//height: 40px;
+
+ &.input-small {
+ padding: 3px 10px;
+ font-style: $font-14;
+ }
}
.input-select {
@@ -119,7 +124,7 @@ select,
&.button-brown {
background: $brown;
color: $white;
- border: none;
+ border: 1px solid $brown;
}
&.button-white {
diff --git a/src/scss/main.scss b/src/scss/main.scss
index d6e4ff8..83a31dc 100644
--- a/src/scss/main.scss
+++ b/src/scss/main.scss
@@ -12,6 +12,7 @@
@import "../scss/icons.scss";
@import "../scss/global.scss";
@import "../scss/forms.scss";
+@import "../scss/admin.scss";
@import "./components/header/header.scss";
@import "./components/sectionHeader/sectionHeader.scss";