-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgetinfo.php
97 lines (83 loc) · 2.89 KB
/
getinfo.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
93
94
95
96
97
<?php
error_reporting(0);
// Checking if logged in
if (!isset($_SESSION['login'])) {
echo '<script>window.location="http://localhost/IMS/Dashboard/Login"</script>';
}
//Selecting Table for information
// echo "string";
// echo $_SESSION['login'];
$user_id=$_SESSION["user_id"];
$root_table=$_SESSION["root_table"];
if($root_table=="staff")
{
$user_id=$_SESSION["user_id"];
$sql="SELECT * from $root_table WHERE staff_id='$user_id'";
$query=mysqli_query($conn,$sql);
$fetch=mysqli_fetch_array($query);
$Name=$fetch['name'];
$Username=$fetch['username'];
$Image=$fetch['staff_image'];
$Designation=$fetch['designation'];
$Department=$fetch['department'];
$Email=$fetch['staff_email'];
$Address=$fetch['address'];
$Phone=$fetch['phone'];
// $t_code=$fetch['teacher_code'];
// $address=$fetch['Address'];
// $phone_no=$fetch['Phone_no'];
// Storing Session Values
$_SESSION["Email"]=$Email;
$_SESSION["Image"]=$Image;
$_SESSION["Name"]=$Name;
$_SESSION["Designation"]=$Designation;
$_SESSION["Department"]=$Department;
$_SESSION["Address"]=$Address;
$_SESSION["Phone_no"]=$Phone;
$_SESSION["username"]=$Username;
// if($designation=="administrator007")
// {
// $_SESSION['admin'] = true;
// }
// else{
// $_SESSION['admin']=false;
// }
}
if($root_table=="student")
{
$user_id=$_SESSION["user_id"];
$sql="SELECT * from $root_table WHERE student_id='$user_id'";
$query=mysqli_query($conn, $sql);
$fetch=mysqli_fetch_array($query);
$Name=$fetch['name'];
$Username=$fetch['username'];
$roll_no=$fetch['roll_no'];
$Image=$fetch['student_image'];
$Department=$fetch['department'];
$Class=$fetch['class'];
$Address=$fetch['address'];
$Phone=$fetch['phone'];
$Registration_no=$fetch['registration_number'];
$Email=$fetch['student_email'];
// $Batch=$fetch['Batch'];
if ($Image=="stu_image") {
$Image="http://localhost/IMS/Dashboard/Profile/student.jpg";
}
// Storing Session Values
$_SESSION["Email"]=$Email;
$_SESSION["Address"]=$Address;
$_SESSION["Image"]=$Image;
$_SESSION["Phone_no"]=$Phone;
$_SESSION["Name"]=$Name;
$_SESSION["roll_no"]=$roll_no;
$_SESSION["Department"]=$Department;
$_SESSION["username"]=$Username;
// $_SESSION["Registration_no"]=$Registration_no;
// $_SESSION['Batch']=$Batch;
// $sql="SELECT * from present where batch='$Batch'";
// $query=mysqli_query($conn,$sql);
// $fetch=mysqli_fetch_array($query);
// $Semester=$fetch['Semester'];
// $_SESSION["Semester"]=$Semester;
}
?>