<script type="text/javascript"> window.onbeforeunload = function() { return "คุณต้องการจะออกจากหน้านี้ใช่หรือไม่ ข้อมูลการเช่าปัจจุบันจะถูกลบออกทั้งหมดนะค่ะ "; } </script>--> <script language="javascript"> function Checkform() { if(document.add_movie.id_movie_rent.value==""){ alert("กรุณากรอก รหัส ด้วยค่ะ"); document.add_movie.id_movie_rent.focus(); return false; } } /*function fncConfirm1() { function fncConfirm1() { if(confirm('Goto 1')==true) { window.location = 'page1.cgi'; } } */ </script> <? if (isset($_POST['submit_rent'])) { if($_GET['add']=="1") { $id_movie=trim($_POST['id_movie_rent']); $check_movie=mysql_num_rows(mysql_query("SELECT movie.* FROM movie WHERE MovieID='$id_movie' ")); if ($check_movie=="0") { print '<SCRIPT LANGUAGE="JavaScript"> alert("ไม่พบข้อมูลภาพยนตร์"); location.href = "" document.write(location.href) </SCRIPT> '; } else { $numq_td=mysql_fetch_array(mysql_query(" SELECT movie.*,ratemovie.* FROM movie INNER JOIN ratemovie ON (ratemovie.RateID=movie.RateID) WHERE movie.MovieID='$id_movie' ")); if ($numq_td['MovieinShop']==0) { print '<SCRIPT LANGUAGE="JavaScript"> alert("ภาพยนตร์ หมดจากร้านแล้วค่ะ "); location.href = "" document.write(location.href) </SCRIPT> '; } else { if ($numq_td['MovieID']=="$id_movie") { $check01=mysql_num_rows(mysql_query(" SELECT * FROM carrent WHERE MovieID='$id_movie' and carrent.isd=".$_SESSION["id_customer"]." ")); $ccc=1; if($check01==0) { if ($_SESSION["age_customer"] < $numq_td['RateAge']) { $_SESSION["id_movie"]=$id_movie; ?> <SCRIPT LANGUAGE="JavaScript"> if(confirm("อายุสมาชิกไม่เหมาะสมกับภาพยนตร์เรื่องนี้ คุณต้องการให้เช่า ภาพยนตร์ใช่หรือไม")==false) { } else { window.location = "page_addmovie.php"; } </SCRIPT> <? } else { $inputcart=mysql_query(" INSERT INTO `carrent` (isd,MovieID) VALUES (".$_SESSION["id_customer"].",'$id_movie')" ); } } else { ?> <SCRIPT LANGUAGE="JavaScript"> alert("ภาพยนตร์ดังกล่าวอยู่ในรายการเช่าแล้วค่ะ "); location.href = "center.php?action=rent&step=2&confirm=1" document.write(location.href) </SCRIPT> <? } } else { } } } } else { } } // end isset($_POST['submit_rent'])) ?> <div style=" width:100%; height:25px; text-align:center; font-size:11pt; margin-top:20px;" ><strong> กรอกรหัสภาพยนตร์ที่ต้องการเช่า</strong></div> <div style=" width:100%; height:25px; text-align:center; margin-top:5px; margin-bottom:10px;" > <form name="add_movie" action="center.php?action=rent&step=2&confirm=1&add=1" method="post" onSubmit="return Checkform();" > <input name="id_movie_rent" id="id_movie_rent" type="text" /><input name="submit_rent" id="submit_rent" type="submit" value="เช่า" OnClick="JavaScript:fncConfirm1();" /> </form> </div> <div style="width:750px; margin-left:10px; height:auto; overflow:hidden; font-size:10pt;" > <div style="width:100%; height:auto; overflow:hidden;" > <div style="width:300px; float:left;" > รายการภาพยนตร์ที่เช่า : </div> <div style="width:400px; float:right; padding-right:10px; text-align:right;" > สมาชิก <? print $_SESSION["name_customer"];?> ( <? print $_SESSION['MemberType']; ?> มีส่วนลด <? print $_SESSION['DisRent']; ?> % ) <!--อายุ <? print $_SESSION["age_customer"];?>--> </div> </div> <p> <form name="add_movie" action="center.php?action=rent&step=2&confirm=2" method="post" > <table width="750" border="0" class="datatable"> <tr bgcolor="#B3DDE1" height="25" > <td width="126" align="center">รหัสภาพยนตร์ </td> <td width="385" align="center">ชื่อภาพยนตร์ </td> <td width="120" align="center">จำนวนวันให้เช่า</td> <td width="99" align="center">ค่าเช่า</td> </tr> <? $query_isd=mysql_query("SELECT carrent.*,movie.* FROM carrent INNER JOIN movie ON (movie.MovieID=carrent.MovieID) WHERE carrent.isd=".$_SESSION["id_customer"]." Order By carrent.carrent_id ASC "); $n=0; while ($row_show01=mysql_fetch_array($query_isd)) { $n++; ?> <tr> <td align="center"><? print $row_show01['MovieID']; ?> <input type="hidden" value="<? print $row_show01['MovieID']; ?>" name="movieid_<? print $n; ?>" > </td> <td><? print $row_show01['MovieName']; ?></td> <td align="center"><? print $row_show01['RentDay']; ?> <input type="hidden" value="<? print $row_show01['RentDay']; ?>" name="dateback_<? print $n; ?>" > </td> <td align="center"> <? print $Price_all=price_product($_SESSION["MemberTypeID"],$row_show01['RentPrice']); ?> <input type="hidden" value="<? print $Price_all; ?>" name="pricemovie_<? print $n; ?>" > <? //print $Price_2=$row_show01['RentPrice']-($row_show01['RentPrice']*(10/100)); $sumPrice_2+=$Price_all; //$sumPrice+=$row_show01['RentPrice']; ?> </td> </tr> <? } if($n>=1) { ?> <tr> <td colspan="3" align="right">ค่าเช่าสุทธิ </td> <td align="center"><? print number_format($sumPrice_2,2); ?> <input type="hidden" value="<? print $n; ?>" name="sumnumber" id="sumnumber"> </td> </tr> <? } else { print ' <tr> <td colspan="3" align="center"><h3><font color=red >ยังไม่มีรายการเช่าภาพยนตร์ </font></h3></td> <td align="center"></td> </tr> '; } ?> </table> </p> <? if($n>=1) { ?> <div style=" width:100%; height:25px; text-align:center; font-size:10pt; margin-top:20px;" > <input name="" type="button" value="ลบทั้งหมด" ONCLICK="window.location.href='center.php?action=rent&step=2&confirm=0'" /> <input name="" type="button" value="ทำรายการต่อไป" ONCLICK="window.location.href='center.php?action=rent&step=2&confirm=2'" /> <!--<input name="submit" type="submit" id="submit" value="ยืนยันเราเช่า" />--> </div> <? } else { } ?> </form> </div>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง