สินค้าคงเหลือ-สาขาอ้อมเมือง
0 union all SELECT BCITEM.Code, BCITEM.Name1, BCItemUnit.Name,'P2' as WHCode, P2 as Qty, 0 as RemainOutQty,0 as RemainInQty FROM BCITEM INNER JOIN BCItemUnit ON BCITEM.DefStkUnitCode = BCItemUnit.Code WHERE (BCITEM.Code = '".$_GET["txtKeyword"]."') and P2<>0 union all SELECT BCITEM.Code, BCITEM.Name1, BCItemUnit.Name,'P3' as WHCode, P3 as Qty, 0 as RemainOutQty,0 as RemainInQty FROM BCITEM INNER JOIN BCItemUnit ON BCITEM.DefStkUnitCode = BCItemUnit.Code WHERE (BCITEM.Code = '".$_GET["txtKeyword"]."') and P3<>0 ; $objExec = odbc_exec($dbh2,$strSQL) or die ("Error Execute [".$strSQL."]"); $Num_Rows = 0; while(odbc_fetch_row($objExec))$Num_Rows++; $Per_Page = 10000; $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page)+1; 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; } $Page_End = $Per_Page * $Page; if($Page_End > $Num_Rows) { $Page_End = $Num_Rows; } ?>
รหัสสินค้า
ชื่อสินค้า
หน่วย
โกดัง
ยอดคงเหลือ
ยอดจอง
ยอดค้างรับ

<< Back "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { // echo "[ $i ]"; } else { // echo " $i "; } } if($Page!=$Num_Pages) { //echo " Next>> "; } odbc_close($dbh2); } ?>