<? $sdate = $_POST['sdate']; //ช่วงวันที่เริ่มต้น $tdate = $_POST['tdate']; //ช่วงวันที่สิ้นสุด if(!empty($sdate)||($tdate)){ $query = "SELECT * FROM court_booking Where court_date_booking BETWEEN '$sdate' AND '$tdate'"; $sql_sum = "SELECT sum(total) AS sum_total FROM court_booking Where court_date_booking BETWEEN '$sdate' AND '$tdate'"; $sum_select = mysql_query($sql_sum) or die ("Error Query [".$sql_sum."]"); $row_sum = mysql_fetch_array($sum_select); }else{ $query = "SELECT court_num AS svname,racket AS svracket,lockers AS svlockers,DATE_FORMAT(court_date_booking,'%d/%m/%Y') AS cddate_add,total AS cdprice FROM court_booking "; $sql_sum = "SELECT sum(total) AS sum_total FROM court_booking"; $sum_select = mysql_query($sql_sum) or die ("Error Query [".$sql_sum."]"); $row_sum = mysql_fetch_array($sum_select); } $sql_select = mysql_query($query) or die ("Error Query [".$query."]"); $Num_Rows = mysql_num_rows($sql_select); ?> <table width="98.4%" cellpadding="0" cellspacing="0" border="0" style=" float:left; font-size:14px; margin:10px 0 -3px 0px;"> <tr> <td width="10%" align="left"><font style="float:left; margin:8px 7px 0 0;">เริ่มต้น :</font></td> <td width="23%"><div style="float:left;"><input type="text" name="sdate" class="tcal form-control input-sm" style="height:25px; width:150px; padding:0 0 0 5px;" autocomplete="off" value="<?=$_POST['sdate']?>"></div></td> <td width="10%" align="left"><font style="float:right; margin:8px 7px 0 0;">สิ้นสุด :</font></td> <td width="13%"><div><input type="text" name="tdate" class="tcal form-control input-sm" style="height:25px; width:150px; padding:0 0 0 5px;" autocomplete="off" value="<?=$_POST['tdate']?>"></div></td> <td width="25%"><input type="submit" value="แสดงรายงาน" class="btn btn-primary btn-sm" style="height:25px; line-height:15px; margin:10px 0 0 7px;" id="btn" style="float:left; margin:8px 0 0 5px;"></td> <td width="5%" align="right"><div id="no_print"><input type="button" class="btn btn-success btn-sm" style="height:25px; line-height:15px; margin:10px 0 0 7px;" id="btn" style="float:left; margin:8px 0 0 5px;" value="พิมพ์หน้านี้" id="pimcon" onclick="window.print()" style="float:right; margin:8px 1px 0 0;"></div></td> </tr> </table> </form> <table width="98.4%" cellpadding="0" cellspacing="0" border="0" style=" float:left; font-size:14px; margin:10px 0 5px 0;"> <tr height="10"> <td></td> <td></td> </tr> <?php if(!empty($sdate)||($tdate)){ ?> <tr height="25"> <td width="100" >ตั้งแต่วันที่ </td> <td align="left"><?=date_mounth_full($_POST['sdate']);?> - <?=date_mounth_full($_POST['tdate']);?></td> </tr> <? }else{ ?> <tr height="25"> <td width="120" align="left" ><h4>รายรับทั้งหมด </h4></td> <td align="left"></td> </tr> <? } ?> <tr height="25"> <td >จำนวนสินค้า</td> <td align="left"><?=number_format($Num_Rows)?> รายการ</td> </tr> <tr height="25"> <td >จำนวนเงิน</td> <td align="left"><?=number_format($row_sum[sum_total])?> บาท</td> </tr> </table> <div class="table-responsive" style=" width:100%; float:left; clear:both;border:1px solid #ccc; margin:5px 0 0 0; padding:3px; border-radius:3px;"> <table width="100%" class="table-striped" cellpadding="0" cellspacing="0" style="font-size:14px;"> <thead> <tr height="28" style="background:#eee;"> <th width="35%"> รายการบริการ</th> <th width="17%"><div style="float:left; width:100%; text-align:right;">ราคา </div></th> <th width="24%"><div style="float:left; width:100%; text-align:right;">วัน-เดือน-ปี </div></th> </tr> </thead> <tbody> <tr> <td colspan="9"><div style="width:100%; height:2px; background:#ccc;"></div></td> </tr> <?php $Per_Page = 10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $query .=" order by court_id DESC LIMIT $Page_Start , $Per_Page"; $sql_select = mysql_query($query); if(!$sql_select){ echo mysql_error(); } while($rows = mysql_fetch_array($sql_select)) { ?> <tr height="35"> <td style="line-height:17px; margin:5px 0 0 0; word-spacing:4px; "> <? if (empty($rows['svname'])){ }else{ print 'สนามที่ '; ?> <?=$rows['svname']?> <? }?> <? if (empty($rows['svracket'])){ }else{ print 'ไม้แบดมินตัน '; ?> <?=$rows['svracket']?> <? print 'คู่';} ?> <? if (empty($rows['svlockers'])){ }else{ print 'ตู้ล็อคเกอร์'; ?> <?=$rows['svlockers']?> <? print 'ตู้';}?> <br> </td> <td align="right"><?=number_format($rows['cdprice'],2)?> บาท </td> <td align="right"><?=date_mounth_back ($rows['cddate_add'])?> </td> </tr> <? } ?> </tbody> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง