|
|
|
ช่วยดู Code ให้ด้วยครับผม #ดึงข้อมูลมาแต่โชว์ไม่หมด PHP |
|
|
|
|
|
|
|
Code (PHP)
<?php
if(isset($chk)){
$brand_sub_id = $func->getTable_name(durable_order,brand_sub_id,order_id,$code);
$brand_id = $func->getTable_name(durable_brand_sub,brand_id,brand_sub_id,$brand_sub_id);
$stock_type_id = $func->getTable_name(durable_brand,stock_type_id,brand_id,$brand_id);
$sql1 = "UPDATE durable_out_order SET stock_type_id ='$stock_type_id',
brand_id ='$brand_id',
brand_sub_id ='$_POST[brand_sub_id]',
out_order_number='$_POST[out_order_number]',
where out_order_id='$code'";
if($result1 = mysql_db_query($db,$sql1)){
$out_order_id = $func->getTable_last(durable_out_order,out_order_id);
$sql2 = "UPDATE durable_out_order_dt
SET dep_id ='$_POST[dep_id]',
out_order_code='$_POST[out_order_code]',
product_name='$_POST[product_name]',
product_ip='$_POST[product_ip]',
product_code='$_POST[product_code]',
out_order_by='$_POST[out_order_by]',
out_order_date='$_POST[out_order_date]',
out_order_dt='$_POST[out_order_dt]'
where out_order_id='$code'";
if($result2 = mysql_db_query($db,$sql2) or die($sql2)){
$func->update_del_stock(durable_order,order_stock,$_POST[out_order_number],order_id,$_POST[order_id]);
echo "<script>alert('บันทึกข้อมูลเรียบร้อยแล้ว')</script>";
echo "<meta http-equiv='refresh' content='0; url=?page=".sha1(admin)."&admin=".sha1(outorder)."'>";
}else{
echo "<script>alert('พบข้อผิดพลาด 002')</script>";
echo "<meta http-equiv='refresh' content='0; url=?page=".sha1(admin)."&admin=".sha1(outorder)."'>";
}//end 002
}else{
echo "<script>alert('พบข้อผิดพลาด 001 ')</script>";
echo "<meta http-equiv='refresh' content='0; url=?page=".sha1(admin)."&admin=".sha1(editoutorder)."'>";
}//end 001
//echo $brand_id." - ".$brand_sub_id." - ".$stock_type_id;
}
?>
<link rel="stylesheet" href="css/form.css">
<!--- START EDIT ---->
<?php
$sql = "select * from durable_order as ord,
durable_out_order as ot,
durable_out_order_dt as dt,
tb_department as dep,
durable_brand as brand ,
durable_brand_sub as sub ,
durable_product_type as stock,
tb_type_name as ty
WHERE ot.out_order_id = '$code'
AND ot.brand_sub_id = sub.brand_sub_id
AND ot.brand_id = brand.brand_id
AND ot.stock_type_id = stock.stock_type_id
AND ord.type_id = ty.type_id
AND dt.dep_id = dep.dep_id
AND ot.out_order_id = dt.out_order_id ";
$result = mysql_db_query($db,$sql)or die($sql);
$record = mysql_fetch_array($result)
?>
<div class="container">
<div class="row">
<div class="col-xs-18 col-md-18">
<legend>จ่ายครุภัณฑ์
<a href='javascript:void(0);' Name='Win Name' title='Click to view' onclick=window.open('include/pop_product.php','wn','width=720,height=900,left=300,top,=300,toolbar=0,status=0,resizeble=0,scrollbars=1');><img src="images/search.png"/></a>
</legend>
<form action="<?php echo "?page=".sha1(admin)."&admin=".sha1(editoutorder)."&chk=1"; ?>" method="post" class="form" role="form" autocomplete="off">
<div class="col-xs-3 col-md-3">
<label for=""> รายการสินค้า</label>
<select class="form-control" id="brand_sub_id" name="brand_sub_id" placeholder="รายการ" required autofocus="autofocus">
<option value="<?php echo $record[brand_sub_id]; ?>"><?php echo $record[brand_sub_name] ; ?></option>
<?php $sqlq = "select * from durable_order as ord ,
durable_out_order as ot,
durable_brand as brand ,
durable_brand_sub as sub ,
durable_product_type as stock,
tb_type_name as type
WHERE ord.brand_sub_id = sub.brand_sub_id
AND ord.brand_id = brand.brand_id
AND ord.stock_type_id = stock.stock_type_id
AND ord.type_id = type.type_id
AND ord.order_stock != '0'
order by ord.order_id asc";
$res = mysql_db_query($db,$sqlq)or die(mysql_error());
while($rec = mysql_fetch_array($res)){
echo "<option value='$record[order_id]'>
$record[stock_type_name] ยี่ห้อ/รุ่น: $record[brand_name] S/N: $record[brand_sub_name] : [ $record[order_stock]/$record[type_name] ]</option>";
}
?>
</select>
</div>
<div class="col-xs-3 col-md-3">
<label for="">ฝ่าย</label>
<select class="form-control" id="dep_id" name="dep_id" placeholder="รายการ" required>
<option value="<?php echo $record[dep_id]; ?>"><?php echo $record[dep_name]; ?></option>
<?php $sqlQ = "select * from tb_department order by dep_id asc ";
$res = mysql_db_query($db,$sqlQ)or die(mysql_error());
while($rec = mysql_fetch_array($res)){
echo "<option value='$rec[dep_id]'>$rec[dep_name]</option>";
}
?>
</select>
</div>
<div class="col-xs-2 col-md-6">
<label for="">ชื่อ ผู้เบิก</label>
<input class="form-control" name="out_order_by" value="<?php echo $record[out_order_by]; ?> " placeholder="ชื่อ ผู้เบิก" type="text" required />
</div>
<div class="col-xs-2 col-md-2">
<label for="">จำนวน</label>
<input class="form-control" name="out_order_number" value="<?php echo $record[out_order_number]; ?> " placeholder="จำนวน" type="number" required/>
</div>
<div class="col-xs-2 col-md-2">
<label for="">เลขที่เบิก</label>
<input class="form-control" name="out_order_code" value="<?php echo $record[out_order_code]; ?> " placeholder="เลขที่เบิก" type="text" required />
</div>
<div class="col-xs-2 col-md-4">
<label for="">ชื่อครุภัณฑ์</label>
<input class="form-control" name="product_name"value="<?php echo $record[product_name]; ?> " placeholder="ชื่อครุภัณฑ์" type="text" required />
</div>
<div class="col-xs-2 col-md-4">
<label for=""> เลข IP ครุภัณฑ์</label>
<input class="form-control" name="product_ip" value="<?php echo $record[product_ip]; ?> " placeholder="เลข IP ครุภัณฑ์" type="text" />
</div>
<div class="col-xs-2 col-md-4">
<label for=""> เลขครุภัณฑ์</label>
<input class="form-control" name="product_code" value="<?php echo $record[product_code]; ?> " placeholder="เลขครุภัณฑ์" type="text" />
</div>
<div class="col-xs-2 col-md-2">
<label for=""> วันที่เบิก</label>
<input class="form-control" name="out_order_date" value="<?php echo $record[out_order_date]; ?> " placeholder="วันที่เบิก" type="date" required />
</div>
<div class="col-xs-12 col-md-12">
<label for=""> รายละเอียด</label>
<input class="form-control" name="out_order_dt" value="<?php echo $record[out_order_dt]; ?> " placeholder="รายละเอียด" rows="5" />
</div>
<br />
<br />
<button class="btn btn-lg btn-primary btn-block" type="submit" OnClick="return chkReturn();">แก้ไข</button>
</form>
</div>
</div>
</div>
<hr>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2016-02-05 11:37:49 |
By :
indexcom |
View :
685 |
Reply :
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2016-02-05 11:40:44 |
By :
aokkarapon |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 00
|