You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
89 lines
2.2 KiB
89 lines
2.2 KiB
<?php
|
|
session_start();
|
|
|
|
@include 'cgi-bin/conn.conn';
|
|
@include 'cgi-bin/functions.inc';
|
|
@include 'cgi-bin/params.inc';
|
|
|
|
$GLOBALS['getQ'][0]="iolovolio";
|
|
$GLOBALS['isHome'] = true;
|
|
$GLOBALS['conn'];
|
|
|
|
$conn = @mysqli_connect($DATAhst,$DATAusr,$DATApwd,$DATAdtb)or die("CONNECTION ERROR");
|
|
mysqli_set_charset($conn, "utf8");
|
|
|
|
if(@$_GET['q']){ $GLOBALS['getQ'] = explode("/",$_GET['q']); }
|
|
|
|
if($_POST['login_usr'] && $_POST['login_pwd']) {
|
|
$q = mysqli_query($conn, "SELECT * FROM users WHERE email = '".trim($_POST['login_usr'])."' AND
|
|
password = '".md5(trim($_POST['login_pwd']))."'");
|
|
$r = mysqli_fetch_array($q);
|
|
|
|
if(mysqli_num_rows($q)) {
|
|
$_SESSION['AUTH'] = $r;
|
|
|
|
if($getQ[1] == 'ordini') {
|
|
$q = mysqli_query($conn, "SELECT COUNT(*) FROM orders WHERE uid = ".$_SESSION['AUTH']['id']);
|
|
if(mysqli_fetch_array($q)[0] == 0) {
|
|
header("location: /acquistare");
|
|
}
|
|
}
|
|
|
|
|
|
} else {
|
|
unset($_SESSION['AUTH']);
|
|
}
|
|
}
|
|
|
|
if($getQ[0]!="iolovolio"){ $isHome = false; }
|
|
if($getQ[0]=="thankyou"){ unset($_SESSION['CART']); }
|
|
if($getQ[0]=="logout"){
|
|
unset($_SESSION['CART']);
|
|
unset($_SESSION['AUTH']);
|
|
header("location: /");
|
|
}
|
|
|
|
|
|
?>
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="it">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<title>IoLovOlio</title>
|
|
<meta name="viewport" content="width=device-width, user-scalable=no,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0">
|
|
<meta name="description" content=".">
|
|
<link rel="stylesheet" href="/assets/css/styles.css">
|
|
<?= "<script>sessionStorage.setItem('sid','".session_id()."');</script>";?>
|
|
</head>
|
|
<body>
|
|
|
|
${require('../components/header/header.html')}
|
|
|
|
<main class="main-content">
|
|
|
|
<?php
|
|
@include $getQ[0].'.php';
|
|
?>
|
|
|
|
</main>
|
|
|
|
${require('../components/footer/footer.html')}
|
|
|
|
|
|
<div class="loader">
|
|
<img src="/images/logoHeader.png" class="spinner">
|
|
</div>
|
|
|
|
<div class="notification"></div>
|
|
|
|
<?php
|
|
if($getQ[0] == 'checkout' || $getQ[0] == 'account') {
|
|
?>
|
|
<script src="https://www.google.com/recaptcha/api.js?render=${ENV.RECAPTCHA_SITE_KEY}"></script>
|
|
<?php
|
|
}
|
|
?>
|
|
|
|
</body>
|
|
</html>
|