-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadd_trimester.php
executable file
·62 lines (40 loc) · 1.22 KB
/
add_trimester.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
50
51
52
53
54
55
56
57
58
59
60
61
62
<?php
/*
Author: bixbyte
For: The University Of Eastern Africa Baraton
*/
@session_start();
class trimester {
private $id= "add_trimester.php";
private $tbl_name = "trimester";
public $trim_name; public $trim_year;
public function __construct($trimester_name, $trimester_year){
include "admin_tools.php";
if(@$trimester_name != '' && @$trimester_year != ''){
$this->trim_year = @$trimester_year;
$this->trim_name = @$trimester_name;
//$this->add_trim();
}else{
$id = $this->id;
include 'main.php';
echo "<script>alert('Please re-enter the required details!');</script>";
$redirect = new redirect('new_trimester.php');
die();
}
}
public function add_trim(){
$id = $this->id;
$connect = true;
include 'main.php';
$connection->query("INSERT INTO $this->tbl_name (name, year) VALUES('$this->trim_name','$this->trim_year')", true);
if($_SESSION['query']){
$_SESSION['trimester'] = '$this->trim_name';
echo "<script>alert('Successfully inserted');</script>Trimester Added! <br/> <br />
";
$tma = new redirect("login.php");
die();
}
}
//End of Class
}
?>