-
Notifications
You must be signed in to change notification settings - Fork 8
/
lectureview.php
121 lines (110 loc) · 2.94 KB
/
lectureview.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
<?php
/**
* @System HP-pc Rax
* @author Rakshit shah <Rakshitshah1994@gmail.com>
* @copyright 2015-2017 |Rakshit shah
* @license http://rakshit.in/license/license.php | PHP License 3.0
* @version 1.1
* @since File available since Release 1.0.0
*/
session_start();
include("header.php");
include("conection.php");
include("modal.php");
if(isset($_GET['view']) && $_GET['view']== "delete")
// if($_GET["view"] == "delete")
{
mysql_query("DELETE FROM lectures WHERE lecid ='$_GET[slid]'");
}
if(isset($_SESSION["userid"]))
{
if(isset($_GET["first"]))
{
}
else
{
$_GET["first"] =0;
$_GET["last"] = 10;
}
$result = mysql_query("SELECT * FROM lectures LIMIT $_GET[first] , $_GET[last]");
?>
<section id="page">
<header id="pageheader" class="normalheader">
<h2 class="sitedescription">
</h2>
</header>
<section id="contents">
<article class="post">
<header class="postheader">
<h2>Lecture Details</h2>
</header>
<section class="entry">
<table width="508" border="1">
<tr>
<td width="45"><strong> ID</strong></td>
<td width="94"><strong> Leturer Name</strong></td>
<td width="80"><strong> Address</strong></td>
<td width="71"><strong> Contact No.</strong></td>
<td width="106"><strong> Action</strong></td>
</tr>
<?php
$i =$_GET["first"]+1;
while($row = mysql_fetch_array($result))
{
echo "<tr>";
echo "<td> " . $i . "</td>";
echo "<td> " . $row['lecname'] . "</td>";
echo "<td> " . $row['address'] . "</td>";
echo "<td> " . $row['contactno'] . "</td>";
echo "<td> <a href='viewrecords.php?slid=$row[lecid]&view=lectures'><img src='images/view.png' width='32' height='32' /></a>
<a href='lecture.php?slid=$row[lecid]&view=lectures'> <img src='images/edit.png' width='32' height='32' /></a>";
?>
<a href='lectureview.php?slid=<?php echo $row["lecid"]; ?>&view=delete'><img src='images/delete.png' width='32' height='32' onclick="return confirm('Are you sure??')"/></a></td>
<?php
echo "</tr> ";
$i++;
}
$first=$_GET["first"]-10;
$last= $_GET["last"]- 10;
?>
<tr>
<td><?php
if($first <0)
{
}
else
{ ?>
<a href="lectureview.php?first=<?php echo $first; ?>&last=<?php echo $last; ?>">
<?php
}
?><img src="images/previous.png" alt="" width="32" height="32" /></td>
<td><a href="#" onClick="openleture(); return false"><img src="images/add.png" alt="" width="32" height="32" /></a></td>
<?php
$first=$_GET["first"]+10;
$last = $_GET["last"]+ 10;
?>
<td> </td>
<td> </td>
<td><?php
if($first > mysql_num_rows($result))
{
}
else
{ ?>
<a href="lectureview.php?first=<?php echo $first; ?>&last=<?php echo $last; ?>">
<?php
}
?><img src="images/next.png" alt="" width="32" height="32" /></td>
</tr>
</table>
</section>
</article>
</section>
<?php
}
else
{
header("Location: admin.php");
}
include("adminmenu.php");
include("footer.php"); ?>