<%
Function StrField(rs,strDBField,strField1)
if strField1<>"" then
rs(strDBField) = CStr(strField1)
end if
End Function
Function DateField(rs,strDBField,strField1)
if strField1<>"" then
rs(strDBField) = CDate(strField1)
end if
End Function
Function CurField(rs,strDBField,strField1)
if strField1<>"" then
rs(strDBField) = CCur(strField1)
end if
End Function
Function IntField(rs,strDBField,strField1)
if strField1<>"" then
rs(strDBField) = CInt(strField1)
end if
End Function
Function NumField(rs,strDBField,strField1)
if strField1<>"" then
rs(strDBField) = CDbl(strField1)
end if
End Function
Function ValidateUser(strUsername)
if len(strUsername)<8 or len(strUsername)>12 then
strUsername="a"
end if
okn=0
oklet=0
for i= 1 to len(strUsername)
testst=mid(strUsername,i,1)
if (testst>="A" and testst<="Z") or (testst>="a" and testst<="z") then
oklet=oklet+1
end if
if (testst>="0" and testst<="9") then
okn=okn+1
end if
next
if ((okn+oklet)<>len(strUsername)) or okn=0 or oklet=0 then
strUsername="a"
end if
ValidateUser=strUsername
End Function
If ((Request.ServerVariables("REQUEST_METHOD") = "POST") and (Request("Login")="yes")) Then
Session("Username") =ValidateUser(Request("username"))
Session("Password") =ValidateUser(Request("password"))
if Session("Password")="a" or Session("Username")="a" then
Session("Username") ="a"
Session("Password") ="a"
end if
end if
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Session("Username")=ValidateUser(Session("Username")) and Session("Password")=ValidateUser(Session("Password")) Then
if Request.Form("VTI-GROUP") = "0" then
Err.Clear
custline1=request("Customer_street1")
custline2=request("Customer_street2")
if len(custline1)>4 then
if left(custline1,4)="new:" then
session("Username")=ValidateUser(mid(custline1,5,99))
session("Password")=ValidateUser(custline2)
custline1=""
custline2=""
end if
end if
if Session("Username")=ValidateUser(Session("Username")) and Session("Password")=ValidateUser(Session("Password")) Then
Set fp_conn = Server.CreateObject("ADODB.Connection")
Set fp_rs = Server.CreateObject("ADODB.Recordset")
fp_conn.Open Application("Database0_ConnectionString")
fp_rs.Open "Standing_data", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
fp_rs.addnew
StrField fp_rs, "Login_Account",session("Username")
StrField fp_rs,"Login_password",session("Password")
StrField fp_rs,"Customer_name",request("Customer_name")
StrField fp_rs,"Customer_contact_name", request("Customer_contact_name")
StrField fp_rs,"Customer_street1", custline1
StrField fp_rs,"Customer_street2", custline2
StrField fp_rs,"Customer_town", request("Customer_town")
StrField fp_rs,"Customer_county", request("Customer_county")
StrField fp_rs,"Customer_postode", request("Customer_postode")
StrField fp_rs,"Customer_telephone", request("Customer_telephone")
StrField fp_rs,"Customer_fax", request("Customer_fax")
StrField fp_rs,"Customer_email", request("Customer_email")
StrField fp_rs,"Customer_www", request("Customer_www")
StrField fp_rs,"Customer_Order_by_email", request("Customer_Order_by_email")
StrField fp_rs,"Customer_Order_hardcopy", request("Customer_Order_hardcopy")
StrField fp_rs,"Supplier_name", request("Supplier_name")
StrField fp_rs,"Supplier_contact_name", request("Supplier_contact_name")
StrField fp_rs,"Supplier_street1", request("Supplier_street1")
StrField fp_rs,"Supplier_street2", request("Supplier_street2")
StrField fp_rs,"Supplier_town", request("Supplier_town")
StrField fp_rs,"Supplier_county", request("Supplier_county")
StrField fp_rs,"Supplier_postcode", request("Supplier_postcode")
StrField fp_rs,"Supplier_telephone", request("Supplier_telephone")
StrField fp_rs,"Supplier_mobile", request("Supplier_mobile")
StrField fp_rs,"Supplier_fax", request("Supplier_fax")
StrField fp_rs,"Supplier_email", request("Supplier_email")
StrField fp_rs,"Supplier_www", request("Supplier_www")
StrField fp_rs,"Supplier_accounts_name", request("Supplier_accounts_name")
StrField fp_rs,"Supplier_accounts_street1", request("Supplier_accounts_street1")
StrField fp_rs,"Supplier_accounts_street2", request("Supplier_accounts_street2")
StrField fp_rs,"Supplier_accounts_town", request("Supplier_accounts_town")
StrField fp_rs,"Supplier_accounts_county", request("Supplier_accounts_county")
StrField fp_rs,"Supplier_accounts_postcode", request("Supplier_accounts_postcode")
StrField fp_rs,"Supplier_accounts_telephone", request("Supplier_accounts_telephone")
StrField fp_rs,"Supplier_accounts_fax", request("Supplier_accounts_fax")
StrField fp_rs,"Supplier_accounts_email", request("Supplier_accounts_email")
StrField fp_rs,"Supplier_accounts_www", request("Supplier_accounts_www")
StrField fp_rs,"Supplier_payment_method", request("Supplier_payment_method")
StrField fp_rs,"Supplier_bank", request("Supplier_bank")
StrField fp_rs,"Supplier_account_name", request("Supplier_account_name")
StrField fp_rs,"Supplier_account_number", request("Supplier_account_number")
StrField fp_rs,"Supplier_sortcode", request("Supplier_sortcode")
StrField fp_rs,"Browser_type", request.ServerVariables("HTTP_USER_AGENT")
StrField fp_rs,"Remote_computer_name", request.ServerVariables("REMOTE_HOST")
DateField fp_rs,"Timestamp", Now
StrField fp_rs,"User_name", request.ServerVariables("REMOTE_USER")
fp_rs.Update
fp_rs.Close
fp_conn.Close
'add blank records to Transaction for a new account reference
Set fp_conn = Server.CreateObject("ADODB.Connection")
Set fp_rs = Server.CreateObject("ADODB.Recordset")
fp_conn.Open Application("Database0_ConnectionString")
fp_rs.Open "Transaction", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
fp_rs.Close
fp_conn.Close
end if
end if
if (Request.Form("VTI-GROUP") = "C" or Request.Form("VTI-GROUP") = "S") and Request("Editkey")="45633" then
Set fp_conn = Server.CreateObject("ADODB.Connection")
Set fp_rs = Server.CreateObject("ADODB.Recordset")
fp_conn.Open Application("Database0_ConnectionString")
fp_rs.Open "Transaction", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
fp_rs.addnew
StrField fp_rs, "Login_Account",session("Username")
StrField fp_rs,"Login_password",session("Password")
StrField fp_rs,"Transaction_type", Request.Form("VTI-GROUP")
StrField fp_rs,"Our_action", request("Our_action")
StrField fp_rs,"Our_order_reference", request("Our_order_reference")
StrField fp_rs,"Our_status", request("Our_status")
StrField fp_rs,"Our_comments", request("Our_comments")
StrField fp_rs,"Your_order_reference", request("Your_order_reference")
StrField fp_rs,"Your_job_code", request("Your_job_code")
StrField fp_rs,"Your_order_comments", request("Your_order_comments")
DateField fp_rs,"Transaction_date", request("Transaction_date")
StrField fp_rs,"Item_reference", request("Item_reference")
StrField fp_rs,"Item_quantity", request("Item_quantity")
CurField fp_rs,"Item_gross_amount", request("Item_gross_amount")
CurField fp_rs,"Item_open_Amount", request("Item_open_Amount")
StrField fp_rs,"Item_description", request("Item_description")
StrField fp_rs,"Browser_type", request.ServerVariables("HTTP_USER_AGENT")
StrField fp_rs,"Remote_computer_name", request.ServerVariables("REMOTE_HOST")
DateField fp_rs,"Timestamp", Now
StrField fp_rs,"User_name", request.ServerVariables("REMOTE_USER")
fp_rs.Update
fp_rs.Close
fp_conn.Close
end if
End If
End If
%>
|
 |
|
ACCOUNT REPORT AND ENTRY |
| |
| |
 |
<% if 0 then %>
<% end if %>
<%
fp_sQry="SELECT Transaction.Login_Account, Transaction.Login_password, Transaction.Transaction_type FROM Transaction GROUP BY Transaction.Login_Account, Transaction.Login_password, Transaction.Transaction_type HAVING ((Transaction.Login_Account='"&session("Username")&"') AND (Transaction.Login_password='"&session("Password")&"') AND ((Transaction.Transaction_type)='C'));"
fp_sDefault=""
fp_sNoRecords="."
fp_sDataConn="Database0"
fp_iMaxRecords=10
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=18
fp_fCustomQuery=True
BOTID=1
fp_iRegion=BOTID
%>
|
Customer
Transaction History |
<% if 0 then %>
<% end if %>
<%
fp_sQry="SELECT Transaction.* FROM Transaction WHERE((Transaction.Transaction_type='C') AND (Transaction.Login_Account='"&session("Username")&"') AND (Transaction.Login_password='"&session("Password")&"')) ORDER BY Transaction.Key DESC;"
fp_sDefault=""
fp_sNoRecords="."
fp_sDataConn="Database0"
fp_iMaxRecords=10
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=18
fp_fCustomQuery=True
BOTID=1
fp_iRegion=BOTID
%>
<% if 0 then %>
<% end if %>
<%
fp_sQry="SELECT Transaction.Login_Account, Transaction.Login_password, Transaction.Transaction_type FROM Transaction GROUP BY Transaction.Login_Account, Transaction.Login_password, Transaction.Transaction_type HAVING ((Transaction.Login_Account='"&session("Username")&"') AND (Transaction.Login_password='"&session("Password")&"') AND ((Transaction.Transaction_type)='S'));"
fp_sDefault="update1=&update2="
fp_sNoRecords="."
fp_sDataConn="Database0"
fp_iMaxRecords=10
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=18
fp_fCustomQuery=True
BOTID=4
fp_iRegion=BOTID
%>
|
Supplier
Transaction History |
<% if 0 then %>
<% end if %>
<%
fp_sQry="SELECT Transaction.* FROM Transaction WHERE ((Transaction.Transaction_type='S') AND (Transaction.Login_Account='"&session("Username")&"') AND (Transaction.Login_password='"&session("Password")&"')) ORDER BY Transaction.Key DESC; "
fp_sDefault="update1=&update2="
fp_sNoRecords="."
fp_sDataConn="Database0"
fp_iMaxRecords=10
fp_iCommandType=1
fp_iPageSize=0
fp_fTableFormat=False
fp_fMenuFormat=False
fp_sMenuChoice=""
fp_sMenuValue=""
fp_iDisplayCols=18
fp_fCustomQuery=True
BOTID=4
fp_iRegion=BOTID
%>
|