-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathadmin_mge_tutor_main.php
140 lines (123 loc) · 4.08 KB
/
admin_mge_tutor_main.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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
<?php include("session_start.php"); ?>
<?php include("admin_authenticate.php"); ?>
<?php include("top.php"); ?>
<?php include("admin_submenu.php"); ?>
<div id="contenttext">
<div style="padding:10px">
<span class="titletext">Manage Tutor</span> </div>
<div class="bodytext" style="padding:12px;" align="justify">
<strong>Manage Tutor</strong>
<p>Here you can manage (add new, edit, delete) tutor(s).</p>
<script type="text/javascript" src="js/delAll.js" >
</script>
<script type="text/javascript">
<!--
function checkAll(field)
{
for (i = 0; i < field.length; i++)
field[i].checked = true ;
}
//-->
</script>
<style type="text/css">
<!--
.style1 {color: #CCCCFF}
-->
</style>
<script language="JavaScript">
<!--
function over(id,color)
{
document.getElementById(id).style.backgroundColor = color;
}
function out(id,color)
{
document.getElementById(id).style.backgroundColor = color;
}
//-->
</script>
<form name="frmSearch" onSubmit="JavaScript: location.href = 'admin_mge_tutor_main.php?name=' + frmSearch.txtName.value; return false;">
<table align="center" style="background:#CCCCFF">
<tr>
<td> Name:</td>
<td><input type="text" name="txtName" /></td>
<td><input type="submit" value="Find" title="Click to search. With empty text, it will return all records." /></td>
<td> </td>
</tr>
</table>
</form>
<form id="frm" name="frm" method="post" action="admin_mge_tutor_del_sel.php" onSubmit="return DeleteAll()" >
<table align="center" cellpadding="0" cellspacing="0" bgcolor="#CCCCFF">
<tr>
<td></td>
<td> </td>
<td> </td>
<td> </td>
<td>
<div align="center">
<a href="admin_mge_tutor_new.php" title="Add New Record"><img src="images/b_edit.png" border="0" /></a>
<input name="image" type="image" title="Delete selected records" src="images/b_drop.png" />
</div>
</td>
</tr>
<tr>
<th id="ab">
<a href="javascript:selectAll();" title='Click to select/de-select all records'>C</a>
<hr /></th>
<th> Tutor ID
<hr /></th>
<th> Login
<hr /></th>
<th> Name
<hr /></th>
<th> Action
<hr /></th>
</tr>
<?php
include('db_connection.php');
if(isset($_GET['name']))
{
$sql = "SELECT * FROM tutor WHERE login LIKE '%" . $_GET['name'] . "%' OR name LIKE '%" . $_GET['name'] . "%' ;";
}
else
{
$sql = 'SELECT * FROM tutor;';
}
$result = mysql_query($sql);
if(mysql_num_rows($result) == 0)
print '<tr><td colspan="5" align="center"> No record found </td></tr>';
else
{
$count = 0;
while($row = mysql_fetch_array($result))
{
$count++;
?>
<tr id="row<?php echo $count; ?>" onmouseover="over(this.id,'lightgreen')" onmouseout="out(this.id,'#CCCCFF')">
<td><input type="checkbox" name="tutor_ids[]" value="<?php echo $row['tutor_id'] ?>"> </td>
<td align="center"><?php echo $row['tutor_id'] ?> </td>
<td><?php echo $row['login'] ?> </td>
<td><?php echo $row['name'] ?> </td>
<td>
<input type="image" onClick="JavaScript: location.href = 'admin_mge_tutor_show.php?tutor_id=' + this.value; return false;" src="images/b_browse.png" title="Browse record" value="<?php echo $row['tutor_id'] ?>" />
<input type="image" onClick="JavaScript: location.href = 'admin_mge_tutor_edit.php?tutor_id=' + this.value; return false;" src="images/b_edit.png" title="Edit record" value="<?php echo $row['tutor_id'] ?>" />
<input type="image" onClick="JavaScript: res = confirm('Are you sure to delete this contact'); if(res != 0) location.href = 'admin_mge_tutor_del.php?tutor_id=' + this.value; return false;" src="images/b_drop.png" title="Delete record" value="<?php echo $row['tutor_id'] ?>" />
</td>
</tr>
<?php
} // while($row = mysql_fetch_array($result)) // if($row)
} // if(mysql_num_rows($result) == 0)
?>
<tr>
<td><hr /></td>
<td><hr /></td>
<td><hr /></td>
<td><hr /></td>
<td><hr /></td>
</tr>
</table>
</form>
</div>
</div>
<?php include("bottom.php"); ?>