<script src="js/jquery-1.4.1.min.js" type="text/javascript"></script> // หาโหลดเอาคับ พิม jquery ใน google <? include ("connect_db.inc.php"); $code = 'A0001'; $sql = " SELECT time FROM tabel WHERE code = $code "; $query = mysql_query($sql); $rw = mysql_fetch_array($query); ?> <input type="submit" name="btn_ok" id="btn_ok" value="OK"> <input type="hidden" name="value" id="value" value="<?=$rw['code']?>" />
$(function(){ $("#btn_ok").live('click', function(){ export_excel (); }); }); function export_excel (){ var cuscode = $("#value").val(); if(cuscode!=''){ $.ajax({ type: "POST", url: "update_order.php", data: "value="+cuscode, success: function(data){ }else{ alert('ไม่สามารส่งข้อมูลได้'); } }
<?php header("Content-Type: application/vnd.ms-excel"); header('Content-Disposition: attachment; filename="stocklist.xls"');#ชื่อไฟล์ ?> <html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"> <HTML> <HEAD> <meta http-equiv="Content-type" content="text/html;charset=windows-874" /> </HEAD><BODY> <? include "config/config.inc.php"; $cusocde = $_REQUEST['value']; $where = " Where cuscode ='".$cusocde."' "; $sql_rows = "Select * FROM table $where "; $sql = mysql_query($sql_rows); ?> <table x:str BORDER="1"> <tr align="center" bgcolor="#e0e4e8"> <td width="10%" nowrap="nowrap" bgcolor="#e0e4e8" >รหัส</td> <td width="40%" nowrap="nowrap" bgcolor="#e0e4e8" >ลูกค้า</td> </tr> <? if(mysql_num_rows($sql)){ $color = 1; $i=1; while($rw = mysql_fetch_array($sql)){ $i++; $bgr = ($color=($color+1)%2) ? '#EBEDF1' : '#FFFFFF'; ?> <tr valign="top" bgcolor="<?=$bgr?>" onMouseOver="bgr_color(this, '#FFCC99')" onMouseOut="bgr_color(this, '<?=$bgr?>')"> <td align="center" valign="middle" nowrap="nowrap" ><div align="left"><?=$rw['cuscode']?></div></td> <td align="center" valign="middle" nowrap="nowrap" ><div align="left"><?=$rw['cusname']?></div></td> </tr> <? } }else{?> <tr valign="top" bgcolor="<?=$bgr?>" onMouseOver="bgr_color(this, '#FFCC99')" onMouseOut="bgr_color(this, '<?=$bgr?>')"> <td colspan="4" align="center" valign="middle" nowrap="nowrap" >ไม่มีข้อมูล</td> </tr> <? }?> </table> </BODY> </HTML>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง