<script language="JavaScript"> var HttPRequest = false; function doCallAjax(Mode) { HttPRequest = false; if (window.XMLHttpRequest) { // Mozilla, Safari,... HttPRequest = new XMLHttpRequest(); if (HttPRequest.overrideMimeType) { HttPRequest.overrideMimeType('text/html'); } } else if (window.ActiveXObject) { // IE try { HttPRequest = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { HttPRequest = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!HttPRequest) { alert('Cannot create XMLHTTP instance'); return false; } var url = 'excel_ordersave.php'; var pmeters = "tRequest_name=" + encodeURI( document.getElementById("txtRequest_name").value) + "&tRequest_date=" + encodeURI( document.getElementById("txtRequest_date").value ) + "&tEquipment=" + encodeURI( document.getElementById("Equipment").value ) + "&tChemical=" + encodeURI( document.getElementById("Chemical").value ) + "&tEbzyme=" + encodeURI( document.getElementById("Ebzyme").value ) + "&tOther=" + encodeURI( document.getElementById("txtOther").value ) + "&tProject=" + encodeURI( document.getElementById("txtProject").value ) + "&tRequested_objective=" + encodeURI( document.getElementById("txtRequested_objective").value ) + "&tDescription=" + encodeURI( document.getElementById("txtDescription").value ) + "&tSupplier_name=" + encodeURI( document.getElementById("txtSupplier_name").value ) + "&tSize=" + encodeURI( document.getElementById("txtSize").value ) + "&tQuantity=" + encodeURI( document.getElementById("txtQuantity").value ) + "&tPrize=" + encodeURI( document.getElementById("txtPrize").value ) + "&tMode=" + Mode; HttPRequest.open('POST',url,true); HttPRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); HttPRequest.setRequestHeader("Content-length", pmeters.length); HttPRequest.setRequestHeader("Connection", "close"); HttPRequest.send(pmeters); HttPRequest.onreadystatechange = function() { if(HttPRequest.readyState == 3) // Loading Request { document.getElementById("mySpan").innerHTML = "Now is Loading..."; } if(HttPRequest.readyState == 4) // Return Request { document.getElementById("mySpan").innerHTML = HttPRequest.responseText; document.getElementById("txtRequest_name").value = ''; document.getElementById("txtRequest_date").value = ''; document.getElementById("Equipment").value = ''; document.getElementById("Chemical").value = ''; document.getElementById("Ebzyme").value = ''; document.getElementById("txtOther").value = ''; document.getElementById("txtProject").value = ''; document.getElementById("txtRequested_objective").value = ''; document.getElementById("txtDescription").value = ''; document.getElementById("txtSupplier_name").value = ''; document.getElementById("txtSize").value = ''; document.getElementById("txtQuantity").value = ''; document.getElementById("txtPrize").value = ''; } } //เช็คค่า ว่าได้ทำการ เลือก redio หรือป่าว ถ้าไม่ได้เลือกให้แสดงข้อความแสดง var Equipment=document.getElementById('Equipment'); var Chemical=document.getElementById('Chemical'); var Ebzyme=document.getElementById('Ebzyme'); var Other=document.getElementById('Other'); if (Equipment.checked) {Order_Type = Equipment.value;} else if (Chemical.checked) { Order_type = Chemical.value; } else if (Ebzyme.checked) { Order_type = Ebzyme.value; } else if (Other.checked) { Order_type = Other.value; } else { alert ("กรุณาเลือก Order Type ! ") } alert (Order_type); req.onreadystatechange = function(){ if(req.readyState == 4){ if(req.status == 200){ } } } ///******************************************* } </script> <script type="text/javascript">///เรียกใช้ Texbox ถ้าไม่ต้องการก็ไม่ต้องเลือก Radio function ck_frm(){ var ck = document.getElementById('Other'); if(ck.checked == true){ document.getElementById('frm_txt').style.display = ""; }else{ document.getElementById('frm_txt').style.display = "none"; } } </script>
<? include"../config/conect_L.php"; $objConnect = mysql_connect("$host","$user","$Pass") or die("Error Connect to Database"); mysql_query("SET NAMES UTF8"); $objDB = mysql_select_db("$dbprimer"); ?> <img src="../../icon/img/orderexcelrice.png"> <br><br><font color="#006600" size="3"><b><u>SUPPLIER/PURCHASING/REQUEST/EVALUATION</u></b></font> <form name="frmMain"> <br><br><br><br> <div class="roundedcornr_box_168289"> <div class="roundedcornr_top_168289"></div> <div class="roundedcornr_content_168289"> <br> <p> <table border="0"> <tr> <td><font color="#006600" size="2"><b>Request Name</b></font><font color="#006600" size="2"><b>(ผู้ขอซื้อ):</b></font></td> <td><input type="text" name="Request_name" value="<? echo $_POST['Request_Name']; ?>" id="txtRequest_name"/></td> <td><font color="#006600" size="2"><b>Request Date:</b></font> </td> <td><input type="text" name="Request_date" value="<? echo $_POST['Request_date']; ?>" id="txtRequest_date"/></td> </tr> <tr> <td><font color="#006600" size="2"><b>Order Type:</b></font></td> </tr> <tr> <td><input type="radio" value="Equipment" name="Order_type" id="Equipment" /> <font color="#006600" size="2">Equipment (วัสดุอุปกรณ์)</font></td> <td><input type="radio" value="Chemical" name="Order_type" id="Chemical" /> <font color="#006600" size="2">Chemical (สารเคมี)</font></td> <td><input type="radio" value="Ebzyme" name="Order_type" id="Ebzyme" /> <font color="#006600" size="2">Enzyme (เอนไซม์)</font></td> <td> <font color="#006600" size="2"><input type="radio" name="Order_type" id="Other" onClick="ck_frm();" />Other (อื่นๆ)</font> </td> <td><div id="frm_txt" style="display:none;"> <input type="text" name="Other" size="30" id="txtOther"/> </div></td> </tr> <tr> <td><font color="#006600" size="2"><b>Project (โครงการ):</b></font></td> <td><? $strSQL = "SELECT DISTINCT Project_primer From $Project_type ORDER BY Id_no DESC "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");?> <select name="txtProject" size="1" id="txtProject"> <option value="">--Select List--</option> <? while($objResult = mysql_fetch_array($objQuery)) {?> <option value="<?php echo $objResult["Project_primer"]; ?>"> <?=$objResult["Project_primer"];?> </option> <? } ?> </select></td> </tr> <tr> <td><font color="#006600" size="2"><b>Requeste Objective(วัตถุประสงค์ที่สั่งซื้อ)</b></font></td> </tr> <tr> <td colspan="4"> <textarea cols="100" rows="5" name="Requested_objective" id="txtRequested_objective"></textarea></td> </tr> </table> <br><br> </p> </div> <div class="roundedcornr_bottom_168289"><div></div></div> </div> <br><br> <img src="../../icon/img/list_order.png"> <table width="800" border="0"> <tr> <td align="center"><font color="#006600" size="2"><b>Row (จำนวน แถว)</b></font></td><td> <input type="text" id="row_tb" name="row_tb" /> <input type="button" name="Button" value="Insert Record" onclick="loop_insert()" /></td> </tr> </table> <div class="roundedcornr_box_168289"> <div class="roundedcornr_top_168289"></div> <div class="roundedcornr_content_168289"> <br> <p> <table width="800" border="1" id="myTable"> <tr> <th width="50"><font color="#006600">No.</font></th> <th><font color="#006600">Description.</font></th> <th><font color="#006600">Supplier Name.</font></th> <th><font color="#006600">Size.</font></th> <th><font color="#006600">Quantity.</font></th> <th><font color="#006600">Prize.</font></th> <th><font color="#006600">Source.</font></th> </tr> <script> function loop_insert(){ var num=document.getElementById('row_tb').value for(i=1;i<=num;i++){ insert_row() } } function insert_row(){ var myTable=document.getElementById('myTable') var current_row=document.getElementById('myTable').rows.length var x=myTable.insertRow(current_row) // insert new row var y=myTable.rows // get attribute of row var a=x.insertCell(0) // assign position of cell 1 in new row var b=x.insertCell(1) // assign position of cell 2 in new row var c=x.insertCell(2) // assign position of cell 3 in new row var d=x.insertCell(3) // assign position of cell 4 in new row var f=x.insertCell(4) // assign position of cell 5 in new row var e=x.insertCell(5) // assign position of cell 6 in new row var g=x.insertCell(6) // assign position of cell 7 in new row a.innerHTML=current_row b.innerHTML="<input type='text' name='Description[]' size='40' id='txtDescription' />" c.innerHTML="<input type='text' name='Supplier_name.[]' size='40' id='txtSupplier_name' />" d.innerHTML="<input type='text' name='Size[]' size='3' id='txtSize' />" f.innerHTML="<input type='text' name='Quantity[]' size='6' id='txtQuantity' />" e.innerHTML="<input type='text' name='Prize[]' size='3' id='txtPrize'/>" g.innerHTML="<input type='text' name='Source[]' id='txtSource' />" } </script> </table> <br><br> <span id="mySpan"></span> <br><br><br><br> </div> <div class="roundedcornr_bottom_168289"><div></div></div> </div> <br><br><br><br> <table><tr><td><input type="button" name="btnAdd" id="btnAdd" value="Add" OnClick="JavaScript:doCallAjax('ADD');"><input type="reset" value="เยิกเลิกรายการทั้งหมด"></td></tr></table> <br> </form>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง