<% option explicit 'on error resume next response.buffer=true ' 16/9/15 add vat change 17% chckbox13 ' 1/10/15 change checkbox13 redirection to ununsered ' 30/11/15 change err massege ' 31/12/15 add dos price ' 07/01/16 fix no remarks background color to rgb from rgba ' 12/01/16 add update changes button ' 17/01/16 remove vat change 17% chckbox13 ' 2/2/16 fix bug when manui is not found ' 8/3/16 add 856 report option ' 21/3/16 send 856 to status 604 ' 1/6/16 change status to 0 if eos dim conn,rs,connBKMV,strSql,snifemail,counter,objCDOMail,mailFrom,remarktype,Sstatus,Bstatus,Nstatus,i,sent,query,recordId,BrecordId,remdays,dosremark,message,subdays%> <% sent = "0" remdays=0 dosremark="0" subdays=31-day(dateadd("d",-1,dateadd("m",+0,replace(now(), datepart("d",now()), "1"))) ) if Len(request.form("send")) then ' הוסף סוג תוכנה להערות if request.form("checkbox4") = "on" then remarktype = "| הוספת עמדת עבודה |" & remarktype end if if request.form("checkbox8") = "on" then remarktype = "| סיוע טכני |" & remarktype end if if request.form("checkbox1") = "on" then remarktype = "| שאלה שוטפת |" & remarktype end if if request.form("checkbox9") = "on" then remarktype = "| קופות |" & remarktype end if if request.form("checkbox3") = "on" then remarktype = "| חידוש חוזה שרות |" & remarktype end if if request.form("checkbox7") = "on" then remarktype = "| מכירות |" & remarktype end if if request.form("checkbox5") = "on" then remarktype = "| מערכת 1000 |" & remarktype end if if request.form("checkbox6") = "on" then remarktype = "| קבצים אחידים |" & remarktype end if if request.form("checkbox2") = "on" then remarktype = "| מע""מ מקוון 874 |" & remarktype end if if request.form("checkbox10") = "on" then remarktype = "| גיבויים |" & remarktype end if if request.form("checkbox11") = "on" then remarktype = "| חנות וירטואלית |" & remarktype end if if request.form("checkbox12") = "on" then remarktype = "| שרותי בנק אוטומטים (ש.ב.א) |" & remarktype end if ' if request.form("checkbox13") = "on" then remarktype = "| שינוי מע""מ 17% |" & remarktype end if if request.form("checkbox14") = "on" then remarktype = "| דוח 856 |" & remarktype end if Sstatus = -1 Bstatus = -1 for i=1 to 14 if Sstatus = -1 and (i=4 or i=8 or i=9 or i=1 or i=3 or i=7 or i=2 or i=11 or i=12 or i=13) then if request.form("checkbox"&i) = "on" and i = 3 then Sstatus=0 end if if request.form("checkbox"&i) = "on" and i = 7 then Sstatus=0 end if if request.form("checkbox"&i) = "on" and i = 9 then Sstatus=1604 end if ' if request.form("checkbox"&i) = "on" and i = 2 then Sstatus=140 end if if request.form("checkbox"&i) = "on" and i = 2 then Sstatus=0 end if if request.form("checkbox"&i) = "on" and i = 11 then Sstatus=1704 end if if request.form("checkbox"&i) = "on" and i = 12 then Sstatus=0 end if if request.form("checkbox"&i) = "on" and i = 13 then Sstatus=0 end if if request.form("checkbox"&i) = "on" and (i = 1 or i = 8 or i = 4) then Sstatus=0 end if else if request.form("checkbox"&i) = "on" and (i = 1 or i = 8 or i = 4 or i = 3 or i = 7 or i = 2) then Sstatus=0 end if end if if Bstatus = -1 and (i=5 or i=6 or i = 10 or i = 14) then if request.form("checkbox"&i) = "on" and (i = 5 or i = 6 or i = 10 or i = 14) and timevalue(now()) < timevalue("2005-01-01 17:00:00") and weekday(now()) <> 6 then Sstatus=804 else if request.form("checkbox"&i) = "on" and (i = 5 or i = 6 or i = 10 or i = 14) then Sstatus=0 end if end if end if if Bstatus = -1 and ( i = 14) then if request.form("checkbox"&i) = "on" and (i = 14) and timevalue(now()) < timevalue("2005-01-01 16:00:00") and weekday(now()) <> 6 then Sstatus=604 else if request.form("checkbox"&i) = "on" and ( i = 14) then Sstatus=0 end if end if end if next if Sstatus = -1 and Bstatus = -1 then Sstatus=0 end if if not Sstatus = -1 then set rs=server.createobject("adodb.recordset") strSql="select * from contacts856 where custid=" & request.Form("custid") rs.open strSql,conn,1,3 rs.addnew rs("Companyname")=request.form("Companyname") if request.Form("custid")<0 or request.Form("custid")>999999999 then response.end else rs("custid")=request.form("custid") end if if request.form("Extention") ="" then rs("contact")=request.form("contact") else rs("contact")=request.form("contact")&" / "&request.form("Extention") end if rs("phone")=request.form("phone") rs("email")=request.form("email") rs("till")=request.form("till") rs("CompName")=Request.Form("computername") rs("custlog")=request.form("soft") rs("remarks")=remarktype &"
"& request.form("remarks") rs("RollTime")=now rs("RollDate")=date rs("tupal")=Sstatus if request.form("checkbox14") = "on" then rs("supportname")="856" end if rs.update recordId=rs("id") rs.close end if if not Bstatus = -1 then set rs=server.createobject("adodb.recordset") strSql="select * from contacts856 where custid=" & request.Form("custid") rs.open strSql,connBKMV,1,3 rs.addnew rs("Companyname")=request.form("Companyname") if request.Form("custid")<0 or request.Form("custid")>999999999 then response.end else rs("custid")=request.form("custid") end if if request.form("Extention") ="" then rs("contact")=request.form("contact") else rs("contact")=request.form("contact")&" / "&request.form("Extention") end if rs("phone")=request.form("phone") rs("email")=request.form("email") rs("till")=request.form("till") rs("CompName")=Request.Form("computername") rs("custlog")=request.form("soft") rs("remarks")=remarktype &"
"& request.form("remarks") rs("RollTime")=now rs("RollDate")=date rs("tupal")=Bstatus rs.update BrecordId=rs("id") rs.close end if Response.Cookies("hash").Expires=#01/01/2038# Response.Cookies("hash")("custid")=request.form("custid") Response.Cookies("hash")("Companyname")=request.form("Companyname") Response.Cookies("hash")("contact")=request.form("contact") Response.Cookies("hash")("email")=request.form("email") Response.Cookies("hash")("phone")=request.form("phone") Response.Cookies("hash")("soft")=request.form("soft") 'Send using the Pickup directory on the IIS server. Dim iMsg Dim iConf Dim Flds Dim MailStr Const cdoSendUsingPickup = 1 set iMsg = CreateObject("CDO.Message") set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPickup .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverpickupdirectory")="c:\Inetpub\mailroot\Pickup" .Update End With ' Build HTML for message body. MailStr="" MailStr=MailStr &"" MailStr=MailStr &"" MailStr=MailStr &"") document.write("") } else{ document.write("") document.write("") } //disable enter key in form function getKeyCode(iKC){ if (iKC==13) { event.keyCode = 0; event.cancelBubble = true; event.returnValue = false; } } // validate email function isEmailAddr(mail) { var result = false var theStr = new String(mail) var index = theStr.indexOf("@"); if (index > 0) { var pindex = theStr.indexOf(".",index); if ((pindex > index+1) && (theStr.length > pindex+1)) result = true; } return result; } // clear the form function clearForm(theform) { var frm_elements = theform.elements; action(); for(i=0; i