📄 commfunction.inc
字号:
<SCRIPT language=Javascript>
function showfile(str,a) {
var leftval=100;
window.open(str, 'showfile'+a, 'left='+leftval+',top=100,width=600,height=400,resizable=1,status=0,menubar=0,scrollbars=1');
}
</SCRIPT>
<%
pagename=Request.ServerVariables("SCRIPT_NAME")
set connpage=server.createobject("adodb.connection")
connpage.open session("connstring")
set rs=connpage.execute("select * from userprofile where userid='"&session("loginid")&"'")
if rs.eof then
set rs=connpage.execute("select profilelistid from profilelist where pagename='"&trim(pagename)&"'")
if not rs.eof then
%>
<SCRIPT language=Javascript>
showfile("../profilelist/ProFilebottom.asp?ProFileListid=<%=rs("ProFileListid")%>",'aa');
</SCRIPT>
<%
rs.close
end if
end if
set rs=nothing
connpage.close
set connpage=nothing
%>
<SCRIPT language=JavaScript>
function opensubwin(attrstr,targ1)
{
var tempwin=window.open(targ1,null,attrstr);
tempwin.location.href=targ1;
//tempwin.opener=this;
}
function opensubwin2(theForm,theName,theid,theseq)
{
var theWindow;
var theAccount;
theWindow = window.open("../select.asp?theForm="+theForm+"&theName="+theName+"&theid="+theid+"&theseq="+theseq,"Select","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwin3(openurl,title,windowform)
{
var theWindow;
var theAccount;
theWindow = window.open(openurl,title,windowform);
theWindow.opener = this;
}
function opensubwin4(theForm,theName,theCode,thePrice)
{
var theWindow;
var theAccount;
theWindow = window.open("../selectProduct.asp?theForm="+theForm+"&theName="+theName+"&theCode="+theCode+"&thePrice="+thePrice,"选择产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwin5(theForm,theName,theCode,thePrice,theSpecialPriceNo,theAccount)
{
if(form1.account.value==-1){
alert('请先选择供应商!');
return false;
}
var theWindow;
var theAccount;
theWindow = window.open("selectPOProduct.asp?theForm="+theForm+"&theName="+theName+"&theCode="+theCode+"&thePrice="+thePrice+"&theSpecialPriceNo="+theSpecialPriceNo+"&theAccount="+theAccount,"选择产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwinpoqty(theForm,theName,theCode,thePrice,theSpecialPriceNo,theQty,theAccount)
{
if(form1.account.value==-1){
alert('请先选择供应商!');
return false;
}
var theWindow;
var theAccount;
theWindow = window.open("selectpoqtyproduct.asp?theForm="+theForm+"&theName="+theName+"&theCode="+theCode+"&thePrice="+thePrice+"&theSpecialPriceNo="+theSpecialPriceNo+"&theQty="+theQty+"&theAccount="+theAccount,"选择产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwin6(theForm,theType,theProductid,theAccountid)
{
var theWindow;
var theAccount;
theWindow = window.open("../showhistory.asp?theForm="+theForm+"&theType="+theType+"&theProductid="+theProductid+"&theAccountid="+theAccountid,"查看历史","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwin7(theForm,theName,thePrice)
{
var theWindow;
var theAccount;
theWindow = window.open("../product/select.asp?theForm="+theForm+"&theName="+theName+"&thePrice="+thePrice,"选择产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwinwithsearch(aspfile,theForm,theName,field,value)
{
var theWindow;
var theAccount;
theWindow = window.open(aspfile+"?theForm="+theForm+"&theName="+theName+"&field="+field+"&value="+value,"选择产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwin8(theForm,theName,theCode,thePrice,theAccount,theDiscount,theDiscountPrice)
{
if(form1.account.value==-1){
alert('请先选择客户!');
return false;
}
var theWindow;
var theAccount;
theWindow = window.open("../selectprotoquoteorder.asp?theForm="+theForm+"&theName="+theName+"&theCode="+theCode+"&thePrice="+thePrice+"&theAccount="+theAccount+"&theDiscount="+theDiscount+"&theDiscountPrice="+theDiscountPrice,"选择产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwin9(theForm,theName,theCode,thePrice)
{
var theWindow;
var theAccount;
theWindow = window.open("selectwhseproduct.asp?theForm="+theForm+"&theName="+theName+"&theCode="+theCode+"&thePrice="+thePrice,"选择产品","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function opensubwin10(theForm,theName,theWhse)
{
var theWindow;
var theAccount;
theWindow = window.open("selectwhseloc.asp?theForm="+theForm+"&theName="+theName+"&theWhse="+theWhse,"选择货位","toolbar=no,scrollbars=yes,location=no,status=no,menubar=no,width=520,height=320,top=150,left=160");
theWindow.opener = this;
}
function CheckDate(input){
var d1 = "";
d1 = input;
d1 = d1.split("-");
//alert('d1[0] is '+d1[0]+' d1[1] is '+d1[1]+'d1[2] is '+d1[2]);
if ((d1[0] > 2099)||(d1[0]=="")) return 1;//PeiJun_Yan于2004-5-18加
if ((input=="TODAY")||(input=="YESTERDAY")||(input=="TOMORROW")||(input=="LAST WEEK")||(input=="THIS WEEK")||(input=="NEXT WEEK")||(input=="LAST MONTH")||(input=="THIS MONTH")||(input=="NEXT MONTH")) return 0;
if ((d1[1]>0) && (d1[1]<13) && (d1[2]<32) && (d1[2]>0)) {
if (
!(d1[1]==2 && d1[2]==31) &&
!(d1[1]==2 && d1[2]==30) &&
!(d1[1]==4 && d1[2]==31) &&
!(d1[1]==6 && d1[2]==31) &&
!(d1[1]==9 && d1[2]==31) &&
!(d1[1]==11 && d1[2]==31)&&
!(
!(
(d1[0] %4==0 && !(d1[0] %100==0)) ||
(d1[0] % 400 ==0)
) &&
d1[1]==2 &&
d1[2]==29
)
) {
return (0);
}
else {
return (1);
}
}
else {
return (1);
}
}
</SCRIPT>
<%
if session("loginid")="" then
%>
<script language=javascript>
//alert("登录超时,请注销重新登录");
window.location="/loss.asp";
</script>
<%end if%>
<%
function getdefine(definetype,selected)
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open connstring
rs.open "select id,name from userdefine where definetype='"&definetype&"' and closed<>1",conn,1,1
do while not rs.eof
response.write "<option value="&rs("id")
if rs("id")=selected then
response.write " selected"
end if
response.write ">"&rs("name")&"</option>"
rs.movenext
loop
'rs.close
set rs=nothing
conn.close
set conn=nothing
end function
function getdefine2(definetype,selected)
set conndf=server.createobject("adodb.connection")
set rsdf=server.createobject("adodb.recordset")
conndf.open connstring
rsdf.open "select name from userdefine where definetype='"&definetype&"' and closed<>1",conndf,1,1
do while not rsdf.eof
response.write "<option value="&rsdf("name")
if rsdf("name")=selected then
response.write " selected"
end if
response.write ">"&rsdf("name")&"</option>"
rsdf.movenext
loop
'rs.close
set rsdf=nothing
conndf.close
set conndf=nothing
end function
function getsubordinate(selected)
set connsubordinate=server.createobject("adodb.connection")
set rssubordinate=server.createobject("adodb.recordset")
connsubordinate.open connstring
rssubordinate.open "select userid,UserName from vw_userreportto_all where reportto='"&session("loginid")&"'",connsubordinate,1,1
response.write "<option value="&session("loginid")
if session("loginid")=selected then
response.write " selected"
end if
response.write ">"&session("UserName")&"</option>"
do while not rssubordinate.eof
response.write "<option value="&rssubordinate("userid")
if rssubordinate("userid")=selected then
response.write " selected"
end if
response.write ">"&rssubordinate("UserName")&"</option>"
rssubordinate.movenext
loop
'rssubordinate.close
set rssubordinate=nothing
connsubordinate.close
set connsubordinate=nothing
end function
function getdefinepeprotery(definetype,peprotery,selected)
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open connstring
rs.open "select id,name from userdefine where definetype='"&definetype&"' and closed<>1 and definetypeprotery='"&peprotery&"'",conn,1,1
do while not rs.eof
response.write "<option value="&rs("id")
if rs("id")=selected then
response.write " selected"
end if
response.write ">"&rs("name")&"</option>"
rs.movenext
loop
'rs.close
set rs=nothing
conn.close
set conn=nothing
end function
function getdealprocess(selected)
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open connstring
rs.open "select dealprocessid,dealprocess from dealprocess ",conn,1,1
do while not rs.eof
response.write "<option value="&rs("dealprocessid")
if rs("dealprocessid")=selected then
response.write " selected"
end if
response.write ">"&rs("dealprocess")&"</option>"
rs.movenext
loop
'rs.close
set rs=nothing
conn.close
set conn=nothing
end function
function getusername(selected)
set conn=server.createobject("adodb.connection")
set rs=server.createobject("adodb.recordset")
conn.open connstring
rs.open "select id,username from usertable",conn,1,1
do while not rs.eof
response.write "<option value="&rs("id")
if rs("id")=selected then
response.write " selected"
end if
response.write ">"&rs("username")&"</option>"
rs.movenext
loop
'rs.close
set rs=nothing
conn.close
set conn=nothing
end function
function getgrouptype(tablename,fieldname,selected)
set conngrouptype=server.createobject("adodb.connection")
set rsgrouptype=server.createobject("adodb.recordset")
conngrouptype.open connstring
rsgrouptype.open "select "&fieldname&" from "&tablename&" group by "&fieldname, conn,1,1
do while not rsgrouptype.eof
response.write "<option value="&rsgrouptype(fieldname)
if rsgrouptype(fieldname)=selected then
response.write " selected"
end if
response.write ">"&rsgrouptype(fieldname)&"</option>"
rsgrouptype.movenext
loop
rsgrouptype.close
set rsgrouptype=nothing
conngrouptype.close
set conngrouptype=nothing
end function
function getinventoryoption()
response.write "<option value=inventory.asp>库存清单</option>"
response.write "<option value=whse.asp>仓库管理</option>"
response.write "<option value=deliveryguide.asp>收/发货处理</option>"
response.write "<option value=MaterialTransaction.asp>收/发货记录</option>"
end function
function getfieldvalue(tablename,fieldname,fieldvalue,returnfield)
set connf=server.createobject("adodb.connection")
set rsf=server.createobject("adodb.recordset")
connf.open connstring
rsf.open "select "&returnfield&" from "&tablename&" where "&fieldname&"='"&fieldvalue&"'",connf,1,1
if not rsf.eof then
getfieldvalue=rsf(returnfield)
else
getfieldvalue=""
end if
rsf.close
set rsf=nothing
connf.close
set connf=nothing
end function
function updateorderpayment(paymentid)
dim connupdate
dim rsupdate
set connupdate=server.createobject("adodb.connection")
set rsupdate=server.createobject("adodb.recordset")
connupdate.open connstring
rsupdate.open "select amount from collection where paymentid="&paymentid,connupdate,1,1
if rsupdate.eof then
tempamount=0
else
do while not rsupdate.eof
tempamount=tempamount+Csng(rsupdate("amount"))
rsupdate.movenext
loop
end if
rsupdate.close
if Trim(tempamount)="" then
rsupdate.open "update orderpayment set receivedamount=0 where paymentid="&paymentid,connupdate,2,3,1
else
rsupdate.open "update orderpayment set receivedamount="&tempamount&" where paymentid="&paymentid,connupdate,2,3,1
end if
set rsupdate=nothing
connupdate.close
set connupdate=nothing
end function
function updatepopayment(paymentid)
dim connupdate
dim rsupdate
set connupdate=server.createobject("adodb.connection")
set rsupdate=server.createobject("adodb.recordset")
connupdate.open connstring
rsupdate.open "select amount from pocollection where paymentid="&paymentid,connupdate,1,1
if rsupdate.eof then
tempamount=0
else
do while not rsupdate.eof
tempamount=tempamount+Csng(rsupdate("amount"))
rsupdate.movenext
loop
end if
rsupdate.close
if Trim(tempamount)="" then
rsupdate.open "update popayment set receivedamount=0 where paymentid="&paymentid,connupdate,2,3,1
else
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -