-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsaveContract.txt
63 lines (51 loc) · 2.28 KB
/
saveContract.txt
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
<?php
require('db.php');
if(isset($_POST['ID']) && isset($_POST['startDate']))
{ echo "working";
$id=$_REQUEST['ID'];
$startDate =$_REQUEST['startDate'];
$endDate = $_REQUEST['endDate'];
$position=$_REQUEST['position'];
$type = $_REQUEST['type'];
$query = "";
if (isset($type) && $type = 'Management') {
$query = "SELECT name FROM gdc353_1.ManagementFacility M WHERE M.name = ".$facility.";";
}
else if (isset($type) && $type = 'Educational') {
$query = "SELECT name FROM gdc353_1.EducationalFacility E WHERE E.name = ".$facility.";";
}
else {
header("Location: editEmployee.php?id=".$id);
exit("Educational or Management contract not selected.");
}
$facilities = mysqli_query($conn, $query) or die (mysqli_error($conn));
if ($type = 'Educational') {
if (strcmp($postion,'teacher') == 0) { ?>
<form action = "saveTeacher.php" name="teacher" method="post">
<input name="ID" type="hidden" value="<?php echo $row['ID'] ?>" />
<p>Type of teacher</p>
<input type="radio" name="level"
<?php if (isset($level) && $level=="Primary") echo "checked";?>
value="Primary">Primary
<input type="radio" name="level"
<?php if (isset($level) && $level=="Secondary") echo "checked";?>
value="Secondary">Secondary
<input type="radio" name="level"
<?php if (isset($level) && $gender=="Tertiary") echo "checked";?>
value="Tertiary">Tertiary
<input type="text" name = "Specialization"
<?php if (isset($level) && ($level=="Primary" || $level=="Tertiary")) echo "disabled";?>
value="Specialization">Specialization
</div>
</form>
echo "<p>".$type." Facilities: </p>";
while($row = mysqli_fetch_assoc($facilities)) {
echo "<p>".$row['name']."</p>";
}
<?php
}
}
header("Location: editEmployee.php?id=".$id);
exit();
}
?>