-
Notifications
You must be signed in to change notification settings - Fork 1
/
cp.sec.php
73 lines (73 loc) · 1.77 KB
/
cp.sec.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
<?php
/*
# This is control panel for admin to list site for accepting or rejecting
*/
// include configuration file
include('config.php');
include('assets/include/header.php');
include('assets/include/navbar.php');
//We get the current page
$req1 = mysql_fetch_array(mysql_query('SELECT count(id) AS `nb` FROM `topsite` WHERE status="no"'));
if(isset($_GET['page']))
{
$page = intval($_GET['page']);
}
else
{
$page = 1;
}
//We calculate the number of pages and we display pages links
$nbpages = ceil($req1['nb']/$nb_site_page);
if($page<1 or $page>$nbpages)
{
$page = 1;
}
$pages_site = 'Pages: ';
if($page>1)
{
$pages_site .= '<a href="'.$_SERVER["PHP_SELF"].'?page='.($page-1).'">Previous</a> ';
}
for($i=1;$i<=$nbpages;$i++)
{
if($i==$page)
{
$pages_site .= '<strong>'.$i.'</strong> ';
}
else
{
$pages_site .= '<a href="'.$_SERVER["PHP_SELF"].'?page='.$i.'">'.$i.'</a> ';
}
}
if($page<$nbpages)
{
$pages_site .= '<a href="'.$_SERVER["PHP_SELF"].'?page='.($page+1).'">Next</a>';
}
//We calculate the first and last message position to display
$first_message = ($page-1)*$nb_site_page;
$last_message = $first_message +$nb_site_page;
$i = $first_message ;
// Get all sites are pending
/*
$q1 = mysql_query("SELECT * FROM topsite WHERE status='no' DESC LIMIT ".$first_message.",".$last_message."");
*/
// Get all sites are pending
$q1 = mysql_query("SELECT * FROM `topsite` WHERE status='no'");
?>
<div style="border:2px solid grey;text-align:center">Inactive Sites</div>
<?php
while ($inactive = mysql_fetch_array($q1)) {
$i++;
//echo $i;
?>
<?=$inactive["url"]?> <a href="/action.sec/?ch=a&id=<?=$inactive["id"]?>">Accept</a><br>
<?php
}
// Show pagination
?>
<div style="border:2px solid red">
<?php echo $pages_site; ?></div>
<?php
// close MySQL connection
include('assets/include/footer.php');
mysql_close();
?>