-
Notifications
You must be signed in to change notification settings - Fork 0
/
chooseWarehouse.php
35 lines (31 loc) · 1.21 KB
/
chooseWarehouse.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
<?php
session_start();
require 'conf.inc.php';
require 'functions.php';
if (isConnected() && isActivated() && isFranchisee()) {
include 'header.php';
include 'navbar.php';
?>
<form class="col-md-6 mx-auto mt-5 mb-5" action="orderWarehouse.php" method="GET">
<label>Choisir un entrepôt dans lequel commander</label>
<select class="custom-select" name="warehouse" onchange="deleteFirst(this)">
<option selected>Choisir ...</option>
<?php
$pdo = connectDB();
$queryPrepared = $pdo->prepare("SELECT idWarehouse, warehouseName FROM WAREHOUSES WHERE warehouseType = 'Entrepôt'");
$queryPrepared->execute();
$warehouses = $queryPrepared->fetchAll(PDO::FETCH_ASSOC);
foreach ($warehouses as $warehouse) {
echo '<option value="' . $warehouse['idWarehouse'] . '">' . $warehouse['warehouseName'] . '</option>';
}
?>
</select>
<button class="btn btn-primary mt-5 mb-5"><i class="fas fa-cart-arrow-down"></i> Commander</button>
</form>
<script src="scripts/choose.js"></script>
<?php
include "footer.php";
} else {
header("Location: login.php");
}
?>