-
Notifications
You must be signed in to change notification settings - Fork 0
/
product-toevoegen.php
104 lines (90 loc) · 3.71 KB
/
product-toevoegen.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
<script type="text/javascript" src="productToevoegen.js"></script>
<?php
if (!is_admin()) {
?>
<pre>
_.._
(_.-.\
.-, `
.--./ / _.-""-.
'-. (__..-" \
\ a |
',.__. ,__.-'/
'--/_.'----'`
Whale, whale, whale. What do we have here?
</pre>
<?php
}
else {
$db = connect_to_db();
?>
<!--Hieronder staan alle velden die moeten worden ingevuld, ze worden
gechecked met een javascript. De dropdown menus worden dynamisch uit de
database gehaalt.-->
<div class="centered-container">
<div class="product-toevoegen">
<form name="toevoegform" method="post" enctype="multipart/form-data" onsubmit="testall()" action="javascript:void(0)">
<div align="right">
<h1><b>Product toevoegen</b></h1>
<hr width="100%">
<b>Productspecificaties</b>
<br />
Titel: <input type="text" id="titel" name="titel" onblur="checkTekst('titel','titellabel')" /><div id='titellabel' class='label' ></div><br /> <br />
Beschrijving:
<textarea rows="5" cols="20" id="beschrijving" name="beschrijving" onblur="checkTekst('beschrijving','beschrijvinglabel')"></textarea><div id='beschrijvinglabel' class='label' ></div>
<br />
Prijs: <input type="text" id="prijs" name="prijs" onblur="checkPrijs('prijs', 'prijslabel')" /><div id='prijslabel' class='label' ></div><br />
Release date: <input type="text" id="release_date" name="release_date" onblur="checkDatum('release_date','releaselabel')" value="jjjj-mm-dd" onclick="emptydate()" /><div id='releaselabel' class='label' ></div><br />
Voorraad: <input type="text" id="voorraad" name="voorraad" onblur="checkPrijs('voorraad','voorraadlabel')" /><div id='voorraadlabel' class='label' ></div><br />
Platform:
<div class="platform">
<select name="platform" id="platform" onchange="checkDropdown('platform','platformlabel')">
<option value="" selected='selected'>
<?php
$platformsql = $db->prepare("SELECT id, naam FROM Platforms");
$platformsql->execute();
$platformsql->bind_result($platformid, $platform);
while ($platformsql->fetch()) {
?>
<option value="<?php echo $platformid; ?>"><?php echo $platform; ?></option>
<?php
}
$platformsql->free_result();
?>
+ </select>
</div><div id="platformlabel" class='label'></div>
<br/>
Genre:
<div class="genre">
<select name="genre" id="genre" onchange="checkDropdown('genre','genrelabel')">
<option value="" selected='selected'>
<?php
$genresql = $db->prepare("SELECT id, naam FROM Genres");
$genresql->execute();
$genresql->bind_result($genreid, $genre);
while ($genresql->fetch()) {
?>
<option value="<?php echo $genreid; ?>" ><?php echo $genre; ?></option>
<?php
}
$genresql->free_result();
$db->close();
?>
</select>
</div><div id='genrelabel' class='label'></div>
<br/>
<!-- Image upload to db test -->
<div>
Cover:
<input type="file" name="image" id="image" onchange="checkCover('image','coverlabel')" /><div id='coverlabel' class='label'></div>
</div>
<div align="right">
</div>
<input type="submit" value="Voeg product toe" />
</div>
</form>
</div>
</div>
<?php
}
?>