-
Notifications
You must be signed in to change notification settings - Fork 2
/
edit_teacher_details.php
86 lines (83 loc) · 2.44 KB
/
edit_teacher_details.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
<?PHP
session_start();
$state = $_SESSION['state'];
$slevel = $_SESSION['slevel'];
if($state=="logged_in"&&($slevel==1||$slevel==2))
{
$con = new mysqli("localhost","root","","lib_man");
$roll = $_GET['id'];
$com = "select * from teachers where tid=$roll;";
$res = mysqli_query($con,$com);
$row = mysqli_fetch_array($res);
?>
<html>
<head>
<title>
Edit Details : <?PHP echo $roll;?>
</title>
<link rel="stylesheet" type="text/css" href="style/common.css">
<link rel="stylesheet" type="text/css" href="style/display_lists.css">
</head>
<body>
<center>
<div class="main_div">
<div style="padding:240px 0;">
<div class="hr"></div>
<table>
<tr>
<th> Teacher ID </th>
<th> Name </th>
<th> Address </th>
<th> Phone </th>
<th> E-Mail </th>
<th> Delete/Edit </th>
</tr>
<tr>
<td> <?PHP echo $row[0] ?> </td>
<td> <?PHP echo $row[1] ?> </td>
<td> <?PHP echo $row[2] ?> </td>
<td> <?PHP echo $row[3] ?> </td>
<td> <?PHP echo $row[4] ?> </td>
<?PHP
if(isset($_POST['return']))
header('location:display_teacher.php');
else if(isset($_POST['edit'])&&isset($_POST['choice']))
{
$field_type = $_POST['choice'];
$id = $row[0];
echo "<script>window.open('edit_tool.php?dbtype=teachers&id=$id&field_type=$field_type','_blank','height=300px, width=300px,left=300px,top=100px,scrollbars=0,titlebar=0');
</script>";
}
else if(isset($_POST['delete']))
{
echo "<script> window.open('confirm_delete.php?dbtype=teachers&id=$roll','_blank','height=300px,width=300px,left=300px,top=100px,scrollbars=0,titlebar=0'); </script>";
}
?>
<form method="post">
<td> <input type="submit" name="delete" value="Delete Teacher"> </td>
</tr>
<tr>
<td> <input type="radio" name="choice" value="tid"></td>
<td> <input type="radio" name="choice" value="tname"></td>
<td> <input type="radio" name="choice" value="taddress"></td>
<td> <input type="radio" name="choice" value="tphone"></td>
<td> <input type="radio" name="choice" value="tmail"></td>
<td> <input type="submit" name="edit" value="Edit Detail"> </td>
</tr>
</table>
<br><br>
<div class="hr"></div>
<input type="submit" name="return" value="Return to List">
<div class="hr"></div>
</div>
</div>
</center>
</body>
<?PHP
}
else
{
session_destroy();
header('location:login.php?code=1');
}
?>