<?php include('connect.php'); $cls_conn=new class_conn(); $id=$_REQUEST['id']; $sql=" select * from tb_customer"; $sql.=" where customer_id='$id'"; $sql.=" limit 1"; $result=$cls_conn->select_base($sql); while ($row = mysqli_fetch_array($result)) { $customer_fname=$row['customer_fname']; } echo $customer_fname; ?>
<script> function findcustomer(str) { if (str.length == 0) { document.getElementById("customer_fname").innerHTML = ""; return; } else { var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (xmlhttp.readyState == 4 && xmlhttp.status == 200) { document.getElementById("customer_fname").value = xmlhttp.responseText; var qty= xmlhttp.responseText; } } xmlhttp.open("GET", "find_customer.php?id="+str, true); xmlhttp.send(); } } function filter() { var keyword = document.getElementById("customer_fname").value; var select = document.getElementById("customer_id"); for (var i = 0; i < select.length; i++) { var txt = select.options[i].text; if (txt.substring(0, keyword.length).toLowerCase() !== keyword.toLowerCase() && keyword.trim() !== "") { select.options[i].style.display = 'none'; } else { select.options[i].style.display = 'list-item'; } } } </script> <div class="form-group"> <label for="customer_id" class="col-sm-2 control-label">ชื่อลูกค้า</label> <div class="col-sm-2"> <input type="text" class="form-control" name="customer_fname" id="customer_fname" placeholder="กรองชื่อลูกค้า" onkeyup="filter()"> </div> <div class="col-sm-8"> <select name="customer_id" id="customer_id" class="form-control" onchange="findcustomer_current(this.value)"> <option value=""> --กรุณาเลือก-- </option> <?php $sqld=" select * from tb_customer"; if(isset($_GET['customer_id'])) { $customer_id=$_GET['customer_id']; $sqld.=" where"; $sqld.=" customer_id='$customer_id'"; } $resultd=$cls_con->select_base($sqld); while($rowd=mysqli_fetch_array($resultd)) { $customer_id=$rowd['customer_id']; $customer_fname=$rowd['customer_fname']; ?> <option value="<?=$customer_id;?>"> <?=$customer_fname;?> </option> <?php } ?> </select> </div> </div>
<? $id=$_GET[p_id]; //$id_edit=$_GET[id_edit]; //TARGET='_blank' //include "connect.php"; echo "adfadsf$id"; ?>
$("#your_target_id option:first").attr('selected','selected'); $("#your_target_id").val($("#your_target_id option:first").val()); $( "#your_target_id" ).change();
if(isset($_POST["OK"])){ // do some thing code SQL AND WHERE (Condition) Your Text }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง