-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
92 lines (78 loc) · 3.62 KB
/
index.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php
session_start();
include('server.php');
/*!-- logged in user information --*/
$id = $_SESSION['username'];
$query = " SELECT * FROM teacher_users WHERE username = '$id' ";
$result = mysqli_query($conn, $query);
while ($row = mysqli_fetch_array($result)) {
$name = $row['name'];
$faculty = $row['faculty'];
$department = $row['department'];
$course_ID = $row['course_ID'];
}
date_default_timezone_set("Asia/Bangkok");
$currentDate = date("j F Y h:i A") . "<br>";
/*!-- no username --*/
if (!isset($_SESSION['username'])) {
$_SESSION['msg'] = "You must log in first";
header('location: login.php');
}
/*!-- logout --*/
if (isset($_GET['logout'])) {
session_destroy();
unset($_SESSION['username']);
header('location: login.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>หน้าหลัก</title>
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.1/css/all.min.css">
<link href="https://fonts.googleapis.com/css2?family=Prompt&display=swap" rel="stylesheet">
</head>
<body>
<input type="checkbox" id="check">
<!--header area start-->
<header>
<label for="check">
<i class="fas fa-bars" id="sidebar_btn"></i>
</label>
<div class="left_area">
<h3>ระบบเพิ่มรายวิชา <span>อาจารย์</span></h3>
<div class="right_area">
<a class="right_head"><?php echo $name; ?></a>
</div>
</div>
</header>
<!--header area end-->
<!--sidebar start -->
<div class="sidebar">
<center>
<img src="chula_logo_index.jpg" class="profile_image" alt="">
<h4>Chulalongkorn University</h4>
</center>
<div class="choose"><a href="index.php"><i class="fas fa-home"></i><span>หน้าหลัก</span></a></div>
<a href="course.php"><i class="fas fa-table"></i><span>อนุมัติเพิ่มรายวิชา</span></a>
<a href="history.php"><i class="fas fa-history"></i><span>ประวัติการอนุมัติ</span></a>
<a href="index.php?logout='1'" style="color: #e37aa1;"><i class="fas fa-power-off"></i><span>ออกจากระบบ</span></a>
<div class="sidebar_info_user">
<p><?php echo $currentDate; ?></p>
<p><?php echo $name; ?></p>
<p><?php echo $department; ?></p>
<p><?php echo $faculty; ?></p>
</div>
</div>
<!--sidebar end-->
<div class="content">
<h1>ยินดีต้อนรับเข้าสู่ <span>ระบบเพิ่มรายวิชา</span></h1>
<p style="padding-top: 120px;">กรุณาเลือกบริการที่ต้องการจากรายการด้านซ้ายมือ \ (^-^) /</p>
<p><a>ท่านจะออกจากระบบโดยอัตโนมัติ เมื่อหยุดการติดต่อนานเกิน 10 นาที</a></p>
<p>ท่านต้องกด <a>ออกจากระบบ</a> ทุกครั้งที่เสร็จสิ้นการใช้งาน เพื่อมิให้ผู้อื่นเข้าใช้งาน ในชื่อของท่านได้</p>
</div>
</body>
</html>