MINI MINI MANI MO
<?php
ob_start(); // Initiate the output buffer
if (!$_SESSION) session_start();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Adminitrator Panel - Photo Gallery</title>
<link href="css/style.css" rel="stylesheet" media="all">
<link href="css/styles/default/ui.css" rel="stylesheet" title="style" media="all">
<script type="text/javascript" src="js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="js/superfish.js"></script>
<script type="text/javascript" src="js/jquery-ui-1.7.2.js"></script>
<script type="text/javascript" src="js/tooltip.js"></script>
<script type="text/javascript" src="js/tablesorter.js"></script>
<script type="text/javascript" src="js/tablesorter-pager.js"></script>
<script type="text/javascript" src="js/cookie.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
</head>
<body>
<?php include('header.php') ?>
<div id="page-wrapper">
<div id="main-wrapper">
<div id="main-content">
<div class="page-title ui-widget-content ui-corner-all">
<h1>PHOTO GALLERY</h1>
<div class="other">
<ul id="dashboard-buttons">
<li>
<a href="add-image.php" class="Book_phones tooltip">
ADD PHOTO
</a>
</li>
<li>
<a href="show-image.php" class="Books tooltip">
DELETE PHOTO
</a>
</li>
<li>
<a href="dashboard.php" class="Clipboard_3 tooltip">
HOME
</a>
</li>
</ul>
<div class="clearfix"></div>
<div class="hastable"><?php
error_reporting (E_ALL ^ E_NOTICE);
$page_name="show-image.php";
$start=$_GET['start'];
if(strlen($start) > 0 and !is_numeric($start)){
echo "Data Error";
exit;
}
$eu = ($start - 0);
$limit = 15; // No of records to be shown per page.
$this1 = $eu + $limit;
$back = $eu - $limit;
$next = $eu + $limit;
$query2="select * from photogallery order by id desc";
$result2=mysql_query($query2);
echo mysql_error();
$nume=mysql_num_rows($result2);
$query="select * from photogallery order by id desc limit $eu, $limit";
$res1=mysql_query($query)or die("Query does not execute...");
$count=mysql_num_rows($res1);
$i=1;
?>
<script type="text/javascript">
checked=false;
function checkedAll (frm) {
var aa= document.getElementById('frm');
if (checked == false)
{
checked = true
}
else
{
checked = false
}
for (var i =0; i < aa.elements.length; i++)
{
aa.elements[i].checked = checked;
}
}
</script>
<form name="myform" class="pager-form" method="post" action="">
<table width="68%">
<thead>
<tr>
<th width="75" class="header">Si No.</th>
<th width="125" class="header">Photo</th>
<th width="145" class="header">Details</th>
<th width="686" style="width:132px">Action</th>
</tr>
</thead>
<tbody><?php while($info1=mysql_fetch_assoc($res1)){
$type_id= $info1['id'];
?><?php $result = mysql_query("SELECT * FROM photogallery where type_id='$type_id' and type='product'");
$num_rows = mysql_num_rows($result);
// Display the results
$noofphoto= $num_rows; ?>
<tr class="even">
<td class="center"><?php echo $i?></td>
<td><img src="../../galleryimg/<?php echo $info1['image']?>" width="85" height="66" class="btn_no_text btn ui-state-default ui-corner-all tooltip" title="<?php echo $noofphoto ?> More Photos"></td>
<td><?php echo $info1['details']?></td>
<td>
<a class="btn_no_text btn ui-state-default ui-corner-all tooltip" href="delete_photo.php?id=<?php echo $info1['id']?>" title="Delete Photo">
<span class="ui-icon ui-icon-circle-close"></span></a> </td>
</tr><?php $i=$i+1; } ?><tr class="odd">
<td class="center"> </td>
<td> </td>
<td> </td>
<td> </td>
</tr></tbody>
</table>
</form>
<?php if($nume > $limit ){ // Let us display bottom links if sufficient records are there for paging
/////////////// Start the bottom links with Prev and next link with page numbers /////////////////
echo "<table align = 'center' width='80%'><tr><td align='left' width='30%'>";
//// if our variable $back is equal to 0 or more then only we will display the link to move back ////////
if($back >=0) {
print "<a href='$page_name?start=$back'><font face='Verdana' size='2' color=#3b96d8>PREV</font></a>";
}
else
{
echo "<font face='Verdana' size='2' color=black><b>PREV</b></font>";
}
//////////////// Let us display the page links at center. We will not display the current page as a link ///////////
echo "</td><td align=center width='30%'>";
$i=0;
$l=1;
for($i=0;$i < $nume;$i=$i+$limit){
if($i <> $eu){
echo " <a href='$page_name?start=$i'><font face='Verdana' size='2'>$l</font></a> ";
}
else { echo "<font face='Verdana' size='2' color=#3b96d8>$l</font>";} /// Current page is not displayed as link and given font color red
$l=$l+1;
}
echo "</td><td align='right' width='30%'>";
///////////// If we are not in the last page then Next link will be displayed. Here we check that /////
if($this1 < $nume) {
print "<a href='$page_name?start=$next'><font face='Verdana' size='2' color=#3b96d8>NEXT</font></a>";}
else
{
echo "<font face='Verdana' size='2' color=black><b>NEXT</b></font>";
}
echo "</td></tr></table>";
}// end of if checking sufficient records are there to display bottom navigational link.
?>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="three-column"></div>
</div>
<div class="clearfix"></div>
</div>
</div>
<div class="clearfix"></div>
<?php include('footer.php') ?>
</body></html>
OHA YOOOO