View file funin/acp/showsmiles.php

File size: 3.63Kb
<?php
	session_start();
	if(!isset($_SESSION["user"]))
	{
		header("location: index.html");
	}
?>
<html>
<title>Showing Smilies</title>
<body>
<?php
include("setup.php");
$tk= $_GET['token'];
$uu= $_GET['uu'];
$token= md5("pass");
if($token == $tk & $uu == $user){
$nickid=$_REQUEST["nick"];
$ipid=$_REQUEST["ip"];
$bid=$_REQUEST["b"];
require '../pteam.php';
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 
$rowpage=10; // Number of files show in per pages


$start_from = ($page-1) * $rowpage; 
$sql = "SELECT * FROM chat_smiles ORDER BY id DESC limit $start_from,$rowpage";
$page2=$page+1;
$start_from2 = ($page2-1) * $rowpage;

$sql2 = "SELECT * FROM chat_smiles ORDER BY id DESC limit $start_from2,$rowpage";

	//count rows start
		$resultcountrow = mysql_query($sql2) or die(mysql_error());
					$num_rows = mysql_num_rows($resultcountrow);

//count row end
	$result = mysql_query($sql) or die(mysql_error());

if (mysql_num_rows($result) == 0)
{
echo"<table border='1'>";

echo"<table border='1'>";
echo"<th>ID</th>";
echo"<th>Smiles</th>";
echo"<th>Code</th>";
echo"<th>Url</th>";
echo"<th>emoticon</th>";
echo"<th>Delete</th>";
    echo "<tr><td>No rows found,nothing to print.</td></td>";
   echo"</td></tr>";
echo"</table>";
echo"<br/><br/>";
echo"<br/>";
echo"<< <a href=addsmiles.php?uu=$uu&token=$token>Add Smiles</a>";
echo"<br/>";
echo"<br/>";
echo"<< <a href='adminpanel.php?uu=$uu&token=$token'>Back To AdminPanel</a>";
echo"<br/><br/>";
echo"<a href='logout.php'><b>LogOut</b></a>";
}
else
{
	//File List start
	echo"<b><u>Showing Smilies</u><b><br/>";
echo"<table border='1'>";
echo"<th>ID</th>";
echo"<th>Smiles</th>";
echo"<th>Code</th>";
echo"<th>Url</th>";
echo"<th>emoticon</th>";
echo"<th>Delete</th>";
while ($row = mysql_fetch_assoc($result)) {  
        echo"<tr>";
	echo"<td>";
        echo"{$row['id']}";
        echo"</td><td>";
        echo"<img src='../smiles/{$row['url']}'/>";
        echo"</td><td>";
	echo"{$row['code']}";
        echo"</td><td>";
	echo"{$row['url']}";
        echo"</td><td>";
	echo"{$row['emoticon']}";
        echo"</td><td>";
	echo"(<a href=deletesmile.php?uu=$uu&token=$token&id={$row['id']}>Delete</a>)";
        echo"</td></tr>";

	
            
	//File List end
}; 
if (isset($_GET["page"])) { $page  = $_GET["page"]; } else { $page=1; }; 

$pgnext = ($page+1);
$pgprevious = ($page-1);

// paging system
                         echo"<br/>";
                         echo"</table>";
                         echo"<tr>";
                         echo"<td>";
if($page!="1")
{
                         echo " <a href='showsmiles.php?uu=$uu&token=$token&page=".$pgprevious."'>< Prev</a> ";
                         echo "| <a href='showsmiles.php?uu=$uu&token=$token&page=".$pgprevious."'>".$pgprevious."</a> |";
}
                         echo"</td><td>";
                         echo"| $page |"; 
                         echo"</td><td>";
if (mysql_num_rows($resultcountrow) != 0)
{

                       echo "| <a href='showsmiles.php?uu=$uu&token=$token&page=".$pgnext."'>".$pgnext."</a> |";
                      echo " <a href='showsmiles.php?uu=$uu&token=$token&page=".$pgnext."'>Next ></a> ";

                        }
                       
                         echo"</td></tr>";
                         echo"</table>";

// paging system end
echo"<br/>";
echo"<< <a href=addsmiles.php?uu=$uu&token=$token>Add Smiles</a>";
echo"<br/>";
echo"<br/>";
echo"<< <a href=showloginuser.php?uu=$uu&token=$token>Show Current User</a>";
echo"<br/>";
echo"<br/>";
echo"<< <a href='adminpanel.php?uu=$uu&token=$token'>Back To AdminPanel</a>";
echo"<br/><br/>";
echo"<a href='logout.php'><b>LogOut</b></a>";
}
}
?>
</body>
</html>