if(ฟิวเเรก==ฟิวสอง){ ถ้าใช่ให้เปลี่ยน status == ทั่วไป } else{}
$sql="INSERT INTO table ( fleStart, fldEnd ) VALUES( '$datestart', DATE_ADD( '$datestart', INTERVAL 30 DAY))";
if( $fldEnd==date('Y-m-d')) $db->query("update table set status='..' where ....");
<? //เปลี่ยนสถานะ เป็น"ทั่วไป" ตามวันที่บวกไป +30 day จากdatabase $strSQL2="select Product_Status,datetime30 from product where Product_Status='1'"; $dbquery=mysql_query($strSQL2) or die (mysql_error()); while($order_date=mysql_fetch_array($dbquery)){ date_default_timezone_set('Asia/Bangkok'); $date= date('y-m-d'); $datetime=$order_date['datetime30']; if($datetime==$date){ $strSQL3 = "UPDATE product SET Product_Status ='3' where datetime30='$date' "; $objQuery3 = mysql_query($strSQL3); } } ?>
<html> <head> <title>KOMBRA Underware Shop</title> <?php include("db_connect.php"); $setColumn=4;//แสดง3คอลัมน์ต่อ1แถว ถ้าต้องการให้แสดงกี่คอลัมน์ให้กำหนดตรงนี้ $ColumnStart=1;//คอลัมน์เริ่มต้นเป็น 1 เสมอ $strSQL = "SELECT * FROM product where Sub_ID like '%".$_GET["Sub_ID"]."%' and Product_Category_ID like '%".$_GET["Category_ID"]."%' and Product_Status like '%".$_GET["Product_Status"]."%' ORDER BY datetime DESC "; $rsShowProduct = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); //ดึงข้อมูลล่าสุด10แถวจากเทเบิล ?> <style type="text/css"> body { background-image: url(picture/7b00JsA.gif); } </style> </head> <body> <table width="1280" height="1024" border="0" align="center"> <tr> <th height="300" colspan="2" scope="col"><? include"include/image_main_user.php"; ?></th> </tr> <tr> <td height="49" bgcolor="#FFC1E0" colspan="2"><? include"include/menubar_user.php" ?></td> </tr> <tr> <td width="280" align="center" valign="top" bgcolor="#FFC1E0"><? include"test_menu.php" ?></td> <td align="center" valign="top" bgcolor="#FFC1E0"><table width="1000" border="0"> <tr> <th scope="col"><table width="999" height="545" border="0" align="center"> <tr> <th align="left" valign="top" scope="row"> <h3>รายการสินค้า</h3> <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <?php while($showProduct=mysql_fetch_array($rsShowProduct)){//วันลูปแสดงผลสินค้าทีละแถว //--------------เช็คเเสดง สินค้า New-----------------// if($showProduct['Product_Status']=='1'){?> <? //เปลี่ยนสถานะ เป็น"ทั่วไป" ตามวันที่บวกไป +30 day จากdatabase date_default_timezone_set('Asia/Bangkok'); $date= date("y-m-d"); echo"$date"; if($showProduct['datetime30']==$date){ $strSQL3 = "UPDATE product SET Product_Status ='3' where datetime30='$date' "; $objQuery3 = mysql_query($strSQL3); } ?> <td bgcolor="#FFCCFF" > <br /> <?php echo "<center><img border=\"1\" src=\"myfile/product/".$showProduct['Product_Image']."\" width=\"100\" height=\"100\"/>" ?> <br><img src="picture/bullet-new_old.gif" width="25" height="11"><a href="page_product_detail.php?Product_Id=<?php echo $showProduct['Product_Id']; ?>" ><?php echo $showProduct['Product_Id']; ?> <?php echo '<br />'.$showProduct['Product_Name']?> </a> <?php echo '<br />ราคา:'.$showProduct['Product_Saleprice']?>บาท </center> </td> <?php if($ColumnStart==$setColumn){//หากคอลัมน์เท่ากับจำนวนคอลัมน์ที่กำหนดไว้ echo '</tr><tr>';//สร้างแท็ก </tr> ปิด เพื่อจบแถว และสร้าง <tr>เพื่อสร้างแถวใหม่ $ColumnStart=0;//เซตเป็น 0 เพื่อเริ่มนับคอลัมน์ใหม่ } $ColumnStart++;//เพิ่มคอลัมน์ทีละ1คอลัม </tr> } //--------------เช็คเเสดง สินค้า Hot-----------------// if($showProduct['Product_Status']=='2'){?> <td bgcolor="#FFCCFF" > <br /> <?php echo "<center><img border=\"1\" src=\"myfile/product/".$showProduct['Product_Image']."\" width=\"100\" height=\"100\"/>" ?> <br><img src="picture/bullet-hot.gif" width="25" height="11"><a href="page_product_detail.php?Product_Id=<?php echo $showProduct['Product_Id']; ?>" ><?php echo $showProduct['Product_Id']; ?> <?php echo '<br />'.$showProduct['Product_Name']?></a> <?php echo '<br />ราคา:'.$showProduct['Product_Saleprice']?>บาท </center> </td> <?php if($ColumnStart==$setColumn){//หากคอลัมน์เท่ากับจำนวนคอลัมน์ที่กำหนดไว้ echo '</tr><tr>';//สร้างแท็ก </tr> ปิด เพื่อจบแถว และสร้าง <tr>เพื่อสร้างแถวใหม่ $ColumnStart=0;//เซตเป็น 0 เพื่อเริ่มนับคอลัมน์ใหม่ } $ColumnStart++;//เพิ่มคอลัมน์ทีละ1คอลัม </tr> } //--------------เช็คเเสดง สินค้าทั่วไป-----------------// if($showProduct['Product_Status']=='3'){?> <td bgcolor="#FFCCFF" > <br /> <?php echo "<center><img border=\"1\" src=\"myfile/product/".$showProduct['Product_Image']."\" width=\"100\" height=\"100\"/>" ?> <br><a href="page_product_detail.php?Product_Id=<?php echo $showProduct['Product_Id']; ?>" ><?php echo $showProduct['Product_Id']; ?> <?php echo '<br />'.$showProduct['Product_Name']?> </a> <?php echo '<br />ราคา:'.$showProduct['Product_Saleprice']?>บาท </center> </td> <?php if($ColumnStart==$setColumn){//หากคอลัมน์เท่ากับจำนวนคอลัมน์ที่กำหนดไว้ echo '</tr><tr>';//สร้างแท็ก </tr> ปิด เพื่อจบแถว และสร้าง <tr>เพื่อสร้างแถวใหม่ $ColumnStart=0;//เซตเป็น 0 เพื่อเริ่มนับคอลัมน์ใหม่ } $ColumnStart++;//เพิ่มคอลัมน์ทีละ1คอลัม </tr> } } ?> </tr> </table> </p></th> </tr> </table></th> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <p> </p></td> </tr> </table> </body> </html>
<? //เปลี่ยนสถานะ เป็น"ทั่วไป" ตามวันที่บวกไป +30 day จากdatabase date_default_timezone_set('Asia/Bangkok'); $date= date("y-m-d"); echo"$date"; if($showProduct['datetime30']==$date){ $strSQL3 = "UPDATE product SET Product_Status ='3' where datetime30='$date' "; $objQuery3 = mysql_query($strSQL3); }
<?php include("db_connect.php"); //เปลี่ยนสถานะ เป็น"ทั่วไป" ตามวันที่บวกไป +30 day จากdatabase date_default_timezone_set('Asia/Bangkok'); $strSQL3 = "UPDATE product SET Product_Status ='3' where datetime30<CURDATE() AND Product_Status<3 "; mysql_query($strSQL3); ?> <html> <head> <title>KOMBRA Underware Shop</title> <style type="text/css"> body { background-image: url(picture/7b00JsA.gif); } </style> </head> <body> <table width="1280" height="1024" border="0" align="center"> <tr><th height="300" colspan="2" scope="col"><? include"include/image_main_user.php"; ?></th></tr> <tr><td height="49" bgcolor="#FFC1E0" colspan="2"><? include"include/menubar_user.php" ?></td></tr> <tr> <td width="280" align="center" valign="top" bgcolor="#FFC1E0"><? include"test_menu.php" ?></td> <td align="center" valign="top" bgcolor="#FFC1E0"> <table width="1000" border="0"> <tr><th scope="col"> <table width="999" height="545" border="0" align="center"> <tr> <th align="left" valign="top" scope="row"> <h3>รายการสินค้า</h3> <ul style="width: 100%; list-style: none; padding: 0px;"> <?php $setColumn=4;//แสดง3คอลัมน์ต่อ1แถว ถ้าต้องการให้แสดงกี่คอลัมน์ให้กำหนดตรงนี้ $ColumnStart=1;//คอลัมน์เริ่มต้นเป็น 1 เสมอ $strSQL = "SELECT * FROM product where Sub_ID like '%".$_GET["Sub_ID"]."%' and Product_Category_ID like '%".$_GET["Category_ID"]."%' and Product_Status like '%".$_GET["Product_Status"]."%' ORDER BY datetime DESC limit 10"; //กำนดแสดงข้อมูล แค่ 10 แถว $rs = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); //ดึงข้อมูลล่าสุด10แถวจากเทเบิล while($ro=mysql_fetch_assoc($rs)){ extract($ro); switch($Product_Status){ case '1': $img="<img src='picture/bullet-new_old.gif' width='25' height='11'>"; break; case '2': $img="<img src='picture/bullet-hot.gif' width='25' height='11'>"; break; default: $img=''; } //วันลูปแสดงผลสินค้าทีละแถว //--------------เช็คเเสดง สินค้า New-----------------// echo " <li style='display: block; background-color: #FFCCFF; width: 100px' ><br> <center> <img border='1' src='myfile/product/'$Product_Image' width='100' height='100' /> <br>$img <a href='page_product_detail.php?Product_Id=$Product_Id' >$Product_Id<br>$Product_Name</a> <br>ราคา: $Product_Saleprice บาท </center> </li>"; } ?> </ul> </th> </tr> </table></th> </tr> <tr><td> </td></tr> <tr><td> </td></tr> </table> <p> </p></td> </tr> </table> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง