-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathteacher_home.php
91 lines (70 loc) · 2.63 KB
/
teacher_home.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
<?php
include"database.php";
session_start();
if(!isset($_SESSION["TID"]))
{
echo"<script>window.open('teacher_login.php?mes=Access Denied...','_self');</script>";
}
$sql="SELECT * FROM staff WHERE TID={$_SESSION["TID"]}";
$res=$db->query($sql);
if($res->num_rows>0)
{
$row=$res->fetch_assoc();
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Teacher Home</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<?php include"navbar.php";?><br>
<div id="section">
<?php include"sidebar.php";?><br>
<h3 class="text">Welcome, <?php echo $_SESSION["TNAME"]; ?></h3><br><hr><br>
<div class="content">
<h3>Add Profile</h3><br>
<div class="lbox1">
<?php
if(isset($_POST["submit"]))
{
$target="staff/";
$target_file=$target.basename($_FILES["img"]["name"]);
if(move_uploaded_file($_FILES['img']['tmp_name'],$target_file))
{
$sql="update staff set PNO='{$_POST["pno"]}',MAIL='{$_POST["mail"]}',PADDR='{$_POST["addr"]}',IMG='{$target_file}'where TID={$_SESSION["TID"]}";
$db->query($sql);
echo "<div class='success'>Insert Success</div>";
}
}
?>
<form enctype="multipart/form-data" role="form" method="post" action="<?php echo $_SERVER["PHP_SELF"];?>">
<label> Phone No</label><br>
<input type="text" maxlength="14" required class="input3" name="pno"><br><br>
<label> E - Mail</label><br>
<input type="email" class="input3" required name="mail"><br><br>
<label> Address</label><br>
<textarea rows="5" name="addr"></textarea><br><br>
<label> Image</label><br>
<input type="file" class="input3" required name="img"><br><br>
<button type="submit" class="btn" name="submit">Add Profile Details</button>
</form>
</div>
<div class="rbox1">
<h3> Profile</h3><br>
<table border="1px">
<tr><td colspan="2"><img src="<?php echo $row["IMG"] ?>" height="100" width="100" alt="upload Pending"></td></tr>
<tr><th>Name </th> <td><?php echo $row["TNAME"] ?> </td></tr>
<tr><th>Qualification </th> <td><?php echo $row["QUAL"] ?> </td></tr>
<tr><th>Salary </th> <td> <?php echo $row["SAL"] ?> </td></tr>
<tr><th>Phone No </th> <td> <?php echo $row["PNO"] ?> </td></tr>
<tr><th>E - Mail </th> <td> <?php echo $row["MAIL"] ?> </td></tr>
<tr><th>Address </th> <td> <?php echo $row["PADDR"] ?> </td></tr>
</table>
</div>
</div>
</div>
<?php include"footer.php";?>
</body>
</html>