forked from StandeBoer/PvB
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModalAddCriterium.php
More file actions
59 lines (58 loc) · 2.96 KB
/
ModalAddCriterium.php
File metadata and controls
59 lines (58 loc) · 2.96 KB
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
<div id="ModalAddCriterium" class="modal" style="height:100%">
<div class="modal-header" style="padding-left: 24px;">
<h5>Criterium toevoegen</h5>
</div>
<div class="modal-content">
<!-- CODE VOOR CRITERIUM TOEVOEGEN BACK-END -->
<?php
$get_kerntaak_criterium = "SELECT * FROM kerntaak";
$result_kerntaak_criterium = $conn->query($get_kerntaak_criterium);
if ($result_kerntaak_criterium->num_rows > 0) {
?>
<label>Om een criterium toe te voegen selecteert u eerst de bijbehorende kerntaak en daarna het werkproces:</label>
<br><br>
<form method="POST">
<select name="kerntaak_criterium_option" required>
<option selected="selected" value="0" disabled>Kies een kerntaak</option>
<?php
while ($row_kerntaak_criterium = $result_kerntaak_criterium->fetch_assoc()) {
?>
<option value="<?php echo $row_kerntaak_criterium["kerntaak_id"] ?>"><?php echo $row_kerntaak_criterium["kerntaak_naam"] ?></option>
<?php
}
?>
</select>
<select name="werkproces_criterium_option" class="hide">
<option selected="selected" value="" disabled>Kies een werkproces</option>
</select>
<input type="text" class="hide" name="criterium_oms" placeholder="Criterium omschrijving" required>
<button class="btn waves-effect waves-light hide" type="submit" name="new_criterium_submit">Versturen</button>
<a href="#!" class="modal-action modal-close waves-effect waves-green btn btn-success">Sluiten</a>
</form>
<?php
}
if (isset($_POST['new_criterium_submit'])) {
// echo 'hoi <br>';
if (isset($_POST['kerntaak_criterium_option'])) {
// echo 'kerntaak gezet <br>';
if (isset($_POST['werkproces_criterium_option'])) {
$werkproces_id = $_POST['werkproces_criterium_option'];
// echo $r;
// echo 'werkproces gezet<br>';
if (isset($_POST['criterium_oms'])) {
$criterium_omschrijving = $_POST['criterium_oms'];
// echo $criterium_omschrijving;
$add_criterium = "INSERT INTO werkproces_criterium (werkproces_criterium_naam, werkproces_id) VALUES ('" . $criterium_omschrijving . "','" . $werkproces_id . "')";
if ($conn->query($add_criterium) === TRUE) {
// echo "Klas is toegevoegd";
} else {
// echo "FOUTMELDING! Probeer opnieuw";
}
}
}
}
}
?>
<!--EINDE CODE VOOR CRITERIUM TOEVOEGEN BACKEND -->
</div>
</div>