-
Notifications
You must be signed in to change notification settings - Fork 6
/
admin.php
90 lines (67 loc) · 1.79 KB
/
admin.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
<html>
<head>
<link rel="stylesheet" type="text/css" href="css/bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="css/bootstrap-min.css"/>
<title>Admin</title>
</head>
<body>
<a href="index.php"><button style=""class="btn btn-primary btn-lg">back</button></a>
<center>
<h1>Admin panel</h1>
<hr>
<br/>
<?php
require 'core.inc.php';
require 'connect.inc.php';
if(loggedin())
{
//echo $_SESSION['user_id'];
//echo $field;
$query = "SELECT `fullname` FROM corp_reg WHERE `id`='".$_SESSION['user_id']."'";
if($query_run = mysql_query($query))
{
if($query_result = mysql_result($query_run, 0, 'fullname'))
{
$a= $query_result;
}
else
{
echo "sorry!";
}
}
//echo $fullname = getfield('fullname');
echo 'Welcome , '.$a.' <span style=""><a class="logout" style="" href="logout.php">Logout</a></span><br>';
}
?>
<a href="adminuser.php"><button class="btn btn-primary btn-lg">User</button></a>
<a href="admincorporate.php"><button class="btn btn-danger btn-lg">Corporate</button></a>
<br />
<br>
<br>
<h1>Leader Boards</h1>
</center>
<h1><?php
$count=0;
$qi="SELECT count(id) from user_details";
$query_run = mysql_query($qi);
while($row=mysql_fetch_array($query_run))
{
$count=$row[0];
}
?>
<center><button style="" class="btn btn-danger btn-lg">Total Paticipants:<span><?php echo "\n".$count;?></span></button></center></h1>
<?php
$var1="SELECT * from leaderboard order by earn desc";
$result1=mysql_query($var1);
while($row1=mysql_fetch_array($result1))
{
echo '<table class="table table-striped">
<tr><th>Id</th><th>Username</th><th>Amount Earned</th>';
echo "<tr>";
echo "<td>" .$row1['username']."</td><td> ".$row1['earn'] ."</td>";
echo "</tr>";
echo "</table>";
}
?>
</body>
</html>