 |
|
โค้ด ส่งค่าที่บรรทัด 188 อ้ะค้ะ มันยังไม่ได้
<? session_start(); ?>
<?
include "connect.php";
include "header.php";
include "script.php";
?>
<link href="main_style.css" rel="stylesheet" type="text/css">
<div id="left_block1" align="left"><? include"menu.php";?></div>
<div id="right_block1">
<table width="396" align="right" style="font-size: 13px; color: #00F; font-weight: bold;">
<tr>
<td width="103" align="center"><img src="image/print.png" width="39" height="43"></td>
<td width="144" align="center"><img src="image/search.png" width="39" height="43"></td>
<td width="133" align="center"><img src="image/est.png" alt="" width="25" height="27" /></td>
</tr>
<?
//query เพื่อเอาไอดีของ PO ไปสั่งพิมพ์
$strSQL = "SELECT * FROM po_mas m,po_detail d
WHERE m.po_id= d.po_id and d.po_id = '".$_GET["txtKeyword3"]."' ORDER BY m.mas_id DESC ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$objResult = mysql_fetch_array($objQuery)
?>
<? include"report_po_add.php"; ?>
<tr>
<td align="center"><a href="report_po.pdf?pID=<?=$_GET["txtKeyword3"];?>" target="_blank">พิมพ์ใบสั่งซื้อ</a></td>
<td align="center">
<a href="javascript:MM_openBrWindow('search_bill.php','','width=300,height=200')">
ค้นหารายการสั่งซื้อ</a></td>
<td align="center"><a href="add_po_new.php">สร้างรายการสั่งซื้อใหม่</a></td>
</tr>
</table>
</div>
<br><br><br><br><br><br>
<div id="right_block">
<table style="font-size:14px;border-bottom:2px dotted #999999;" width="100%" >
<tr><td><img src="image/add.png" width="30" height="30" /><b>บันทึกใบสั่งซื้อ</b></td></tr>
</table>
<br>
<form action="save_add_po.php" name="frmMain" method="post" onSubmit="JavaScript:return fncSubmit();" >
<table width="940" style="font-size: 13px; text-align: left;">
<tr>
<td height="40"> </td>
<td> </td>
<td>เลขที่ใบรับรถ</td>
<?
$y = date("Y")+543;
$m = date("m");
$d = date("d");
$date_order = $d.'-'.$m.'-'.$y;
?>
<td><input name="txtpo_id" type="text" class="tbl_box7" id="txtpo_id" value="<?=$_GET["txtKeyword3"];?>"></td>
<td align="right">วันที่สั่งซื้อ</td>
<td><input type="text" name="txtdate_order" id="txtdate_order" value="<?=$date_order;?>"></td>
</tr>
<tr>
<td align="right">สั่งซื้อจากสาขา</td>
<td colspan="3" align="left">
<select name="txtbranch_no" id="txtbranch_no">
<option value="">------------เลือก-----------</option>
<?
$strSQL = "SELECT * FROM branch ORDER BY branch_id ASC";
$objQuery = mysql_query($strSQL);
while($objResuut = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResuut["branch_no"];?>" size="14">
<?=$objResuut["branch_no"]." - ".$objResuut["branch_name"];?>
</option>
<?
}
?>
</select>
</td>
<td align="right" height="40">ผู้รับรถ</td>
<?
$fname = "$prefix$fname $lname";
?>
<td><input type="text" name="txtname" id="txtname" value="<?=$fname;?>"></td>
</tr>
<tr>
<td height="12" colspan="6"><hr></td>
</tr>
<tr>
<td widtd="91" height="40" align="right">ยี่ห้อ</td>
<td>
<select id="txtbrand" name="txtbrand">
<option value="">------------เลือก-----------</option>
<?php
$result = mysql_query("
SELECT
brand_id,
brand_name
FROM
brand
ORDER BY CONVERT(brand_id USING TIS620) ASC;
");
while($row = mysql_fetch_assoc($result))
{
echo '<option value="', $row['brand_id'], '">', $row['brand_name'],'</option>';
}
?>
</select>
</td>
<td widtd="91" align="right">รุ่น</td>
<td>
<select id="txtclass" name="txtclass">
<option value="">------------เลือก-----------</option>
</select><span id="waitClass"></span>
</td>
<td widtd="98" align="right">แบบ</td>
<td>
<select id="txttype" name="txttype">
<option value="">------------เลือก-----------</option>
</select><span id="waitType"></span>
</td>
</tr>
<tr>
<td align="right" height="40">สี</td>
<td>
<select name="txtcolor" id="txtcolor">
<option value="">------------เลือก-----------</option>
<?
$strSQL = "SELECT * FROM color ORDER BY color_id ASC";
$objQuery = mysql_query($strSQL);
while($objResuut = mysql_fetch_array($objQuery))
{
?>
<option value="<?=$objResuut["color_id"];?>"><?=$objResuut["color_name"];?></option>
<?
}
?>
</select>
</td>
<td widtd="91" align="right">เลขเครื่อง</td>
<td><input type="text" name="txtmachine_id" id="txtmachine_id" onKeyUp="javascript:this.value=this.value.toUpperCase();"></td>
<td widtd="98" align="right">เลขถัง</td>
<td><input type="text" name="txtchassis_id" id="txtchassis_id" onKeyUp="javascript:this.value=this.value.toUpperCase();"></td>
</tr>
<tr>
<td widtd="71" align="right">ราคาซื้อ</td>
<td><input type="text" name="txtbuy" id="txtbuy" OnChange="JavaScript:chkNum(this);" onKeyUp ="chkSubmit();" /></td>
<td widtd="59" align="right" height="40"> </td>
<td><input type="submit" name="btnAdd" id="btnAdd" value="เพิ่มข้อมูล"></td>
</tr>
</table>
</div>
<br><br>
</form>
</div>
<?
$strSQL = "SELECT * FROM po_mas m,po_detail d
INNER JOIN brand b ON b.brand_id = d.brand
INNER JOIN type t ON t.type_id = d.type
WHERE m.po_id= d.po_id and m.po_id = '".$_GET["txtKeyword3"]."' ";
$objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]");
$num_row = mysql_num_rows($objQuery);
?>
<div id="right_block1">
<table width="100%" style="font-size:14px; font-family:Verdana, Geneva, sans-serif;" border="1" align="center">
<tr bgcolor="#CCCCCC">
<th width="85" height="34"> <div align="center">ลำดับ</div></th>
<th width="358"> <div align="center">เลขเครื่อง</div></th>
<th width="242"> <div align="center">เลขถัง</div></th>
<th width="167"> <div align="center">ยี่ห้อ</div></th>
<th width="216"> <div align="center">รุ่น</div></th>
<th width="106"> <div align="center">ราคาซื้อ (บาท)</div></th>
</tr>
<?
$i=1;
while($objResult = mysql_fetch_array($objQuery))
{
$buy = $objResult["buy"];
$total = $total + $buy;
?>
<tr bgcolor="#FFFFFF">
<td height="30" align="center"><?=$i++;?>.</td>
<td><?=$objResult["machine_id"];?></td>
<td><?=$objResult["chassis_id"];?></td>
<td><?=$objResult["brand_name"];?></td>
<td><?=$objResult["type_name"];?></td>
<td align="center"><?=number_format($buy,'2','.',',');?></td>
<td><a href="OnClick=javascript:document.getElementById('machine_id').value='<?=$objResult["machine_id"];?>';\">เลือก</a></td>
</tr>
<?
}
?>
<tr bgcolor="#CCCCCC">
<th colspan="3">จำนวนรถ ::<u> <?=$num_row;?> </u> ::คัน</div></th>
<th width="85" colspan="2"> <div align="center">รวมเป็นเงิน (บาท)</div></th>
<th width="358"> <div align="center"><?=number_format($total,'2','.',',');?></div></th>
</tr>
</table>
</div>
|
ประวัติการแก้ไข 2013-05-16 10:45:17 2013-05-16 10:45:35
 |
 |
 |
 |
Date :
2013-05-16 10:44:19 |
By :
lookpla26 |
|
 |
 |
 |
 |
|
|
 |