?
Path : /home/admin/public_html/old/promice/Admin/ |
Current File : /home/admin/public_html/old/promice/Admin/EditProductsSave2.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]; if($_FILES["productsphoto"]["name"] != "") { $name=$_FILES['productsphoto']['name']; $tmp=$_FILES['productsphoto']["tmp_name"]; $date_time=date("Y-m-d H:i:s"); $oldname=explode(".",$name); $ext = ""; $ext = ".".$oldname[count($oldname)-1]; $photo_1 =date('YmdHis').$ext; copy($tmp,"IMG/".$photo_1); }else{ $photo_1 = "$_POST[productsphotosend]"; } if($_FILES["productsphoto2"]["name"] != "") { $name=$_FILES['productsphoto2']['name']; $tmp=$_FILES['productsphoto2']["tmp_name"]; $date_time=date("Y-m-d H:i:s"); $oldname=explode(".",$name); $ext = ""; $ext = ".".$oldname[count($oldname)-1]; $photo_2 =date('YmdHis').$ext; copy($tmp,"IMG/".$photo_2); }else{ $photo_2 = "$_POST[productsphotosend2]"; } if($_FILES["productsphoto3"]["name"] != "") { $name=$_FILES['productsphoto3']['name']; $tmp=$_FILES['productsphoto3']["tmp_name"]; $date_time=date("Y-m-d H:i:s"); $oldname=explode(".",$name); $ext = ""; $ext = ".".$oldname[count($oldname)-1]; $photo_3 =date('YmdHis').$ext; copy($tmp,"IMG/".$photo_3); }else{ $photo_3 = "$_POST[productsphotosend3]"; } $sql_data = "update products set productstypecode = '$_POST[productstypecode]',productsname='$_POST[productsname]', productsprice='$_POST[productsprice]', productspricedis='$_POST[productspricedis]',productsdetail='$_POST[productsdetail]'',productskeyword='$_POST[productskeyword]'',productstitle='$_POST[productstitle]'',productsdesc='$_POST[productsdesc]',productsphoto='$photo_1',productsphoto2='$photo_2',productsphoto3='$photo_3',productsfeet='$_POST[productsfeet]',productsfeet2='$_POST[productsfeet2]',productsbath='$_POST[productsbath]',productsbed='$_POST[productsbed]',province='$_POST[province]',canton='$_POST[canton]',condition='$_POST[condition]',takeover='$_POST[takeover]',contact='$_POST[contact]',project='$_POST[project]',agent='$_POST[agent]',status='$_POST[status]',amount='$_POST[amount]' where id = '$_POST[idx]'"; mysql_query($sql_data); ?> <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=Products.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>