<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<?php
include("connect.php");
$id = $_POST["editgadget"] ;
$strSQL = "UPDATE tb_gadget SET ";
$strSQL .="Gadgettype_id = '".$_POST["gadgettype"]."' ";
$strSQL .=",Brand = '".$_POST["brand"]."' ";
$strSQL .=",Model = '".$_POST["model"]."' ";
$strSQL .=",Date_purchase = '".$_POST["datebuy"]."' ";
$strSQL .=",Amount = '".$_POST["numberbuy"]."' ";
$strSQL .=",Unit = '".$_POST["namebuy"]."' ";
$strSQL .=",Serial = '".$_POST["sn"]."' ";
$strSQL .=",Number_repair = '".$_POST["numberre"]."' ";
$strSQL .=",Gadget_user = '".$_POST["nameuser"]."' ";
$strSQL .=",Department_user = '".$_POST["Department"]."' ";
$strSQL .=",Detail = '".$_POST["detail"]."' ";
$strSQL .="WHERE Gadget_id = '".$id."' ";
$objQuery = mysql_query($strSQL);
if($objQuery)
{
									echo"<script language='JavaScript'>";
									echo"alert('บันทึกข้อมูลเรียบร้อย');";
									echo"</script>";		
				echo "<meta http-equiv='refresh' content='0;url=viewgadget.php?view_id=$id'>";
}
else
{
	echo "Error Save [".$strSQL."]";
}
mysql_close($objConnect);
?>
<script src="bootstrap/js/jquery.js"></script>
<script src="bootstrap/js/bootstrap-datepicker.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script>
<script>window.jQuery || document.write("<script src='js/jquery-1.5.1.min.js'>\x3C/script>")</script>
<script src="js/app.js"></script>
</body>
</html>