<? 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"><!-- InstanceBegin template="/Templates/vdo.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-874" /> <link rel="stylesheet" type="text/css" href="css/style.css"/> <? include("Templates/lib/function.php"); include("lib/db.php"); $con = new MySQL(); import_request_variables("gp", "p_"); ?> <title>การสืบค้นวิดีโอคลิป</title> <!-- InstanceBeginEditable name="php" --> <? if(!isset($_SESSION['admin'])){ echo "<meta http-equiv='refresh' content='0;URL=index.php'/>"; exit() ; }else{ $idm = $_SESSION['admin'][0]; } if(isset($p_insert)){ $sql = "select vdo_name from $tb_vdo where vdo_name ='$p_txtName'"; $query = $con->query($sql); $row = $query->size(); if($row==1){ echo "<script>alert('ชื่อวิดีโอคลิป $p_txtName มีอยู่ในระบบแล้ว');</script>" ; }else{ if($_FILES['vdofile']['size']<1048576000 ){ $sql = "insert into $tb_vdo values('','$p_txtName','','$p_txtDetail',now())"; $query = $con->query($sql); $LID = $con->getLastInsertId(); $vdo_name = $LID.'_'.'vdo'.Extention($_FILES['vdofile']['vdo_name']); move_uploaded_file($_FILES['vdofile']['tmp_name'],$con_path_vdo.$vdo_name); $sql = "update $tb_vdo set vdo_file = '$vdo_name' where vdo_id = '$LID' "; $con->querynoreturn($sql); echo "<meta http-equiv='refresh' content='0;URL=$_SERVER[PHP_SELF]' />"; exit(); }else { echo "<script> alert('ไฟล์เอกสารของคุณมีขนาดใหญ่เกิน 1 MB')</script>"; } } }else if(isset($p_update)){ $sql = "select vdo_file from $tb_vdo where vdo_id = '$p_update'"; $query = $con->query($sql); $show = $query->next(); if($_FILES['vdofile']['size']<1048576000 and $_FILES['vdofile']['name'] != '' ){ $vdofile = $show['vdo_file']; if(file_exists("vdo_file/$vdofile")){ unlink("vdo_file/$vdofile"); } $LID = $p_update; $vdo_name = $LID.'_'.'vdo'.Extention($_FILES['vdofile']['name']); move_uploaded_file($_FILES['vdofile']['tmp_name'],$con_path_vdo.$vdo_name); $str_update_vdo = "vdo_file = '$vdo_name',"; }else if($_FILES['vdofile']['size']>1048576000 and $_FILES['vdofile']['name'] != '') { echo "<script> alert('รูปภาพของคุณมีขนาดใหญ่เกิน 1000 MB')</script>"; echo "<meta http-equiv='refresh' content='0;URL=manage_vdo.php?edit=$p_update' />"; exit(); }// end if check image $sql = "update $tb_vdo set $str_update_vdo vdo_name ='$p_txtName', vdo_detail ='$p_txtDetail' where vdo_id = '$p_update'"; $con->querynoreturn($sql); echo "<meta http-equiv='refresh' content='0;URL=$_SERVER[PHP_SELF]' />"; exit(); }else if(isset($p_delete)){ $sql = "select vdo_file from $tb_vdo where vdo_id = '$p_delete'"; $query = $con->query($sql); $show = $query->next(); $vdofile = $show['vdo_file']; if(file_exists("vdo_file/$vdofile")){ unlink("vdo_file/$vdofile"); } $sql = "delete from $tb_vdo where vdo_id ='$p_delete'"; $con->querynoreturn($sql); echo "<meta http-equiv='refresh' content='0;URL=$_SERVER[PHP_SELF]' />"; exit(); } ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง