-
Notifications
You must be signed in to change notification settings - Fork 0
/
medicijnaanpassen_parse.php
49 lines (39 loc) · 1.55 KB
/
medicijnaanpassen_parse.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
<?php
session_start();
include("db_connect.php");
if(!isset($_POST["naam"]) || trim($_POST["naam"]) == '' OR
!isset($_POST["beschrijving"]) || trim($_POST["beschrijving"]) == '' OR
!isset($_POST["voorraad"]) || trim($_POST["voorraad"]) == '' OR
!isset($_POST["maximalevoorraad"]) || trim($_POST["maximalevoorraad"]) == '')
{
echo "<font color='red' font size='100px'>U heeft een of meer velden niet ingevuld. Probeer het opnieuw.</font>";
header("refresh:4; url=medicijnaanpassen2.php");
exit;
}
$query = "UPDATE `medicijn`
SET `naam` = '".$_POST['naam']."',
`beschrijving` = '".$_POST['beschrijving']."',
`voorraad` = '".$_POST['voorraad']."',
`maximalevoorraad` = '".$_POST['maximalevoorraad']."',
`ophalen` = '".$_POST['ophalen']."'
WHERE `idMedicijn` = '".$_POST['medicijnid']."'";
$result = mysqli_query($connection, $query);
if ( $result )
{
echo "<font color='red' font size='50px'>Uw gegevens zijn succesvol gewijzigt. U wordt doorgestuurd naar uw accountpagina.</font>";
header("refresh:2; url=medicatie.php");
}
else
{
echo "<font color='red' font size='100px'>Er is iets fout gegaan.</font>";
header("url=medicijnaanpassen2.php");
}
?>
<html>
<link rel="stylesheet" type="text/css" href="style.css">
<link href="datetimepicker/sample in bootstrap v2/bootstrap/css/bootstrap.min.css" rel="stylesheet" media="screen">
<br><br><br>
<footer>
<?php include 'footer.php'; ?>
</footer>
</html>