-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadminAddTeacherSubProcess.php
More file actions
34 lines (23 loc) · 925 Bytes
/
adminAddTeacherSubProcess.php
File metadata and controls
34 lines (23 loc) · 925 Bytes
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
<?php
session_start();
require "connection.php";
if (isset($_SESSION["admin"])) {
$Tid = $_POST["Tid"];
$s_g = $_POST["s_g"];
if ($s_g == "0") {
echo "Please select Subject";
} else {
$t = Database::search("SELECT * FROM `teacher` WHERE `t_ad_no`='" . $Tid . "' ");
$t_n = $t->num_rows;
if ($t_n == 1) {
$t_rs = $t->fetch_assoc();
if ($t_rs["section_id"] == "4") { //A/L
$tecer_has_al_sub = Database::iud("INSERT INTO `teacher_has_a/l_subjects` (`teacher_t_ad_no`,`grade_has_a/l_subjects_id`) VALUES ('" . $Tid . "' ,'" . $s_g . "') ");
echo "ok";
} else { //not A/L
$tecer_has_al_sub = Database::iud("INSERT INTO `teacher_has_subject` (`teacher_t_ad_no`,`grade_has_subject_id`) VALUES ('" . $Tid . "' ,'" . $s_g . "') ");
echo "ok";
}
}
}
}