-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinsert_product_form.php
112 lines (83 loc) · 3.4 KB
/
insert_product_form.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<?php
session_start();
$_SESSION["group"] = get_session();
$_SESSION["log"] = get_login();
if (isset($_SESSION['userName'])) {
$root = $_SESSION['userName'];
if ($_SESSION['userName'] == 'User') {
include("configCSS_adm.html");
include("header_op.php");
} else if ($_SESSION['userName'] == 'Root') {
include("configCSS_adm.html");
include("header_op.php");
} else {
include("configCSS.html");
include("header.php");
}
} else {
include("configCSS.html");
include("header.php");
}
function get_session() {
if(isset($_SESSION['userName'])) {
return $_SESSION['userName'];
} else {
return '';
}
}
function get_login() {
if(isset($_SESSION['login'])) {
return $_SESSION['login'];
} else {
return '';
}
}
include("config.php");
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Insertion d'un produit</title>
</head>
<body>
<br><br>
<?php
if ($_SESSION['userName'] == 'User' || $_SESSION['userName'] == 'Root' ) {
?>
<form method="post" class="formulaire2" action="insert_product.php">
<p style="text-align:center">Ajouter un produit : <br></p>
<input type="radio" name="produit" class="checkoption" value="1" required> Machine <br> <!-- Machine -->
<input type="radio" name="produit" class="checkoption" value="2" required> Filament <br> <!-- Filament -->
<input type="radio" name="produit" class="checkoption" value="3" required> Accessoire <br> <!-- Accessoire -->
<p><input type="submit" value="OK"></p>
</form>
<?php
}
?>
<br><br>
<?php
if ($_SESSION['userName'] == 'Root') {
?>
<form method="post" class="formulaire2" action="insert_product_type.php">
<p style="text-align:center">Ajouter/Modifier/Supprimer un type de produit : <br></p>
Machine :
<input type="button" value="Ajouter" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=1&modif=1';">
<input type="button" value="Modifier" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=1&modif=2';">
<input type="button" value="Supprimer" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=1&modif=3';">
<br><br>
Filament :
<input type="button" value="Ajouter" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=2&modif=1';">
<input type="button" value="Modifier" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=2&modif=2';">
<input type="button" value="Supprimer" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=2&modif=3';">
<br><br>
Accessoire :
<input type="button" value="Ajouter" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=3&modif=1';">
<input type="button" value="Modifier" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=3&modif=2';">
<input type="button" value="Supprimer" onclick="window.location.href='http://localhost/ProjetSQL/insert_product_type.php?product=3&modif=3';">
</form>
<?php
}
?>
</body>
</html>