Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nayongnua
/
domains
/
nayongnua.go.th
/
public_html
/
otops
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nayongnua/domains/nayongnua.go.th/public_html/otops/del_data.php
<? session_start(); Header("Content-Type: text/html; charset=UTF-8"); if($_SESSION[user]=="") { session_destroy(); $message = "กรุณา Login ก่อน."; $url = "../admin/index.php"; include("../admin/alert.php"); exit; } if($_GET['chk_p']){ $chk_p = $_GET['chk_p']; }else{ $chk_p = $_POST['chk_p']; } if(empty($chk_p) || ($chk_p==0)){ echo "..Error..";die; } if($_GET['chk_del']){ $chk_del = $_GET['chk_del']; }else{ $chk_del = $_POST['chk_del']; } if($_GET['code_id']){ $code_id = $_GET['code_id']; }else{ $code_id = $_POST['code_id']; } if($_GET['code_1']){ $code_1 = $_GET['code_1']; }else{ $code_1 = $_POST['code_1']; } $code_1 = htmlspecialchars($code_1); if($_GET['c_id']){ $c_id = $_GET['c_id']; }else{ $c_id = $_POST['c_id']; } if($_GET['c_thumb']){ $c_thumb = $_GET['c_thumb']; }else{ $c_thumb = $_POST['c_thumb']; } if($_GET['sald_item']){ $sald_item = $_GET['sald_item']; }else{ $sald_item = $_POST['sald_item']; } if($chk_del==1){ include("../include/config_db.php"); $f_name = ""; switch ($chk_p) { case 1: $sql_t = "select * from `otop_album_detail` where (`alb_id`='$c_id') "; $dbquery_t = mysql_query($sql_t) or die("Can't send query !"); $num_photo = mysql_num_rows($dbquery_t); mysql_free_result($dbquery_t); if($num_photo>0){ echo "<br /><br /><p align=\"center\"><font color=#ff0000>ไม่สามารถลบข้อมูล อัลบั้ม $code_1 - เนื่องจากยังมีข้อมูลรูปภาพของอั้ลบั้มนี้อยู่ <br /><br />ต้องลบข้อมูลรูปภาพที่อยู่ในอัลบั้มนี้ให้หมดก่อน</font><br /><br /><a href=\"add_otop_picture.php?salb_id=$c_id&s_num_photo=5#top_page\">กลับไปหน้า แก้ไขรูปภาพ</a></p><br>"; include("../include/close_db.php"); die; } else { $sql = "delete from `otop_album` where (`id`='$c_id') LIMIT 1"; $f_name = "otop_album"; } break; case 2: $sql = "delete from `otop_album_detail` where (`id`='$c_id') LIMIT 1"; $f_name = "otop_album_detail"; break; } $dbquery = mysql_query($sql) or die("Can't send query !"); include("../include/close_db.php"); echo "<br>"; echo "<h3><p align=\"center\"><font color='#0000BB'>ลบข้อมูลเรียบร้อยแล้ว</font></p></h3><br>"; switch ($chk_p) { case 1: $c_thumb = trim($c_thumb); if($c_thumb != '') { $file_del = "../photoThumbnail/otops/thumb/".$c_thumb; unlink($file_del); } // echo "<p align=\"center\"><a href=\"add_otop_albums.php\">กลับไปหน้า $s_caption_1</a></p><br>"; $url = "add_otop_albums.php"; header ("Location: ".$url); break; case 2: $c_thumb = trim($c_thumb); $file_del = "../photoThumbnail/otops/a".$code_id."_a/".$c_thumb; if(@file_exists($file_del)) { chmod($file_del,0777); unlink($file_del); } $file_del = "../photoThumbnail/otops/a".$code_id."_a/thumb/t_".$c_thumb; if(@file_exists($file_del)) { chmod($file_del,0777); unlink($file_del); } //echo "<p align=\"center\"><a href=\"add_otop_picture.php?salb_id=$code_id#pageimage\">กลับไปหน้า เพิ่ม$s_caption_1</a></p><br>"; $url = "add_otop_picture.php?salb_id=$code_id#pageimage"; header ("Location: ".$url); break; } }else { $s_name_1 = ''; $s_caption_1 = ''; switch ($chk_p) { case 1: $s_caption_1 = 'อัลบั้ม'; $s_name_1 = 'ลบข้อมูล'; break; case 2: $s_caption_1 = 'รูปภาพ'; $s_name_1 = 'ลบข้อมูล'; break; } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title></title> <link href="./stylecss.css" rel="stylesheet" type="text/css"> </head> <body background="../images/tem_b1.jpg" style="background-repeat:no-repeat; background-position:top"> <div align="center" > <table width="980" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"> <div align="center"> <table width="980" border="0" cellpadding="0" cellspacing="0"> <tr> <td valign="top"><div align="center"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="980" height="650"> <param name="movie" value="../images/head.swf" /> <param name="quality" value="high" /> <embed src="../images/head.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="980" height="650"></embed> </object> </div></td> </tr> </table> </div> </td> </tr> <tr> <td valign="top"> <div align="center"> <table width="90%" border="0" cellspacing="0" cellpadding="0" align="center"> <tr><td height="50" valign="top"> <a name="toppage"></a></td> </tr> <tr> <td class="title2"><div align="center"><img src="../images/16.png" width="600" height="53"></div></td> </tr> <tr><td height="10" valign="top"> </td></tr> <tr> <td> <table width="80%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#669999"> <tr> <td> <? switch ($chk_p) { case 1:echo " <a href=\"add_otop_albums.php\"><< กลับไปหน้า $s_caption_1</a>"; break; case 2:echo " <a href=\"add_otop_picture.php?salb_id=$code_id#pageimage\"><< กลับไปหน้า เพิ่ม$s_caption_1</a>"; break; } ?> </td> </tr> </table> <table width="80%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#669999"> <form name="form1" enctype="multipart/form-data" method="post" action="del_data.php"> <tr bgcolor="#FF0000"> <td align="center"><font color="#FFFFFF"><b>ลบข้อมูล <?=$s_caption_1; ?></b></font></td> </tr> <tr> <td> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td> </td> </tr> <tr> <td width="50%" align="right"><?=$s_name_1; ?> :: </td> <td> <? switch ($chk_p) { case 1: if(!empty($c_id) and ($c_id>0)) { echo "ID ".$c_id." ".$code_1 ; }else { echo "ID ".$code_id." ".$code_1 ; } break; case 2: if(!empty($sald_item) and ($sald_item>0)) { echo "รูปที่ ".$sald_item." ".$code_1 ; }else { echo "ID ".$c_id." ".$code_1 ; } break; } ?> </td> </tr> <tr> <td> </td> </tr> <tr> <td colspan="2" align="center"> <input type="hidden" name="code_id" value="<?echo $code_id;?>"> <input type="hidden" name="code_1" value="<?echo $code_1;?>"> <input type="hidden" name="c_id" value="<?echo $c_id;?>"> <input type="hidden" name="c_thumb" value="<?echo $c_thumb;?>"> <input type="hidden" name="s_caption_1" value="<?echo $s_caption_1;?>"> <input type="hidden" name="chk_del" value="1"> <input type="hidden" name="chk_p" value="<?echo $chk_p;?>"> <input type="submit" name="Submit" value=" Yes "> </td> </tr> <tr> <td> </td> </tr> </table> </td> </tr> </form> </table> </td> </tr> <tr><td> </td></tr> </table> </div> </td> </tr> </table> </div> </body> </html> <? } include("../include/close_db.php"); ?>