📄 edit.php
字号:
<?
include_once 'inc/auth.php';
include_once 'inc/check_type.php';
echo '
<html>
<head>
<title>销售记录编辑 </title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
';
echo '<s';
echo 'cript Language="JavaScript">
function LoadWindow1()
{
URL="/module/crm/product_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:320px;dialogHeight:245px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
';
echo 'function LoadWindow2()
{
URL="/module/crm/service_select";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+170;
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:320px;dialogHeight:245px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function CheckForm()
{
if';
echo ' (document.all("TYPE").value=="PRO")
{
if(document.form1.PRO_NAME.value=="")
{ alert("产品名称不能为空!");
return (false);
}
if(document.form1.PRO_ID.value=="")
{ alert("产品名称不能为空!");
return (false);
}
if(document.form1.PRICE.value=="")
{ alert("单价不能为空!");
return (false);
}
if(docu';
echo 'ment.form1.TRANS_QTY.value=="")
{ alert("数量不能为空!");
return (false);
}
if(document.form1.CUSTOMER_ID.value=="")
{ alert("客户名称不能为空!");
return (false);
}
if(document.form1.CUSTOMER_NAME.value=="")
{ alert("客户名称不能为空!");
return (false);
}
if(document.form1.CREATE_DATE.value=="")
';
echo ' { alert("记录日期不能为空!");
return (false);
}
}
if (document.all("TYPE").value=="SER")
{
if(document.form1.SER_NAME.value=="")
{ alert("服务名称不能为空!");
return (false);
}
if(document.form1.SER_ID.value=="")
{ alert("服务名称不能为空!");
return (false);
}
if(document.form1.TOTAL_PRICE.va';
echo 'lue=="")
{ alert("总价不能为空!");
return (false);
}
if(document.form1.CUSTOMER_ID.value=="")
{ alert("客户名称不能为空!");
return (false);
}
if(document.form1.CUSTOMER_NAME.value=="")
{ alert("客户名称不能为空!");
return (false);
}
if(document.form1.CREATE_DATE.value=="")
{ alert("记录日期不能';
echo '为空!");
return (false);
}
}
document.form1.submit();
}
function LoadWindow()
{
URL="/module/user_select_single";
loc_x=document.body.scrollLeft+event.clientX-event.offsetX-100;
loc_y=document.body.scrollTop+event.clientY-event.offsetY+200;
window.showModalDialog(URL,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:350px;dialogHeight:35';
echo '0px;dialogTop:"+loc_y+"px;dialogLeft:"+loc_x+"px");
}
function clear_dept1()
{
document.form1.PRO_ID.value="";
document.form1.PRO_NAME.value="";
}
function clear_dept2()
{
document.form1.SER_ID.value="";
document.form1.SER_NAME.value="";
}
function td_calendar(fieldname)
{
myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
mytop=document.body.scrollTop';
echo '+event.clientY-event.offsetY+140;
window.showModalDialog("/inc/calendar.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
function sel_change()
{
for(i=0;i<document.all("SERVICE_TYPE").length;i++)
{
el=document.all("SERVICE_TYPE").item(i);
if(e';
echo 'l.checked)
{
val=el.value;
}
}
if(val=="0")
{
document.all("TYPE").value="PRO";
document.all("SER").style.display="none";
document.all("TOTALPRICE").style.display="none";
if(document.all("PRO").style.display=="none")
document.all("PRO").style.display="";
if(document.all("PRI").style.display=="none")
';
echo ' document.all("PRI").style.display="";
if(document.all("QTY").style.display=="none")
document.all("QTY").style.display="";
document.all("SER_ID").value="";
document.all("SER_NAME").value="";
document.all("TOTAL_PRICE").value="";
}
else
{
document.all("TYPE").value="SER";
if(document.all("SER").style.display=="none")
';
echo ' document.all("SER").style.display="";
if(document.all("TOTALPRICE").style.display=="none")
document.all("TOTALPRICE").style.display="";
document.all("PRI").style.display="none";
document.all("QTY").style.display="none";
document.all("PRO").style.display="none";
document.all("PRO_ID").value="";
document.all("PRO_NAME").value="";
docum';
echo 'ent.all("PRICE").value="";
document.all("TRANS_QTY").value="";
document.all("TOTAL_PRICE").value="";
}
}
</script>
</head>
';
$query = ('SELECT a.CUSTOMER_ID as CUSTOMER_ID,a.PRODUCT_ID as PRODUCT_ID,c.PRODUCT_NAME as PRODUCT_NAME,a.SERVICE_ID as SERVICE_ID,
d.SERVICE_NAME as SERVICE_NAME,a.TYPE as TYPE,a.DATE as DATE,a.PRICE as PRICE,a.AMT as AMT,a.TOTAL_PRICE as TOTAL_PRICE,a.SALESMAN as SELLER,
e.USER_NAME as SELLER_NAME,b.CUSTOMER_NAME as CUSTOMER_NAME,a.MEMO as MEMO,a.MEMO1 as MEMO1 from SALE_HISTORY a
LEFT OUTER JOIN CUSTOMER b ON a.CUSTOMER_ID=b.CUSTOMER_ID
LEFT OUTER JOIN PRODUCT c ON a.PRODUCT_ID=c.PRODUCT_ID and a.TYPE=\'PRO\'
LEFT OUTER JOIN SERVICE d ON a.SERVICE_ID=d.SERVICE_ID and a.TYPE=\'SER\'
LEFT OUTER JOIN USER e ON a.SALESMAN=e.USER_ID'.(((''.' where HISTORY_ID=\'').$HISTORY_ID).'\''));
$cursor = exequery ($connection, $query);
if ($ROW = mysql_fetch_array ($cursor))
{
$CUSTOMER_ID1 = $ROW['CUSTOMER_ID'];
$PRODUCT_ID1 = $ROW['PRODUCT_ID'];
$PRODUCT_NAME1 = $ROW['PRODUCT_NAME'];
$SERVICE_ID1 = $ROW['SERVICE_ID'];
$SERVICE_NAME1 = $ROW['SERVICE_NAME'];
$TYPE1 = $ROW['TYPE'];
$CREATE_DATE = $ROW['DATE'];
$PRICE1 = $ROW['PRICE'];
$AMT1 = $ROW['AMT'];
$TOTAL_PRICE1 = $ROW['TOTAL_PRICE'];
$SELLER1 = $ROW['SELLER'];
$SELLER_NAME1 = $ROW['SELLER_NAME'];
$CUSTOMER_NAME1 = $ROW['CUSTOMER_NAME'];
$MEMO1 = $ROW['MEMO'];
$MEMO2 = $ROW['MEMO1'];
}
echo '<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/histroy.gif" WIDTH="22" HEIGHT="20" align="absmiddle">';
echo '<s';
echo 'pan class="big3"> 销售记录信息编辑 </span>
</td>
</tr>
</table>
<br>
<table border="0" width="70%" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<form enctype="multipart/form-data" action="update.php" method="post" name="form1">
<tr>
<td class="TableData" colspan="2" align="left">
&n';
echo 'bsp; <input type="radio" value="0" name=\'SERVICE_TYPE\' id=\'SERVICE_TYPE1\' ';
if (($TYPE1 == 'PRO'))
{
echo 'checked';
}
echo ' checked onclick="sel_change()"><label for="SERVICE_TYPE1">产 品</label>
<input type="radio" value="1" name=\'SERVICE_TYPE\' id=\'SERVICE_TYPE2\' ';
if (($TYPE1 == 'SER'))
{
echo 'checked';
}
echo ' onclick="sel_change()"><label for="SERVICE_TYPE2">服 务</label>
</td>
</tr>
<tr id="PRO" style=';
if (($TYPE1 == 'PRO'))
{
echo '';
}
else
{
echo 'display:none';
}
echo ' >
<td nowrap class="TableData">产品:</td>
<td class="TableData">
<input type="hidden" name="PRO_ID" value="';
echo $PRODUCT_ID1;
echo '">
<input type="text" name="PRO_NAME" size="20" class="BigStatic" maxlength="20" readonly value="';
echo $PRODUCT_NAME1;
echo '">
<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow1()" title="选择" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_dept1()" title="清空" name="button">
</td>
</tr>
<tr id="SER" style=';
if (($TYPE1 == 'SER'))
{
echo '';
}
else
{
echo 'display:none';
}
echo '>
<td nowrap class="TableData">服务:</td>
<td class="TableData">
<input type="hidden" name="SER_ID" value="';
echo $SERVICE_ID1;
echo '">
<input type="text" name="SER_NAME" size="20" class="BigStatic" maxlength="20" readonly value="';
echo $SERVICE_NAME1;
echo '">
<input type="button" value="选 择" class="SmallButton" onClick="LoadWindow2()" title="选择" name="button">
<input type="button" value="清 空" class="SmallButton" onClick="clear_dept2()" title="清空" name="button">
</td>
</tr>
<tr id="PRI" style=';
if (($TYPE1 == 'PRO'))
{
echo '';
}
else
{
echo 'display:none';
}
echo '>
<td nowrap class="TableData">单价:</td>
<td class="TableData">
<input type="text" name="PRICE" size="20" maxlength="20" class="BigInput" value="';
echo $PRICE1;
echo '">
</td>
</tr>
<tr id="QTY" style=';
if (($TYPE1 == 'PRO'))
{
echo '';
}
else
{
echo 'display:none';
}
echo '>
<td nowrap class="TableData">数量:</td>
<td class="TableData">
<input type="text" name="TRANS_QTY" size="20" maxlength="20" class="BigInput" value="';
echo $AMT1;
echo '">
</td>
</tr>
<tr id="TOTALPRICE" style=';
if (($TYPE1 == 'SER'))
{
echo '';
}
else
{
echo 'display:none';
}
echo ' >
<td nowrap class="TableData">总价:</td>
<td class="TableData">
<input type="text" name="TOTAL_PRICE" size="20" maxlength="20" class="BigInput" value="';
echo $TOTAL_PRICE1;
echo '">
</td>
</tr>
<tr>
<td nowrap class="TableData">客户名称: </td>
<td class="TableData">
<input type="hidden" name="CUSTOMER_ID" value="';
echo $CUSTOMER_ID1;
echo '">
<input type="text" name="CUSTOMER_NAME" class="BigStatic" size="15" maxlength="100" readonly value="';
echo $CUSTOMER_NAME1;
echo '">
</td>
</tr>
<tr>
<td nowrap class="TableData">记录日期:</td>
<td class="TableData">
<input type="text" name="CREATE_DATE" class="BigStatic" readonly size="20" maxlength="20" class="BigInput" value="';
echo $CREATE_DATE;
echo '">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.CREATE_DATE\');">
</td>
</tr>
<tr>
<td nowrap class="TableData">销售员:</td>
<td class="TableData">
<input type="hidden" name="TO_ID" value="';
echo $SELLER1;
echo '" >
<input type="text" name="TO_NAME" class="BigStatic" readonly size="15" maxlength="100" value="';
echo $SELLER_NAME1;
echo '">
<input type="button" value="选择" class="SmallButton" onClick="LoadWindow()" title="指定销售员" name="button">
</td>
</tr>
<tr>
<td nowrap class="TableData">备注:</td>
<td class="TableData">
<textarea name="MEMO" cols="45" rows="5" class="BigInput">';
echo $MEMO1;
echo '</textarea>
</td>
</tr>
<tr>
<td nowrap class="TableControl" colspan="2" align="center">
<input type="hidden" value="';
echo $HISTORY_ID;
echo '" name="HISTORY_ID">
<input type="hidden" name="TYPE" value="';
echo $TYPE1;
echo '">
<input type="button" value="确定" class="BigButton" onclick="CheckForm();">
<input type="button" value="返回" class="BigButton" onclick="location=\'../showdetail.php?CUSTOMER_ID=';
echo $CUSTOMER_ID1;
echo '\'">
</td>
</tr>
</form>
</table>
</body>
</html>';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -