<!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Untitled Document</title> <style type="text/css"> </style> </head> <script language="javascript"> function check2(){ if(document.form1.name_pro.value==""){ alert("กรุณากรอก ชื่อสินค้า ด้วยครับ"); document.form1.name_pro.focus(); return false; } if(document.form1.date_in.value==""){ alert("กรุณากรอก วันที่รับสินค้า ด้วยครับ"); document.form1.date_in.focus(); return false; } if(document.form1.price_unit.value==""){ alert("กรุณากรอก ราคาต่อหน่วย ด้วยครับ"); document.form1.price_unit.focus(); return false; } if(document.form1.product_on_hand.value==""){ alert("กรุณากรอก สินค้าที่มีอยู่ในมือ ด้วยครับ"); document.form1.product_on_hand.focus(); return false; } if(document.form1.amount_received.value==""){ alert("กรุณากรอก จำนวนที่ได้รับ ด้วยครับ"); document.form1.amount_received.focus(); return false; } if(document.form1.total_cost.value==""){ alert("กรุณากรอก ต้นทุนรวม ด้วยครับ"); document.form1.total_cost.focus(); return false; } } function CheckNum(){ if (event.keyCode < 48 || event.keyCode > 57){ event.returnValue = false; alert('ตัวเลขเท่านั้น'); } } </script> <body> <table width="925" border="3" align="center"> <tr bgcolor="#CCCCCC"> <th width="82" scope="col">รหัส</th> <th width="120" scope="col">ชื่อสินค้า</th> <th width="119" scope="col">วันที่รับสินค้า</th> <th width="139" scope="col">จำนวนที่มีอยู่</th> <th width="139" scope="col">สถานะสินค้า</th> <th width="132" align="center" valign="middle" scope="col">จำนวนสินค้าที่ต้องการเพิ่ม</th> <th width="144" align="center" valign="middle" scope="col"></th> </tr> <? include ('config.inc.php'); $con = mysql_connect($host,$username,$password); $id=$_GET["id"]; if(!$con){ die('Cloud not connect:'.mysql_error()); } mysql_select_db($database,$con); $sql="SELECT * from products order by id_pro"; $result=mysql_query($sql); $i=0; while($row=mysql_fetch_array($result)) { if($color=="#66FFFF"){ $color="#FFCCFF";}else{ $color="#66FFFF"; } ?> <form onsubmit="return myFunction<?=$i;?>()" id="form<?=$i;?>" name="form<?=$i;?>" method="post" action="add_material.php?request=<?=$row[0];?>"> <tr bgcolor="<?=$color;?>"> <td align="center"><?=$row[0];?></td> <td><?=$row[1];?></td> <td align="center"><?=$row[2];?></td> <td align="center"><?=$row[5]+$row[6];?></td> <td align="center"> </td> <td align="center" valign="middle"><label for="amount"></label> <input name="amount" type="text" id="amount" size="10" onkeypress="CheckNum()" /> <script> function CheckNum(){ if (event.keyCode < 48 || event.keyCode > 57){ event.returnValue = false; alert('ตัวเลขเท่านั้น'); } } </script></td> <td align="center" valign="middle"><input type="submit" name="request" id="request" value="เพิ่มสินค้า" /></td> </tr> </form> <? $i++; } ?> </table> <p> </p> <p> </p> <p> <center></center> </p> </body> </html>
<? $date=date("Y-m-d"); $date = date ("Y-m-d", strtotime("-7 day", strtotime($date))); echo $date; ?>
$date_diff = date_diff_today($row['date_in']); $month_diff = month_diff_today($row['date_in']); if($month_diff >= 5){ //แดง }elseif($month_diff >= 2){ //ส้ม }elseif($date_diff >= 7){{ //เหลือง }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง