/
rechercheAlbum.php
73 lines (60 loc) · 1.85 KB
/
rechercheAlbum.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
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
66
67
68
69
70
71
72
73
<?php
session_start();
require('src/classRecherche.php');
//Gestion du panier
if (isset($_SESSION["PANIER"]))
{
$panier = $_SESSION["PANIER"];
if (isset($_POST["Code_Album"]))
{
$trouve = false;
$i = 0;
while(!$trouve && $i<count($panier))
{
if ($_POST["Code_Album"] == $panier[$i][0])
{
$panier[$i][1]++;
$trouve = true;
}
$i++;
}
if (!$trouve)
$panier[] = array($_POST["Code_Album"], 1);
}
$_SESSION["PANIER"] = $panier;
}
require('include/header.php')
?>
<div class="container">
<div id="margin_bottom">
<?php if (isset($_POST["Code_Album"])){ ?>
<div class="alert alert-success" role="alert">Cette album à été ajouté dans votre panier.</div>
<?php } ?>
<div class="row">
<div class="col-lg-12">
<h2>Rechercher un album :</h2>
<form method="post" action="rechercheAlbum.php">
<input type="text" class="form-control" name="Search" placeholder="Search...">
<br>
<div class="row">
<div class="col-md-4"></div>
<div class="col-md-4">
<button type="submit" class="btn btn-primary btn-lg btn-block"> Rechercher</button></div>
<div class="col-md-4"></div>
</div>
</form>
</div>
</div>
<hr>
<div id="margin_bottom"></div>
<?php
if (isset($_POST["Search"]))
{
$recherche = $_POST["Search"];
$con = new classRecherche("ETD","ETD");
$con->rechercheAlbum($recherche);
}
?>
</div>
</div>
<?php require('include/footer.php') ?>