SELECT a.*,b.* FROM tb_order a LEFT JOIN tb_customer b ON a.CustomerID = b.CustomerID WHERE b.CustomerName LIKE '%Win%'
<?php include 'navbar.php'; ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>TMS PLASE</title> <style type="text/css"> <!-- body { background-color: #FFFFFF; } .style2 {color: #000000} --> </style></head> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous"> <body> <p> </p> <form id="form1" name="form1" method="post" action=""> <?php Include_once ("../tmsplate/db/connectDatabase.php"); $buttonss=$_POST['s']; $buttonsave=$_POST['save']; $buttondell=$_POST['delete']; $buttonedit=$_POST['edit']; $buttonclear=$_POST['clear']; $s1=$_POST['ss']; $s2="'$s1'"; ?> <?php if ($buttonss=="s") { $std1="no"; $std="'$std1'"; $strSQL = "SELECT * FROM lendred where vincar like '%$s1%' and statuslend=$std or idplatered like '%$s1%' and statuslend=$std "; $strSQL .= "ORDER BY vincar asc "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $num_rows = mysql_num_rows($objQuery); } else { $std1="no"; $std="'$std1'"; $strSQL = "SELECT * FROM lendred where statuslend=$std "; $strSQL .= "ORDER BY daylend desc "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $num_rows = mysql_num_rows($objQuery); } ?> <p> </p> <table width="1058" height="151" border="0" align="center"> <tr> <td width="968" height="147" valign="top"><ul class="nav nav-tabs"> <li role="presentation" class="active"><a href="#">ป้ายแดง</a></li> </ul> <div align="left"></div> <p> </p> <p> </p> <table width="318" height="47" border="0" align="left"> <tr> <td width="49" height="43">ค้นหา</td> <td width="118"><label> <input name="ss" type="text" id="ss" maxlength="20" /> </label></td> <td width="137"><label> <input type="image" name="s" value="s" src="img/icon1/Search Filled-50.png" width="25%" alt="ค้นหา" /> <input type="image" name="ss2" value="submit" src="img/icon1/Restart Filled-50.png" width="25%" alt="รี" /> </label></td> </tr> </table> <p> </p> <p align="right"> <label></label> </p></td> </tr> </table> <table width="1058" height="1064" border="0" align="center"> <tr> <td height="1058" valign="top"> <ul class="nav nav-tabs"> <li role="presentation" class="active"><a href="#">รายการยืมป้ายแดง</a></li> </ul> <p> </p> <table width="200" border="0"> <tr> <td width="59">ป้ายค้าง</td> <td width="63" align="center" bgcolor="#FFFF99"><?php echo $num_rows;?></td> <td width="56" align="center">ป้าย</td> </tr> </table> <p> </p> <table width="1058" height="28" border="1" align="center"> <tr> <td width="80" bgcolor="#999999">ลำดับ</td> <td width="95" bgcolor="#999999"><div align="center" class="style2"> <div align="center">เลขทะเบียน</div> </div></td> <td width="200" bgcolor="#999999"><div align="center" class="style2"> <div align="center">Vin</div> </div></td> <td width="124" bgcolor="#999999"><div align="center">รุ่นรถยนต์</div></td> <td width="149" bgcolor="#999999"><div align="center">ชื่อลูกค้า</div></td> <td width="105" bgcolor="#999999"><div align="center">Sales</div></td> <td width="92" bgcolor="#999999"><div align="center">เลขที่ใบเสร็จ</div></td> <td width="83" bgcolor="#999999"><div align="center">วันที่ยืม</div></td> <td width="58" bgcolor="#999999"><div align="center">Show</div></td> <td width="75" bgcolor="#999999"><div align="center">คืนป้าย</div></td> </tr> </table> <table width="1058" height="28" border="1" align="center"> <?php $num1=1; while($objResult = mysql_fetch_array($objQuery)) { $dd=$objResult["statuslend"]; //if($dd=="no") //{ ?> <tr> <td width="80" bgcolor="#CCCCCC"><?php echo $num1++ ?></td> <td width="95" bgcolor="#CCCCCC"><div align="center"><?php echo $objResult["idplatered"];?> </div></td> <td width="200" bgcolor="#CCCCCC"><div align="center"><?php echo $objResult["vincar"];?></div></td> <?php $idseriescar=$objResult["idseriescar"]; $idseriescar1="'$idseriescar'"; $strSQL2 = "SELECT * FROM seriescar where idseriescar=$idseriescar1 "; $objQuery2 = mysql_query($strSQL2) or die ("Error Query [".$strSQL2."]"); $objResult2 = mysql_fetch_array($objQuery2); ?> <td width="124" bgcolor="#CCCCCC"><div align="center"><?php echo $objResult2["nameseries"];?></div></td> <?php $idcus1=$objResult["idcus"]; $idcus2="'$idcus1'"; $strSQL3 = "SELECT * FROM customer where idcus=$idcus2 "; $objQuery3 = mysql_query($strSQL3) or die ("Error Query [".$strSQL3."]"); $objResult3 = mysql_fetch_array($objQuery3); ?> <td width="149" bgcolor="#CCCCCC"><div align="center"><?php echo $objResult3["namecus"]," ",$objResult3["surcus"];?></div></td> <?php $idsell=$objResult["idsalse"]; $idsell2="'$idsell'"; $strSQL4 = "SELECT * FROM sales where idsales=$idsell2 "; $objQuery4 = mysql_query($strSQL4) or die ("Error Query [".$strSQL4."]"); $objResult4 = mysql_fetch_array($objQuery4); ?> <td width="105" bgcolor="#CCCCCC"><div align="center"><?php echo $objResult4["namesales"];?></div></td> <td width="92" bgcolor="#CCCCCC"><div align="center"><?php echo $objResult["idpay"];?></div></td> <td width="83" bgcolor="#CCCCCC"><div align="center"><?php echo $objResult["daylend"];?></div></td> <td width="58" bgcolor="#CCCCCC"> <div align="center"> <button type="button" class="btn btn-default btn-sm" onclick="window.location='lendredprint.php?vin2=<?php echo $objResult["vincar"];?>'" style="margin:3px;"><span class='glyphicon glyphicon-print'></span></button> </div> </td> <td width="75" bgcolor="#CCCCCC"><div align="center"> <label></label> <button type="button" class="btn btn-default btn-sm" onclick="window.location='lendredreturn.php?id=<?php echo $objResult["vincar"];?>'" style="margin:3px;"><span class='glyphicon glyphicon-share-alt'></span></button> </div></td> </tr> <?php } //} ?> </table> <p> </p> <p></p></td> </tr> </table> <p> </p> <p> </p> </form> <p> </p> <script type="text/javascript" src="js/jquery.min.js"> </script> <script type="text/javascript" src="js/bootstrap.min.js"> </script> </body> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script> </html>
$strSQL = "SELECT lendwhite.*, lendred.*, customer.* FROM lendwhite LEFT JOIN lendred ON lendwhite.vincar = lendred.vincar LEFFT JOIN customer ON lendred.idcus = customer.idcus WHERE customer.namecus like '%$idred3%' ";
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง