-
Notifications
You must be signed in to change notification settings - Fork 17
/
View_Students.php
116 lines (98 loc) · 4.15 KB
/
View_Students.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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<!--for delete Record -->
<?php
$msg="";
$opr="";
if(isset($_GET['opr']))
$opr=$_GET['opr'];
if(isset($_GET['rs_id']))
$id=$_GET['rs_id'];
if($opr=="del")
{
$del_sql=mysql_query("DELETE FROM stu_tbl WHERE stu_id=$id");
if($del_sql)
$msg="<div style='background-color: white;padding: 20px;border: 1px solid black;margin-bottom: 25px;''>"
. "<span class='p_font'>"
. "1 Record Deleted... !"
. "</span>"
. "</div>";
else
$msg="Could not Delete :".mysql_error();
}
echo $msg;
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/style_view.css" />
</head>
<body>
<div class="btn_pos">
<form method="post">
<input type="text" name="searchtxt" class="input_box_pos form-control" placeholder="Search name.." />
<div class="btn_pos_search">
<input type="submit" class="btn btn-primary btn-large" name="btnsearch" value="Search"/>
<a href="?tag=student_entry"><input type="button" class="btn btn-large btn-primary" value="Register new" name="butAdd"/></a>
</div>
</form>
</div><br><br>
<div class="table_margin">
<table class="table table-bordered">
<thead>
<tr>
<th style="text-align: center;">No.</th>
<th style="text-align: center;">Student Name</th>
<th style="text-align: center;">Gender</th>
<th style="text-align: center;">Date of Birth</th>
<th style="text-align: center;">Place of Birth</th>
<th style="text-align: center;">Address</th>
<th style="text-align: center;">Phone</th>
<th style="text-align: center;">E-mail</th>
<th style="text-align: center;">Note</th>
<th style="text-align: center;" colspan="2">Operation</th>
</tr>
<?php
$key="";
if(isset($_POST['searchtxt']))
$key=$_POST['searchtxt'];
if($key !="")
$sql_sel=mysql_query("SElECT * FROM stu_tbl WHERE f_name like '%$key%' or l_name like '%$key%'");
else
$sql_sel=mysql_query("SELECT * FROM stu_tbl");
$i=0;
while($row=mysql_fetch_array($sql_sel)){
$i++;
?>
<tr>
<td><?php echo $i;?></td>
<td><?php echo $row['f_name']." ".$row['l_name'];?></td>
<td><?php echo $row['gender'];?></td>
<td><?php echo $row['dob'];?></td>
<td><?php echo $row['pob'];?></td>
<td><?php echo $row['address'];?></td>
<td><?php echo $row['phone'];?></td>
<td><?php echo $row['email'];?></td>
<td><?php echo $row['note'];?></td>
<td><a href="?tag=student_entry&opr=upd&rs_id=<?php echo $row['stu_id'];?>" title="Update"><img style="-webkit-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);-moz-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);" src="picture/update.png" height="20" alt="Update" /></a></td>
<td><a href="?tag=view_students&opr=del&rs_id=<?php echo $row['stu_id'];?>" title="Delete"><img style="-webkit-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);-moz-box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);box-shadow: 0px 0px 0px 0px rgba(50, 50, 50, 0.75);" src="picture/delete.jpg" height="20" alt="Delete" /></a></td>
</tr>
<?php
}
// ----- for search studnens------
?>
</table>
</form>
</div>
</body>
</html>
<!--
<td>
<a href="?tag=student_entry"><input type="button" title="Add new student" name="butAdd" value="Add New" id="button-search" /></a>
</td>
<td>
<input type="text" name="searchtxt" title="Enter name for search " class="search" autocomplete="off"/>
</td>
<td style="float:right">
<input type="submit" name="btnsearch" value="Search" id="button-search" title="Search Student" />
</td>
-->