|
|
|
ต้องการ Add เพิ่มได้ทีละหลายๆ แถวครับ |
|
|
|
|
|
|
|
Code (PHP)
<script>
$(function () {
$('#cusven').attr('readonly', 'true');
$('#cusven').css('background-color' , '#DEDEDE');
});
$(function () {
$('#create').attr('readonly', 'true');
$('#create').css('background-color' , '#DEDEDE');
});
</script>
<script language="javascript">
function ShowOrReport(select)
{
if(select == "s3")
{
document.form1.action="testnew.php";
}
if(select == "s4")
{
document.form1.action="addcomplete.php";
}
document.form1.submit();
}
</script>
<body>
<div class="panel panel-primary">
<div class="panel-heading"><center><h4>SHIPPING AND DELIVERY ORDER</h4></center></div>
<div class="panel-body">
<form method="post" name="form1">
<label>SDO TYPE </label>
<select style="width:217px;" name="sdotype" id="sdotype">
<option value="CSV">CUSTOMER SERVICE</option>
<option value="RTV">RETURN VENDOR</option>
<option value="RPV">REPAIR VENDOR</option>
<option value="CSM">CONSIGMENT</option>
<option value="GEN">GENERAL</option>
</select>
<br>
<label>DOC NO. </label>
<input type="text" style="width:217px;" name="docno" list="docno" value="<?php error_reporting(0); echo $_POST['docno']; ?>">
<?php
$docno=$_POST["docno"];
$sqldoc="select * from IF_TRANSFER where GIDOCNO='".$docno."'";
$querydoc=sqlsrv_query($conn, $sqldoc, $params, $options);
?>
<label>CUST.CODE </label>
<input type="text" style="width:217px;" name="custcode" id="custcode" value="<?php echo $_POST['custcode'];?>">
<label>VD.CODE </label>
<input type="text" style="width:217px;" name="vdcode" id="vdcode" value="<?php error_reporting(0); echo $_POST['vdcode']; ?>" >
<br>
<label>CUSTOMER/VENDER NAME </label>
<?php
if($_POST["custcode"]=="CUSTOMER" || $_POST["custcode"]=="customer")
{ ?>
<input type="text" style="width:600px;" name="cusven" id="cusven" value="<?php echo "CUSTOMER";?>">
<?php
}
else if($_POST["custcode"]=="VENDOR" || $_POST["custcode"]=="vendor")
{ ?>
<input type="text" style="width:600px;" name="cusven" id="cusven" value="<?php echo "VENDOR";?>">
<?php
}
else
{
?>
<font color="red"><input type="text" style="width:600px;" name="cusven" id="cusven" value="<?php echo "Cannot found!!!";?>"></font>
<?php
}
?>
<br>
<label>MODEL   </label>
<select style="width:217px;" name="model" id="model">
<?php
$sqlmodel="select * from model";
$querymodel=sqlsrv_query($conn, $sqlmodel);
while($resultmodel=sqlsrv_fetch_array($querymodel))
{
?>
<option value="<?php echo $resultmodel['MODEL'];?>"><?php echo $resultmodel['MODEL'];?></option>
<?php
}
$num_rows=sqlsrv_num_rows($querydoc);
?>
</select>
<label>SERIES </label>
<input type="text" style="width:217px;" name="series" id="series" value="<?php error_reporting(0); echo $_POST['series']; ?>">
<br>
<label>ORIGINATOR </label>
<input type="text" style="width:217px;" name="orig" id="orig" value="<?php error_reporting(0); echo $_POST['orig']; ?>">
<label>DATE </label>
<input type="text" style="width:217px;" name="date" id="date" value="<?php echo date('d-m-Y');?>">
<br>
<label>TYPE OF GOODS</label>
<select style="width:217px;" name="typegood" id="typegood">
<option value="CONSIGMENT">CONSIGMENT</option>
<option value="SCRAPS">SCRAPS</option>
<option value="SAMPLES">SAMPLES</option>
<option value="RETURN TO VENDOR">RETURN TO VENDOR</option>
<option value="FINISHED GOODS">FINISHED GOODS</option>
<option value="OTHER">OTHER</option>
</select>
<label>DELIVERY </label>
<select style="width:217px;" name="delivery" id="delivery">
<option value="RECEIVER CAR">RECEIVER'S CAR</option>
<option value="SODICK RENTED CAR">SODICK'S RENTED CAR</option>
<option value="SODICK CAR">SODICK'S CAR</option>
<option value="HAND CARRY">HAND CARRY</option>
</select>
<label>BY </label>
<input type="text" style="width:217px;" name="by" id="by" value="<?php echo $_POST['by'];?>">
<br>
</div>
</div>
<form method="post" name="form1">
<div align="right">
<input type="submit" name="click" id="click" value="-">
<input type="submit" name="click" id="click" value="+">
</div>
<?php
$count=1;
$keep=0;
?>
<table width="100%" border="1" bordercolor="#000000">
<thead>
<tr>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2">LINE</font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2">ITEM</font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2">DESCRIPTION</font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2">QTY</font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2">UOM</font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2"> Fr Store </font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2"> TO Store </font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2">STATUS</font></b></center></td>
<td width="20" bgcolor="rgb(51,204,51)"><center><b><font size="2">REMARK</font></b></center></td>
</tr>
</thead>
<?php
if($num_rows>0)
{
while($resultdoc=sqlsrv_fetch_array($querydoc))
{
?>
<tr>
<td width="20"><center><font size="1"><?php echo $resultdoc['LINE'];?></font></center></td>
<td width="20"><center><font size="1"><?php echo $resultdoc["TMATERIAL"];?></font></center></td>
<td width="20"><center><font size="1"><?php echo $resultdoc["TDESC"];?></font></center></td>
<td width="20"><center><font size="1"><?php echo $resultdoc["QTY"];?></font></center></td>
<td width="20"><center><font size="1"><?php echo $resultdoc["UOM"];?></font></center></td>
<td width="20"><center><font size="1"><?php echo $resultdoc["FSLOC"];?></font></center></td>
<td width="20"><center><font size="1"><?php echo $resultdoc["TSLOC"];?></font></center></td>
<td width="20"><center><font size="1"></font></center></td>
<td width="20"><center><font size="1"><input type="text" name="remark[]" value="<?php error_reporting(0); echo $_POST['remark[]'];?>"></font></center></td>
</tr>
<?php
$use=$resultdoc["UOM"];
}
}
$click=$_POST["click"];
if($click=="+")
{
?>
<tr>
<td width="20"><center><b><font size="1"><input type="text" name="line"></font></b></center></td>
<td width="20"><center><b><font size="1"><input type="text" name="item"></font></b></center></td>
<td width="20"><center><b><font size="1"></font></b></center></td>
<td width="20"><center><b><font size="1"><input type="text" name="qty"></font></b></center></td>
<td width="20"><center><font size="1"><?php echo $use; ?></font></center></td>
<td width="20"><center><b><font size="1"><input type="text" name="frstore"></font></b></center></td>
<td width="20"><center><b><font size="1"><input type="text" name="tostore"></font></b></center></td>
<td width="20"><center><b><font size="1"></font></b></center></td>
<td width="20"><center><font size="1"><input type="text" name="remarknew"></font></center></td>
</tr>
</form>
</body>
</html>
Tag : PHP, Ms SQL Server 2005
|
|
|
|
|
|
Date :
2016-08-04 13:08:39 |
By :
pissanu8970 |
View :
834 |
Reply :
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date :
2016-08-08 10:03:51 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|