<?php $email = $_POST["email"]; $name = $_POST["name"]; $idproduct = $_POST["idproduct"]; $bank = $_POST["bank"]; $bankID = $_POST["bankID"]; $sDay = $_POST["sDay"]; $sMonth = $_POST["sMonth"]; $sYear = $_POST["sYear"]; $date = $_POST["date"]; $txtdate = $_POST["txtdate"]; $price = $_POST["price"]; $phone = $_POST["phone"]; $emailmember = $_POST["emailmember"]; $fileAttach = (isset($_POST['$fileAttach']) ? $_POST['$fileAttach'] : ''); $strSubject = "=?UTF-8?B?".base64_encode("แจ้งชำระเงิน")."?="; $strVar = "My Message"; $strMessage = "nl2br <h1>แจ้งชำระเงิน</h1><br> <table width='285' border='1'> <tr> <td>ส่งถึง</td> <td>".$email."</td> </tr> <tr> <td>ชื่อลูกค้า</td> <td>".$name."</td> </tr> <tr> <td>รหัสการสั่งซื้อ</td> <td>".$idproduct."</td> </tr> <tr> <td>ธนาคาร</td> <td>".$bank."</td> </tr> <tr> <td>หมายเลขบัญชี</td> <td>".$bankID."</td> </tr> <tr> <td>จำนวนเงิน</td> <td>".$price." บาท</td> </tr> <tr> <td>ช่วงเวลา</td> <td>วันที่ ".$sDay." เดือนที่ ".$sMonth." ปี ".$sYear." เวลา".$date." : ".$txtdate." นาที</td> </tr> <tr> <td>หมายเลขโทรศัพท์</td> <td>".$phone."</td> </tr> <tr> <td>อีเมลลูกค้า</td> <td>".$emailmember."</td> </tr> <tr> <td>หลักฐานการโอน</td> <td>".$fileAttach."</td> </tr> </table>"; //*** Uniqid Session ***// $strSid = md5(uniqid(time())); $strHeader = ""; $strHeader .= "From: ".$_POST["name"]."<".$_POST["emailmember"].">\nReply-To: ".$_POST["emailmember"].""; $strHeader .= "MIME-Version: 1.0\n"; $strHeader .= "Content-Type: multipart/mixed; boundary=\"".$strSid."\"\n\n"; $strHeader .= "This is a multi-part message in MIME format.\n"; $strHeader .= "--".$strSid."\n"; $strHeader .= "Content-type: text/html; charset=windows-874\n"; // or UTF-8 // $strHeader .= "Content-Transfer-Encoding: 7bit\n\n"; $strHeader .= $strMessage."\n\n"; //*** Attachment ***// if($_FILES["fileAttach"]["name"] != "") { $strFilesName = $_FILES["fileAttach"]["name"]; $strContent = chunk_split(base64_encode(file_get_contents($_FILES["fileAttach"]["tmp_name"]))); $strHeader .= "--".$strSid."\n"; $strHeader .= "Content-Type: application/octet-stream; name=\"".$strFilesName."\"\n"; $strHeader .= "Content-Transfer-Encoding: base64\n"; $strHeader .= "Content-Disposition: attachment; filename=\"".$strFilesName."\"\n\n"; $strHeader .= $strContent."\n\n"; } $flgSend = @mail($email,$strSubject,null,$strHeader); // @ = No Show Error // if($flgSend) { echo "Email Sending."; } else { echo "Email Can Not Send."; } ?>
<?php session_start(); error_reporting(0);?> <!--title--> <?php include("menu-end/title.php");?> <!--title--> <!--menu--> <?php include("menu-end/menu.php");?> <br><br> <div class="container"> <div class="row"> <div class="table-responsive"> <div class="panel panel-info"> <div class="panel-heading"> ตรวจสอบสถานะการสั่งซื้อสินค้า </div> <center><div class="panel-body"> <form name="frmSearch" method="get" action="<?php echo $_SERVER['SCRIPT_NAME'];?>"> <table class="table"> <tr> <th>กรุณากรอกหมายเลขการสั่งซื้อ/หรือชื่อของท่าน <input name="txtKeyword" type="text" id="txtKeyword" value="<?php echo $_GET["txtKeyword"];?>"> <input type="submit" value="ค้นหา"></th> </tr> </table> </form></center> <?php if($_GET["txtKeyword"] != "") { $mysqli = mysqli_connect("localhost","id3123338_bigsizeworth","0856435587") or die("Error Connect to Database"); $mysqli->select_db("id3123338_bigsizeworth_db"); mysqli_query($mysqli,"SET NAMES UTF8"); // Search By Name or Email $strSQL = "SELECT * FROM new_oder WHERE (OrderID LIKE '%".$_GET["txtKeyword"]."%' or name LIKE '%".$_GET["txtKeyword"]."%' )"; $objQuery = mysqli_query($mysqli,$strSQL) or die ("Error Query [".$strSQL."]"); $num=mysqli_num_rows($objQuery ); if ($num <= 0) { echo"<script> alert('ไม่พบข้อมูล กรุณากรอกรหัสสั่งซื้อหรือชื่อของท่านใหม่ครับ')</script>"; } ?> <div class="table-responsive"> <table class="table"> <tr> <th width="91" class="bg-primary"> <div align="center"><font color="#ffffff">OrderID </font></div></th> <th width="98" class="bg-primary"> <div align="center"><font color="#ffffff">ชื่อลูกค้า </font></div></th> <th width="198" class="bg-primary"> <div align="center"><font color="#ffffff">ที่อยู่ในการจัดส่ง </font> </div></th> <th width="97" class="bg-primary"> <div align="center"><font color="#ffffff">หมายเลขโทรศัพท์ </font></div></th> <th width="59" class="bg-primary"> <div align="center"><font color="#ffffff">บัญชีธนาคาร </font></div></th> <th width="71" class="bg-primary"><div align="center"> <font color="#ffffff"> สถานะของสินค้า</font> </div></th> </tr> <?php while($objResult = mysqli_fetch_array($objQuery)) { $_SESSION["status"] = $objResult["status"]; $objResult["status"] = ""; // ลองเปลี่ยนตัวเลขตรงนี้นะครับ เพื่อทดสอบ if else ที่เราได้เขียนไว้ if($objResult["status"]==0){ echo "<font color='red'> รอชำระเงิน </font>"; } elseif ($objResult["status"]==1) { echo "<font color='green'> รอตรวจสอบการชำระเงิน </font>"; } elseif ($objResult["status"]==2) { echo "<font color='blue'> ชำระเงินถูกต้อง </font>"; } else{ echo "<font color='orange'> ตรวจสอบการจัดส่งสินค้า </font>"; echo "<h1> รหัส EMS xxxx </h1>"; } ?> <tr > <td class="bg-success"><div align="center"><?php echo $objResult["OrderID"];?></div></td> <td class="bg-success"><?php echo $objResult["name"];?></td> <td class="bg-success"><?php echo $objResult["address"];?> <?php echo $objResult["province"];?> <?php echo $objResult["amphur"];?> <?php echo $objResult["district"];?> <?php echo $objResult["postcode"];?></td> <td class="bg-success"><div align="center"><?php echo $objResult["tel"];?></div></td> <td class="bg-success"><?php echo $objResult["bank"];?> <?php echo $objResult["bankID"];?></td> <td class="bg-success"> <font color="#0000CC"> <?php echo $objResult["status"];?> </font></td> </tr> <?php } ?> </table></div></div> </div></div></div></div> <?php include('menu-end/end.php');?> <?php mysql_close($mysqli); } ?> <!---end--> <!--end--> </body> </php>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง