( ′∀`)σ≡σ☆))Д′)レ(゚∀゚;)ヘ=З=З=Зε≡(ノ´_ゝ`)ノ
<?php
require_once 'library/config.php';
require_once 'library/functions.php';
?>
<style type="text/css">
<!--
.style9 {font-size: 12px; }
.style12 {font-size: 12px; font-weight: bold; }
-->
</style>
<script language="javascript" type="text/javascript">
function deleteAlbum(albumId)
{
if (confirm('Delete this album?')) {
window.location.href = '?mode=pics&deleteAlbum&album=' + albumId;
}
}
function viewImage(albumId) {
if (albumId != '') {
window.location.href = '?mode=pics&page=list-image&album=' + albumId;
} else {
window.location.href = '?mode=pics&page=list-image';
}
}
function deleteImage(albumId, imgId)
{
if (confirm('Delete this image?')) {
window.location.href = '?mode=pics&page=list-image&delete&album=' + albumId + '&imgId=' + imgId;
}
}
function viewLargeImage(imageName)
{
imgWindow = window.open('', 'largeImage', "width=" + screen.availWidth + ",height=" + screen.availHeight + ",top=0,left=0,screenY=0,screenX=0,status=yes,scrollbars=yes,resizable=yes,menubar=no");
imgWindow.focus();
imgWindow.location.href = 'viewImage.php?type=glimage&name=' + imageName;
}
</script>
</head>
<body>
<table width="100%" border="0" cellspacing="0" cellpadding="5" class="main">
<tr>
<td width="" valign="top">
<center>
</center>
<div align="center"><br>
<a href="?mode=pics&page=list-album">List Album | </a>
<a href="?mode=pics&page=add-album">Add Album</a>
| <a href="?mode=pics&page=list-image">List Images | </a>
<a href="?mode=pics&page=add-image">Add Image</a></div>
<div style="padding:10px;"></div>
<div style="padding:10px;">
<div class="wa">
<div class="wb">
<div class="wc">
<div class="wd">
<p>
<span class="forms">
<?php
if (isset($_GET['deleteAlbum']) && isset($_GET['album']) ) {
$albumId = $_GET['album'];
// get the album name since we need to display
// a message that album 'foo' is deleted
$result = mysqli_query($link,"select al_name, al_image
FROM tbl_album
WHERE al_id = $albumId and al_catalogid=$videouser")
or die('Delete image failed. ' . mysql_error());
if (mysql_num_rows($result) == 1) {
$row = mysql_fetch_assoc($result);
$albumName = $row['al_name'];
$albumImage = $row['al_image'];
// get the image filenames first so we can delete them
// from the server
$result = mysqli_query($link,"select im_image, im_thumbnail
FROM tbl_image
WHERE im_album_id = $albumId and im_catalogid=$videouser")
or die(mysql_error());
while ($row = mysql_fetch_assoc($result)) {
unlink(GALLERY_IMG_DIR . $row['im_image']);
unlink(GALLERY_IMG_DIR . 'thumbnail/' . $row['im_thumbnail']);
}
unlink(ALBUM_IMG_DIR . $albumImage);
$result = mysqli_query($link,"DELETE FROM tbl_image
WHERE im_album_id = $albumId and im_catalogid=$videouser")
or die('Delete image failed. ' . mysql_error());
$result = mysqli_query($link,"DELETE FROM tbl_album
WHERE al_id = $albumId and al_catalogid=$videouser")
or die('Delete album failed. ' . mysql_error());
// album deleted successfully, let the user know about it
echo "<p align=center>Album '$albumName' deleted.</p>";
} else {
echo "<p align=center>Cannot delete a non-existent album.</p>";
}
}
// which page should be shown now
$page = (isset($_GET['page']) && $_GET['page'] != '') ? $_GET['page'] : 'list-album';
// only the pages listed here can be accessed
// any other pages will result in error
$allowedPages = array('list-album', 'add-album', 'album-detail', 'modify-album', 'list-image', 'add-image', 'image-detail', 'modify-image');
if (in_array($page, $allowedPages)) {
include $page . '.php';
} else {
?>
</span></p>
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1">
<tr>
<td align="center" class="forms"><strong>Error : The Page You're Looking
For Doesn't Exist</strong></td>
</tr>
</table>
<span class="forms">
<?php
}
?>
</span>
<p> </p>
</div>
</div>
</div>
</div>
</div> <p align="right"> </p></td>
</tr>
</table>
</body>
</html>