-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvarSession.inc.php
More file actions
65 lines (38 loc) · 1.36 KB
/
varSession.inc.php
File metadata and controls
65 lines (38 loc) · 1.36 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
session_start();
include_once("bdd/connexiondb.php");
include('php/fctGestionData.php');
$okconnectey = false;
$okuserADMIN = false;
// si une connection est détecter
if(isset($_SESSION['user_id']) || isset($_SESSION['user_pseudo']) ) {
$okconnectey = true;
$_SESSION["user_panier"] = getDataBDDPanier($_SESSION['user_id'],$BDD);
$okMonPanierEstVide = false;
if(empty($_SESSION["user_panier"]) || !isset($_SESSION["user_panier"])) {
$okMonPanierEstVide = true;
}
if($_SESSION['user_role'] == 0) {
$okuserADMIN = true;
}
}
//$Produits = readJSONFile("boutique.json");
$AllProduits = getAllBDDProduits($BDD);
//$Data_Users = readUsersXMLFile();
// JSON TO BDD
/*
$catKeys = array_keys($Produits);
foreach($catKeys as $cat) { // ^pour chaque categorie
$Pr = $Produits[$cat];
switch($cat) {
case "albums" : $CodeCat = 1; break;
case "tableaux" : $CodeCat = 2; break;
case "mode" : $CodeCat = 3; break;
}
foreach($Pr as $p) { // pour chaque produit
$req = $BDD->prepare("INSERT INTO produit (produit_title, produit_author, produit_price, produit_quantity, produit_src, produit_cat, produit_year) VALUES (?, ?, ?, ?, ?, ?, ?)");
$req->execute(array($p['Title'], $p['Author'], $p['Price'], $p['Quantity'], $p['src'], $CodeCat, $p['Year']));
}
}
*/
?>