?
Path : /home/admin/domains/happytokorea.com/public_html_bk/promice/Admin/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/promice/Admin/TemplateSave.php |
<? @session_start(); ob_start(); $useradmin = $_SESSION["useradmin"]; if(empty($useradmin)) { echo "<script>alert('หน้านี้จำกัดเฉพาะ Admin เท่านั้น');history.back();</script>"; exit(); } require_once "../include/tdate.php"; require_once "../include/connect.php"; require_once "../include/connectdb.php"; $sql="select * from useradmin where useradmin='$useradmin'"; $db_query=mysql_db_query($db,$sql); $result=mysql_fetch_array($db_query); $id=$result[id]; $adminname=$result[name]; $user_admin=$result[useradmin]; $pass_admin=$result[passadmin]; $randnum1 = rand(11111,55555); $randnum2 = rand(66666,99999); $headtemp_random = "$rand_id$randnum1"; $buttomtemp_random = "$rand_id$randnum2"; if($_FILES["headtempnew"]["name"] != "") { $name=$_FILES['headtempnew']['name']; $tmp=$_FILES['headtempnew']["tmp_name"]; $date_time=date("Y-m-d H:i:s"); $oldname=explode(".",$name); $ext = ""; $ext = ".".$oldname[count($oldname)-1]; $temp_1 =$headtemp_random.$ext; copy($tmp,"../Templates/".$temp_1); }else{ $temp_1 = "$_POST[headtempold]"; } if($_FILES["buttomtempnew"]["name"] != "") { $name=$_FILES['buttomtempnew']['name']; $tmp=$_FILES['buttomtempnew']["tmp_name"]; $date_time=date("Y-m-d H:i:s"); $oldname=explode(".",$name); $ext = ""; $ext = ".".$oldname[count($oldname)-1]; $temp_2 =$buttomtemp_random.$ext; copy($tmp,"../Templates/".$temp_2); }else{ $temp_2 = "$_POST[buttomtempold]"; } $sql_temp = "update template set headtemp ='$temp_1', buttomtemp ='$temp_2' where id = 1"; mysql_query($sql_temp); ?> <html> <head> <title><? echo "$headtxt"; ?></title> <meta http-equiv="Content-Type" content="text/html; charset=tis-620"> <!-- Fireworks MX Dreamweaver MX target. Created Sat Apr 02 10:29:23 GMT+0700 (SE Asia Standard Time) 2011--> <link href="../css/style.css" rel="stylesheet" type="text/css"> <meta http-equiv="refresh" content="3;URL=Template.php"> </head> <body bgcolor="#ffffff"> <div align="center"><strong> </strong> <br> <br> <img src="../images/note_accept.png" width="64" height="64"><br> ปรุงปรุงรายการเรียบร้อยแล้ว<br> รอสักครู่</div> </body> </html>