代码拉取完成,页面将自动刷新
同步操作将从 gujiejing/WEBWMS 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
<?php
header('Content-type: text/html; charset=utf-8');
require_once('connDB.php');
if(!isset($_SESSION)){
session_start();
}
//--格式化数据的函数-------------------------------------------
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
$editFormAction = $_SERVER['PHP_SELF'];
if(isset($_GET['ID'])){
$ID1 = $_GET['ID'];
$sql = "SELECT * FROM `soh` WHERE `ID` ='$ID1'";
}
if((isset($_POST['MM_update']))&&($_POST['MM_update']=="formDetail"))
{
$sql="SELECT `skucn` FROM `sku` WHERE `skuid` = '".$_POST['SKU']."'";
$resultSKU2 = mysql_query($sql,$dbc);
$row_RecSKU2 = mysql_fetch_assoc($resultSKU2);
$SkuCN = $row_RecSKU2['skucn'];
$updateSQL=sprintf("UPDATE `webwms`.`sod` SET
`SKU` = %s,
`SKUCN` = %s,
`SKUEN` = %s,
`VEDCODE` = %s,
`UOMNUM` = %s,
`UNITPRICE` = %s,
`TOTALPRICE` = %s,
`NETWEIGHT` = %s,
`TOTALNW` = %s,
`REMARK1` = %s,
`REMARK2` = %s
WHERE `sod`.`nID` =%s;",
GetSQLValueString($_POST['SKU'], "text"),
GetSQLValueString($SkuCN, "text"),
GetSQLValueString($_POST['SKUEN'], "text"),
GetSQLValueString($_POST['VEDCODE'], "text"),
GetSQLValueString($_POST['UOMNUM'], "int"),
GetSQLValueString($_POST['UNITPRICE'], "int"),
GetSQLValueString($_POST['TOTALPRICE'], "int"),
GetSQLValueString($_POST['NETWEIGHT'], "int"),
GetSQLValueString($_POST['TOTALNW'], "int"),
GetSQLValueString($_POST['REMARK1'], "text"),
GetSQLValueString($_POST['REMARK2'], "text"),
GetSQLValueString($_POST['nID'], "text")
);
//echo $updateSQL;
mysql_query($updateSQL,$dbc);
$ID = $_POST['ID'];
$sql="SELECT * FROM soh WHERE ID = $ID";
}
/**
UPDATE `webwms`.`sod` SET `SKU` = 'hjhwds003',
`SKUEN` = 'ccc2',
`VEDCODE` = 'ddd2',
`UOMNUM` = '1112',
`UNITPRICE` = '2222',
`TOTALPRICE` = '2222',
`NETWEIGHT` = '1132',
`TOTALNW` = '3112',
`REMARK1` = 'ababababac2',
`REMARK2` = 'bababababa2' WHERE `sod`.`nID` =1;
*/
if((isset($_POST['MM_update']))&&($_POST['MM_update']=="form1")){
$show = true;
$updateSQL=sprintf("
UPDATE `webwms`.`soh` SET
`CustomerID` = %s,
`CarrierID` = %s,
`ForworderID` = %s,
`CreateTime` = %s,
`OutBoundNo` = %s,
`InvoiceNo` = %s,
`TGW` = %s,
`TVOL` = %s,
`ChePaiHao` = %s,
`PKGNo` = %s,
`Remark1` = %s,
`Remark2` = %s,
`TransportNo` = %s
WHERE `soh`.`ID` =%s;",
GetSQLValueString($_POST['CustomerID'], "text"),
GetSQLValueString($_POST['CarrierID'], "text"),
GetSQLValueString($_POST['ForworderID'], "text"),
GetSQLValueString($_POST['CreateTime'], "text"),
GetSQLValueString($_POST['OutBoundNo'], "text"),
GetSQLValueString($_POST['InvoiceNo'], "text"),
GetSQLValueString($_POST['TGW'], "double"),
GetSQLValueString($_POST['TVOL'], "double"),
GetSQLValueString($_POST['ChePaiHao'], "text"),
GetSQLValueString($_POST['PKGNo'], "int"),
GetSQLValueString($_POST['Remark1'], "text"),
GetSQLValueString($_POST['Remark2'], "text"),
GetSQLValueString($_POST['TransportNo'], "text"),
GetSQLValueString($_POST['ID'], "text"));
//echo $updateSQL;
mysql_query($updateSQL,$dbc);
$ID = $_POST['ID'];
$sql="SELECT * FROM soh WHERE ID = $ID";
}
if((isset($_POST['MM_addNew']))&&($_POST['MM_addNew']=="DetailAdd"))
{
$sqlLine = "SELECT COUNT( * ) AS LINE FROM `sod` WHERE `SOID` = '".$_POST['SOID']."'";
$resultItemNo=mysql_query($sqlLine,$dbc);
$row_Rec_ItemNo=mysql_fetch_assoc($resultItemNo);
$ITEMNO1=$row_Rec_ItemNo['LINE'];
$ITEMNO1=$ITEMNO1+1;
$sql="SELECT `skucn` FROM `sku` WHERE `skuid` = '".$_POST['SKU']."'";
$resultSKU2 = mysql_query($sql,$dbc);
$row_RecSKU2 = mysql_fetch_assoc($resultSKU2);
$SkuCN = $row_RecSKU2['skucn'];
$insertSQL=sprintf("
INSERT INTO `webwms`.`sod` (
`ID` ,`SOID` ,`ITEMNO` ,`SKU` ,
`SKUCN` ,`SKUEN` ,`VEDCODE` ,`UOMNUM` , `UNITPRICE` ,
`TOTALPRICE` ,`NETWEIGHT` ,`TOTALNW` ,`REMARK1` ,`REMARK2`)
VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s);",
GetSQLValueString($_POST['ID'], "int"),
GetSQLValueString($_POST['SOID'], "text"),
GetSQLValueString($ITEMNO1, "int"),
GetSQLValueString($_POST['SKU'], "text"),
GetSQLValueString($SkuCN, "text"),
GetSQLValueString($_POST['SKUEN'], "text"),
GetSQLValueString($_POST['VEDCODE'], "text"),
GetSQLValueString($_POST['UOMNUM'], "int"),
GetSQLValueString($_POST['UNITPRICE'], "int"),
GetSQLValueString($_POST['TOTALPRICE'], "int"),
GetSQLValueString($_POST['NETWEIGHT'], "int"),
GetSQLValueString($_POST['TOTALNW'], "int"),
GetSQLValueString($_POST['REMARK1'], "text"),
GetSQLValueString($_POST['REMARK2'], "text"));
//echo $insertSQL;
mysql_query($insertSQL,$dbc);
//return;
$ID3 = $_POST['ID'];
$sql="SELECT * FROM `soh` WHERE `ID` = '$ID3'";
//SELECT * FROM `soh` WHERE `SOID` = 'SO00000061'
//SELECT * FROM `soh` WHERE `ID` =61
}
//echo $sql;
$result1 = mysql_query($sql,$dbc);
$row_Rec2=mysql_fetch_assoc($result1);
$sql="SELECT * FROM cust";
$result2=mysql_query($sql,$dbc);
$row_Rec3=mysql_fetch_assoc($result2);
$sqlSKU="SELECT * FROM `sku`";
$resultSKU=mysql_query($sqlSKU,$dbc);
$resultSKU1=mysql_query($sqlSKU,$dbc);
$row_Rec_SKU=mysql_fetch_assoc($resultSKU);
$arr1= array();
while($row_Rec_SKU1=mysql_fetch_assoc($resultSKU1)){
array_push($arr1,$row_Rec_SKU1['skuid']."->".$row_Rec_SKU1['skucn']);
}
//echo $arr1; //print_r($arr1);
?>
<html>
<head>
<title></title>
<script src="utils.js" type="text/javascript"></script>
<script src="slsoform.js" type="text/javascript"></script>
<link rel="stylesheet" href="./themes/base/jquery.ui.all.css">
<script src="jquery-1.9.1.js" type="text/javascript"></script>
<script src="./ui/jquery.ui.core.js"></script>
<script src="./ui/jquery.ui.widget.js"></script>
<script src="./ui/jquery.ui.datepicker.js"></script>
<script src="./ui/jquery.ui.mouse.js"></script>
<script src="./ui/jquery.ui.draggable.js"></script>
<script src="./ui/jquery.ui.position.js"></script>
<script src="./ui/jquery.ui.resizable.js"></script>
<script src="./ui/jquery.ui.button.js"></script>
<script src="./ui/jquery.ui.dialog.js"></script>
<script src="./ui/jquery.ui.effect.js"></script>
<script src="./ui/jquery.ui.effect-blind.js"></script>
<script src="./ui/jquery.ui.effect-explode.js"></script>
<script src="./ui/jquery.ui.menu.js"></script>
<script src="./ui/jquery.ui.autocomplete.js"></script>
<link rel="stylesheet" href="demos.css">
<style type="text/css">
<!--
body {
#background-color: #00FFF1;
background:url(yh3.gif);
}
table {
border-collapse : collapse;
background-color: #FFFFFF;
}
.STYLE2 {
background-color: #FFFFFF;
}
.STYLE3 {
#background-color: #00FFF1;
background:url(yh3.gif);
}
-->
</style>
</head>
<script type="text/javascript">
$(function(){
var availableTags = <?php echo json_encode($arr1) ?>;
$("#tags").autocomplete({
source: availableTags
});
});
</script>
<body>
<h1 align="center">Shipping Order</h1>
<div id="dialog1" title="确认对话框"></div>
<div align="center">
<form method="POST" action="<?php $editFormAction; ?>" id="form1" name="form1">
<table border="1" width="1024">
<tr>
<td>ID</td>
<td><input name="ID" type="hidden" id="ID" value="<?php echo $row_Rec2['ID'];?>"/>
<?php echo $row_Rec2['ID']?></td>
<td>SOID</td>
<td><input name="SOID" type="hidden" id="SOID" value="<?php echo $row_Rec2['SOID'];?>"/>
<?php echo $row_Rec2['SOID']?></td>
<td>SOState</td>
<td id="SOState11"><?php echo $row_Rec2['SOState']?></td>
<td>CustomerID</td>
<td>
<select name="CustomerID" id="CustomerID" width="100">
<option><?php echo $row_Rec2['CustomerID'];?></option>
<?php do{?>
<option value="<?php echo $row_Rec3['custid'];?>">
<?php echo $row_Rec3['custcn'];?>
</option>
<?php }while($row_Rec3=mysql_fetch_assoc($result2)); ?>
</select>
<?php
if(!empty($row_Rec2['CustomerID']))
{
echo '-->';
$CuID = $row_Rec2['CustomerID'];
$sqlCu = "SELECT * FROM `cust` WHERE `custid` = '$CuID'";
$resultCuID = mysql_query($sqlCu,$dbc);
$row_Rec_CuID = mysql_fetch_assoc($resultCuID);
echo $row_Rec_CuID['custcn'];
}
?>
</td>
</tr>
<tr>
<td>CarrierID</td>
<td><input name="CarrierID" id="CarrierID" type="text" value="<?php echo $row_Rec2['CarrierID']?>"></td>
<td>ForworderID</td>
<td><input name="ForworderID" id="ForworderID" type="text" value="<?php echo $row_Rec2['ForworderID']?>"></td>
<td>CreateTime</td>
<td><input name="CreateTime" id="CreateTime" type="text" value="<?php echo $row_Rec2['CreateTime']?>"></td>
<td>OutBoundNo</td>
<td><input name="OutBoundNo" id="OutBoundNo" type="text" value="<?php echo $row_Rec2['OutBoundNo']?>"></td>
</tr>
<tr>
<td>InvoiceNo</td>
<td><input name="InvoiceNo" id="InvoiceNo" type="text" value="<?php echo $row_Rec2['InvoiceNo']?>"></td>
<td>TGW</td>
<td><input name="TGW" id="TGW" type="text" value="<?php echo $row_Rec2['TGW']?>"></td>
<td>TVOL</td>
<td><input name="TVOL" id="TVOL" type="text" value="<?php echo $row_Rec2['TVOL']?>"></td>
<td>ChePaiHao</td>
<td><input name="ChePaiHao" id="ChePaiHao" type="text" value="<?php echo $row_Rec2['ChePaiHao']?>"></td>
</tr>
<tr>
<td>PKGNo</td>
<td><input name="PKGNo" id="PKGNo" type="text" value="<?php echo $row_Rec2['PKGNo']?>"></td>
<td>TransportNo</td>
<td><input name="TransportNo" id="TransportNo" type="text" value="<?php echo $row_Rec2['TransportNo']?>"></td>
<td>Remark1</td>
<td><input name="Remark1" id="Remark1" type="text" value="<?php echo $row_Rec2['Remark1']?>"></td>
<td>Remark2</td>
<td><input name="Remark2" id="Remark2" type="text" value="<?php echo $row_Rec2['Remark2']?>"></td>
</tr>
</table>
<br/>
<div align="center" width="1024"><label class="STYLE3">
<table border="0" cellpadding="0" cellspacing="0" width="1024"><tr><td class="STYLE3" align="right">
<input type="submit" name="Submit" value="保存" style="width:175;height:40"/>
</td></tr></table>
</label></div>
<input type="hidden" name="MM_update" value="form1">
</form>
</div>
<hr>
<div align="right">
<button type="button" id="finishOrder" style="width:100;height:25">结束此单</button>
<button type="button" id="createDetail" style="width:100;height:25">创建明细</button>
</div>
<div align="left">
<button type="button" id="allocate" style="width:100;height:33">分配</button>
<button type="button" id="cancelallocate" style="width:100;height:33">取消分配</button>
<button type="button" id="shipped" style="width:100;height:33">发运</button>
<button type="button" id="pickreport" style="width:100;height:33">拣货单</button>
<button type="button" id="allocateDetail" style="width:100;height:33">分配明细</button>
</div>
<br/>
<div align="center" id="showCreateDetail">
<p>
<form method="POST" action="<?php $editFormAction; ?>" id="addDetail" name="addDetail">
<table border = "1" cellpadding="1" cellspacing="1" width="1024">
<tr>
<td>SKU</td>
<td colspan="2">
<!--<input type="text" name="SKU" id="SKU" />-->
<select name="SKU" id="SKU" width="200">
<option><?php echo $row_Rec_SKU['skuid'] ?></option>
<?php do{ ?>
<option value="<?php echo $row_Rec_SKU['skuid'] ?>">
<?php echo $row_Rec_SKU['skuid']."->".$row_Rec_SKU['skucn'] ?>
</option>
<?php }while($row_Rec_SKU=mysql_fetch_assoc($resultSKU)); ?>
</select>
</td>
<td>
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
</td>
<!--
<td><input type="text" name="SKUCN" id="SKUCN" /></td>
-->
<td>SKUEN</td>
<td><input type="text" name="SKUEN" id="SKUEN" /></td>
<td>VEDCODE</td>
<td><input type="text" name="VEDCODE" id="VEDCODE" /></td>
</tr>
<tr>
<td>UOMNUM</td>
<td colspan="3"><input type="text" name="UOMNUM" id="UOMNUM" /></td>
<!--
<td>ALLOCQTY</td>
<td><input type="text" name="ALLOCQTY" id="ALLOCQTY" /></td>
-->
<td>UNITPRICE</td>
<td><input type="text" name="UNITPRICE" id="UNITPRICE" /></td>
<td>TOTALPRICE</td>
<td><input type="text" name="TOTALPRICE" id="TOTALPRICE" /></td>
</tr>
<tr>
<td>NETWEIGHT</td>
<td><input type="text" name="NETWEIGHT" id="NETWEIGHT" /></td>
<td>TOTALNW</td>
<td><input type="text" name="TOTALNW" id="TOTALNW" /></td>
<td>REMARK1</td>
<td><input type="text" name="REMARK1" id="REMARK1" /></td>
<td>REMARK2</td>
<td><input type="text" name="REMARK2" id="REMARK2" /></td>
</tr>
<tr>
<td>
<input type="hidden" name="ID" value="<?php echo $row_Rec2['ID']?>" />
</td>
<td>
<input type="hidden" name="SOID" value="<?php echo $row_Rec2['SOID']?>" />
</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<br/>
<input type="submit" name="Submit" value="保存" style="width:175;height:45"/>
<input type="hidden" name="MM_addNew" value="DetailAdd" />
</form>
</p>
</div>
<div id="showAllocateDetail" align="center"></div>
<br/>
<?php
$sql="SELECT * FROM `sod` WHERE `ID` = '".$row_Rec2['ID']."'";
$result4 = mysql_query($sql,$dbc);
$row_Rec4_1 = mysql_fetch_assoc($result4);
$totalRows4_1 = mysql_num_rows($result4);
if($totalRows4_1>0){
?>
<h3>明细内容</h3>
<?php do{ ?>
<form method="POST" action="<?php echo $editFormAction; ?>" id="formDetail" name="formDetail">
<table cellpadding="2" cellspacing="1" border="1">
<tr>
<td>nID<br/>
<?php echo $row_Rec4_1['nID']; ?>
<input type="hidden" name="nID" value="<?php echo $row_Rec4_1['nID']; ?>" />
</td>
<td>ID<br/>
<?php echo $row_Rec4_1['ID']; ?>
<input type="hidden" name="ID" value="<?php echo $row_Rec4_1['ID']; ?>" />
</td>
<td>SOID<br/>
<?php echo $row_Rec4_1['SOID']; ?>
</td>
<td>ITEMNO<br/>
<?php echo $row_Rec4_1['ITEMNO']; ?>
</td>
<td>SKU
<input type="text" name="SKU" id="SKU" value="<?php echo $row_Rec4_1['SKU']; ?>" />
</td>
<td>SKUCN <br/>
<?php echo $row_Rec4_1['SKUCN']; ?>
</td>
<td>SKUEN
<input type="text" name="SKUEN" id="SKUEN" value="<?php echo $row_Rec4_1['SKUEN']; ?>" />
</td>
<td>VEDCODE
<input type="text" name="VEDCODE" id="VEDCODE" value="<?php echo $row_Rec4_1['VEDCODE']; ?>" />
</td>
<td>UOMNUM
<input type="text" name="UOMNUM" id="UOMNUM" value="<?php echo $row_Rec4_1['UOMNUM']; ?>" />
</td>
<td>ALLOCQTY <br/><?php echo $row_Rec4_1['ALLOCQTY']; ?>
</td>
<td>UNITPRICE
<input type="text" name="UNITPRICE" id="UNITPRICE" value="<?php echo $row_Rec4_1['UNITPRICE']; ?>" />
</td>
<td>TOTALPRICE
<input type="text" name="TOTALPRICE" id="TOTALPRICE" value="<?php echo $row_Rec4_1['TOTALPRICE']; ?>" />
</td>
<td>NETWEIGHT
<input type="text" name="NETWEIGHT" id="NETWEIGHT" value="<?php echo $row_Rec4_1['NETWEIGHT']; ?>" />
</td>
<td>TOTALNW
<input type="text" name="TOTALNW" id="TOTALNW" value="<?php echo $row_Rec4_1['TOTALNW']; ?>" />
</td>
<td>REMARK1
<input type="text" name="REMARK1" id="REMARK1" value="<?php echo $row_Rec4_1['REMARK1']; ?>" />
</td>
<td>REMARK2
<input type="text" name="REMARK2" id="REMARK2" value="<?php echo $row_Rec4_1['REMARK2']; ?>" />
</td>
<td>
<input type="submit" name="Submit" value="保存修改" />
</td>
</tr>
<table>
<input type="hidden" name="MM_update" value="formDetail" />
</form>
<?php }while($row_Rec4_1 = mysql_fetch_assoc($result4)) ?>
<?php } ?>
</body>
<script type="text/javascript">
$("#showCreateDetail").css("display", "none");
$(document).ready(function(){
$("#createDetail").click(function(){
$("#showCreateDetail").css("display", "block");
})
});
</script>
</html>
<!--
<div class="ui-widget">
<label for="tags">Tags: </label>
<input id="tags">
</div>
-->
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。