-
Notifications
You must be signed in to change notification settings - Fork 0
/
carrello.php
33 lines (29 loc) · 1023 Bytes
/
carrello.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
require_once 'initializer.php';
$templateParams["js"] = ["js/carrello.js"];
if(isUserLoggedIn()){
$templateParams["metodidipagamento"] = $dbh->getPaymentCards($_SESSION["idUtente"]);
$templateParams["biglietti"] = $dbh->getCartByUser($_SESSION["idUtente"]);
if(!empty($templateParams["biglietti"])){
$templateParams["idAcquisto"] = $templateParams["biglietti"][0]["IdAcquisto"];
}
else{
$templateParams["idAcquisto"] = -1;
}
}else{
if(isset($_COOKIE["idAcquisto"])){
$templateParams["biglietti"] = $dbh->getCartByCart($_COOKIE["idAcquisto"]);
if(!empty($templateParams["biglietti"])){
$templateParams["idAcquisto"] = $_COOKIE["idAcquisto"];
}
else{
$templateParams["idAcquisto"] = -1;
}
}else{
$templateParams["idAcquisto"] = -1;
}
}
$templateParams["titolo"] = "TicketTwo";
$templateParams["nome"] = "template/carrello.php";
require 'template/base.php';
?>