📄 arrange.php
字号:
else
{
$str_sql="select shid from ARRANGERRC where shid='$shid' and pid='$pid';";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL查询命令失败!');
else
{
if ($num=@mysql_num_rows($result))
{
$html=' <form name="form1" method="post" action="arrange.php?step=1">
<input type="hidden" name="shid" value="'.$shid.'"> <input type="hidden" name="outst" value="'.$outst.'">
<input type="hidden" name="inst" value="'.$inst.'">
<input type="hidden" name="date1" value="'.$date1.'">
<input type="hidden" name="date2" value="'.$date2.'">
<input type="hidden" name="date3" value="'.$date3.'">
<input type="hidden" name="checkp" value="'.$checkp.'">
<input type="hidden" name="outp" value="'.$outp.'">
<input type="hidden" name="inp" value="'.$inp.'">
<input type="hidden" name="memo" value="'.$memo.'">';
if ($new==1)
$html.='
<input type="hidden" name="new" value="2">';
else
$html.=' <input type="hidden" name="new" value="0">';
echo $html."<div align=right><br>该产品已在本调拨单中调拨,请重填调拨单<br><br><br><p><input type=submit name=Submit value=返回重填> <a href=arrange.php?step=0>填写新的调拨单</a> <a href=index2.php>返回首页</a></p></div></form>";
}
else
{
if ($outst!='-2')
{
$str_sql="select amount from STORAGETB where stid='$outst' and pid='$pid';";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL插入命令失败!');
else
{
$record=mysql_fetch_object($result);
if (($num=@mysql_num_rows($result))&&($record->amount>$outamount))
{
$str_sql="update STORAGETB set
amount = amount - $outamount
where stid='$outst' and pid='$pid';";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL更新命令失败!');
///////////////////////////////
$str_sql="select stid from STORAGETB where stid='$inst' and pid='$pid';";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL查询命令失败!');
else
{
if ($num=@mysql_num_rows($result))
{
$str_sql="update STORAGETB set
amount = amount + $inamount
where stid='$inst' and pid='$pid';";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL更新命令失败!');
}
else
{
$str_sql="insert into STORAGETB values (
'$inst',
'$pid',
'$inamount',
'');";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL更新命令失败!');
}
}
$str_sql="insert into ARRANGERRC values (
'$shid',
'$pid',
'$pprice',
'$inamount',
'$outamount')";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL插入命令失败!');
else
{
if ($new==1)
{
$str_sql="insert into ARRANGERTB values (
'$shid',
'$outst',
'$inst',
'$date1',
'$date2',
'$date3',
'$checkp',
'$outp',
'$inp',
'',
'$memo')";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL查询命令失败!');
}
$html=' <form name="form1" method="post" action="arrange.php?step=1">
<input type="hidden" name="shid" value="'.$shid.'"> <input type="hidden" name="outst" value="'.$outst.'">
<input type="hidden" name="inst" value="'.$inst.'">
<input type="hidden" name="date1" value="'.$date1.'">
<input type="hidden" name="date2" value="'.$date2.'">
<input type="hidden" name="date3" value="'.$date3.'">
<input type="hidden" name="checkp" value="'.$checkp.'">
<input type="hidden" name="outp" value="'.$outp.'">
<input type="hidden" name="inp" value="'.$inp.'">
<input type="hidden" name="memo" value="'.$memo.'">
<input type="hidden" name="new" value="0">';
echo $html."<div align=right><br>成功插入调拨单<br><br><br><p><input type=submit name=Submit value=返回继续填写本调拨单> <a href=arrange.php?step=0>填写新的调拨单</a> <a href=index2.php>返回首页</a></p></div></form>";
}
}
else
{
$html=' <form name="form1" method="post" action="arrange.php?step=1">
<input type="hidden" name="shid" value="'.$shid.'"> <input type="hidden" name="outst" value="'.$outst.'">
<input type="hidden" name="inst" value="'.$inst.'">
<input type="hidden" name="date1" value="'.$date1.'">
<input type="hidden" name="date2" value="'.$date2.'">
<input type="hidden" name="date3" value="'.$date3.'">
<input type="hidden" name="checkp" value="'.$checkp.'">
<input type="hidden" name="outp" value="'.$outp.'">
<input type="hidden" name="inp" value="'.$inp.'">
<input type="hidden" name="memo" value="'.$memo.'">';
if ($new==1)
$html.='
<input type="hidden" name="new" value="2">';
else
$html.=' <input type="hidden" name="new" value="0">';
echo $html."<div align=right><br>调出分公司没有足够货品<br><br><br><p><input type=submit name=Submit value=返回重填> <a href=arrange.php?step=0>填写新的调拨单</a> <a href=index2.php>返回首页</a></p></div></form>";
}
}
}
else
{
$str_sql="select stid from STORAGETB where stid='$inst' and pid='$pid';";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL查询命令失败!');
else
{
if ($num=@mysql_num_rows($result))
{
$str_sql="update STORAGETB set
amount = amount + $inamount
where stid='$inst' and pid='$pid';";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL更新命令失败!');
}
else
{
$str_sql="insert into STORAGETB values (
'$inst',
'$pid',
'$inamount',
'');";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL更新命令失败!');
}
}
$str_sql="insert into ARRANGERRC values (
'$shid',
'$pid',
'$pprice',
'$inamount',
'$outamount')";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL插入命令失败!');
else
{
if ($new==1)
{
$str_sql="insert into ARRANGERTB values (
'$shid',
'$outst',
'$inst',
'$date1',
'$date2',
'$date3',
'$checkp',
'$outp',
'$inp',
'',
'$memo')";
$result=mysql_db_query($db,$str_sql,$link_id);
if (!$result) html_error_exit('MySQL查询命令失败!');
}
$html=' <form name="form1" method="post" action="arrange.php?step=1">
<input type="hidden" name="shid" value="'.$shid.'"> <input type="hidden" name="outst" value="'.$outst.'">
<input type="hidden" name="inst" value="'.$inst.'">
<input type="hidden" name="date1" value="'.$date1.'">
<input type="hidden" name="date2" value="'.$date2.'">
<input type="hidden" name="date3" value="'.$date3.'">
<input type="hidden" name="checkp" value="'.$checkp.'">
<input type="hidden" name="outp" value="'.$outp.'">
<input type="hidden" name="inp" value="'.$inp.'">
<input type="hidden" name="memo" value="'.$memo.'">
<input type="hidden" name="new" value="0">';
echo $html."<div align=right><br>成功插入调拨单<br><br><br><p><input type=submit name=Submit value=返回继续填写本调拨单> <a href=arrange.php?step=0>填写新的调拨单</a> <a href=index2.php>返回首页</a></p></div></form>";
}
}
}
}
}
}
}
@mysql_close($link_id);
?>
</td>
</tr>
<tr>
<td height="40">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="40">
<tr>
<td valign="bottom" align="right"><font face="Arial"><b>Powered
by <img src="images/php.gif" width="39" height="20" align="absmiddle">
& <img src="images/mysql.gif" width="82" height="20" align="absmiddle"></b></font></td>
<td align="right" valign="bottom" width="200"><font face="Arial">©
<a href="mailto:lonelyp@etang.com">Lonely Passenger</a>,2001<br>
All rights reserved!</font></td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
<?
}
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -