-
Notifications
You must be signed in to change notification settings - Fork 0
/
userHome.php
116 lines (71 loc) · 2.06 KB
/
userHome.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
<?php session_start(); ?>
<?php include 'header.php'; ?>
<div class="container">
<div id="adminTopDiv">
<?php
include("userMenu.php");
?>
</div><!--end of topDiv-->
<div id="adminBottomDiv">
<?php
$con=@mysql_connect("127.0.0.1","root","");
@mysql_select_db("digitalexam",$con);
$totalRecPerPage=10;
$rs=mysql_query("select count(*) from quiz_info");
$row=mysql_fetch_array($rs);
$totalRec=$row[0];
$noOfPages=ceil($totalRec/$totalRecPerPage);
if(isset($_REQUEST['pgno']))
{
$start= ($_REQUEST['pgno']-1) * $totalRecPerPage;
}
else
{
$start=0;
}
$rs=mysql_query("select * from quiz_info order by quizname limit $start , $totalRecPerPage ");
$sl=0;
echo("<table border='1' id='quiztable' cellpadding='10px' cellspacing='0px'>");
echo("<tr>");
echo("<th>");
echo("Sr No");
echo("</th>");
echo("<th>");
echo("Quiz Name");
echo("</th>");
echo("<th>");
echo("Total Ques");
echo("</th>");
echo("<th>");
echo("Status");
echo("</th>");
echo("</tr>");
while($row=mysql_fetch_array($rs))
{
echo("<tr>");
echo("<td>");
echo(($start++)+1);
echo("</td>");
echo("<td>");
echo($row["quizname"]);
echo("</td>");
echo("<td>");
echo($row["quiztotalq"]);
echo("</td>");
$qid=$row["quizid"];
echo("<td>");
echo("<a href='displayques.php?qid=$qid'>Start</a>");
echo("</td>");
echo("</tr>");
}
echo("</table>");
echo("<div id='pagingno'>");
for($i=1;$i<=$noOfPages;$i++)
{
echo("<a href='userHome.php?pgno=$i'>".$i."</a> ");
}
echo("</div>");
?>
</div><!--end of bottomDiv-->
</div><!--end of container1-->
<?php include 'footer.php'; ?>