Your IP : 216.73.216.40


Current Path : /var/www/html/mmishra/mm/air1/backup/
Upload File :
Current File : /var/www/html/mmishra/mm/air1/backup/gallery.php

<?php
//checklogin($user);
$fname = $_REQUEST["fname"];
$no = $_REQUEST["no"];
if (!$no) $no = 1;
$i = 0;

$agPath = absolutePath($webid,'gallery');
$rgPath = relativePath($webid,'gallery');

if ($fname) shell_exec("rm -f {$agPath}/{$fname}");

$dh  = opendir($agPath);
while (false !== ($filename = readdir($dh))) {
        if (strlen($filename) > 2) {
                $files[] = $filename;
                $i++;
        }
}
if ($no > $i) $no = 1;

$fname = $files[$no];
if (!$fname) $fname = $files[0];
echo "$fname ($no of $i photos)<center>
<img src='$rgPath/$fname' width='98%' height='250'></img><br>";
$no--;
if ($no > 0) echo "[ <a href='$PHP_SELF?conf=$conf&no=$no'>Prev</a> ]";
$no++; $no++;
if ($no <= $i) echo "[ <a href='$PHP_SELF?conf=$conf&no=$no'>Next</a> ]";
echo "</center>";
if ($role == 'admin') {
	$id = innerconf('upload');
	echo "<div align='right'>";
	if ($id) echo "[ <a href='$PHP_SELF?conf={$id}&addto_gallery=yes'>Add</a> ]";
	echo "[ <a href='$PHP_SELF?conf=$conf&action=remove&no=$no&fname=$fname'>Remove</a> ]
	</div>";
}

?>