-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdoctor-nurse-insert.php
41 lines (33 loc) · 951 Bytes
/
doctor-nurse-insert.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
<?php
require_once('.class/acl.class.php');
require_once('.class/staff.class.php');
require_once('.class/model.class.php');
include(".views/header.php");
if($_POST && isset($_POST['nurses']) ){
$nurses_id = $_POST['nurses'];
$current_nurses = $staff->getnurses();
$current_nurses->removeAll();
foreach ($nurses_id as $a){
$nurse = new staff($a);
$success=$current_nurses->add($nurse);
}
if($success){
echo "Success!";
}else{
echo ":(";
}
}
$nurses = new staff();
$nurse_role = new role(3);
$nurses = $nurse_role->staff()->get();
echo "<div class='container'>";
echo "<h3>List of nurses</h3>";
echo "<form method='post'>";
foreach ($nurses as $nurse){
echo "<strong>- Nurse: </strong>".$nurse->firstname." ".$nurse->lastname." <input type='checkbox' name='nurses[]' value='".$nurse->id()."'/><br/>";
}
echo "<input type='submit' value='Save'/>";
echo "</form>";
echo "</div>";
?>
<?PHP include(".views/footer.php"); ?>