<% 'dim loginid loginId = request("hiddenGroupId") if loginid="" then loginid = session("loginid") end if %> <% if session("isSysAdmin")<>"" then response.write("
") Response.write("

"& ucase(loginid)&" ") response.write("

") response.write("
") end if %> <% if request.ServerVariables("https")<>"on" then strNewURL = "https://" & Request.ServerVariables("SERVER_NAME") _ & Request.ServerVariables("URL") & "?" _ & Request.ServerVariables("QUERY_STRING") response.redirect(strNewURL) end if 'response.write(session("LoginId") & "xx") OpenDBConnection Dim LoginId, LoginPassword, Flag,sql Dim objRSGroup Dim ASPFlag dim msg,transID,colorCode ASPFlag = Request("hiddenFlag") if ASPFlag="True" then ASPFlag=0 end if if session("LoginId")="" then response.redirect("loginpage.asp?") else LoginId = session("LoginId") 'LoginSuccess end if Select Case ASPFlag Case 0 'First Time Login 'response.write session("LoginId") if session("LoginId")="" then Flag = False LoginId = Trim(Request("member_email")) LoginPassword = Trim(Request("txtLoginPassword")) SQL = "select * from vwgroupmemberinfo where password='"&LoginPassword&"' and member_email='"&Trim(request("member_email"))&"'" 'group_name='"&LoginId&"' and Set objRSGroup = conn.execute(sql) if not objRSGroup.eof then While Not objRSGroup.EOF 'response.write "here.." & "
" 'response.write "here.." session("LoginId") =objRSGroup("member_email") 'LoginId session("email") =objRSGroup("member_email") session("isAdmin") =objRSGroup("isAdmin") session("isSysAdmin") =objRSGroup("isSysAdmin") arrAccount(i) =objRSGroup("group_name") i = i + 1 objRSGroup.MoveNext wend 'Session("arrAccount") = arrAccount else i = 0 end if 'response.write i If i=0 Then 'LoginFailure displayLoginForm() objRSGroup.Close Set objRSGroup= Nothing Conn.Close Set Conn = Nothing End If If Not(Flag) Then LoginFailure End If end if LoginSuccess Case 1 ' Add Expense Dim strDate,strMonth,strYear,strDateVal,strAmount,strComment,strEmail LoginId = Trim(Request("hiddenGroupId")) If request("dateinfo")<>"" then strDateVal = request("dateinfo") strDateVal = formatDateTime(strDateVal) strDateVal = Year(strDateVal) & "-" & Month(strDateVal) & "-" & Day(strDateVal) '' Day of the month without leading zero 'strDateVal = replace(strDateVal,"/","-") strDateVal = strDateVal& " "& hour(now()) &":"& minute(now())&":"&second(now()) 'strDateVal = FormatDateTime(strDateVal,vbgeneraldate) Else strDateVal = Now() End If strAmount = Trim(Request("txtExpenseAmount")) if strAmount <>"" then if not isnumeric(strAmount) then strAmount = 0.00 end if end if strComment = Trim(Request("txtExpenseComment")) strComment = replace(strComment,"'","''") strEmail = Trim(Request("lstMemberList")) If strAmount = "" or strComment = "" or strEmail = "" Then Response.Write "One of the Information has been left blank or there are no members in the group." 'LoginSuccess Else Dim SQLInsertExpense,rsView SQLInsertExpense = "INSERT INTO expense (member_email, amount, dateinfo, comment, group_name,processed) VALUES ('" & _ strEmail & "' , '" & strAmount & "' ,'" & strDateVal & "', '" & strComment & "' , '" & LoginId & "','N');" 'response.write SQLInsertExpense conn.Execute SQLInsertExpense Set rsView = conn.execute("Select autoid from expense Where group_name='" & LoginId & "' order by autoid desc ") if not rsView.eof then transID = rsView("autoID") end if rsView.close Set rsView = Nothing msg = "Record Added Successfully." End If LoginSuccess Case 2 ' Add Member LoginId = Trim(Request("hiddenGroupId")) Dim SQLInsertMember Dim objRSMemberCheck Dim Count1 Count1 = 0 dim bolFlag Dim NewEmail bolFlag = False NewEmail = Trim(Request("txtMemberEmail")) SQLInsertMember = "INSERT INTO member (member_email,group_name) VALUES ('" & _ NewEmail & "' , '" & LoginId & "');" conn.execute(SQLInsertMember) If NewEmail <> "" Then Set objRSMemberCheck = conn.execute("select * from member") Do While Not objRSMemberCheck.EOF If (strComp(objRSMemberCheck("member_email"),NewEmail ,VBTextCompare) =0) Then If (strComp(objRSMemberCheck("group_name"),LoginId ,VBTextCompare) =0) Then Count1 = Count1 + 1 Else bolFlag = True end If End If objRSMemberCheck.MoveNext Loop If Count1 = 0 Then If Not bolFlag Then conn.Execute SQLInsertMember Response.Write "The Member was successfully Added to your "&LoginId&" group." dim lg_newcomment,mailintro mailintro = "You have been added to The Member was successfully Added" lg_newcomment ="URL: http://tradehub.ca/inexp/" lg_newcomment = lg_newcomment & "Login Email: " & NewEmail & "" lg_newcomment = lg_newcomment & "Password:" & "" mail "services@tradehub.ca", NewEmail, "", "", "TRADEHUB ACCOUNTING & FINANCIAL SYSTEM" & " : " & lg_newcomment, mailintro, "", "", 0 Else Response.Write "The Member Exists in another group. Please try another Email Id." End If Else Response.Write "The Member or Email Id already Exisits in your group." End If Else Response.Write "Please enter a valid Email Address of the New Member." End If LoginSuccess Case 3 ' Delete Member Dim SQLDeleteMember LoginId = Trim(Request("hiddenGroupId")) Dim objRSExpenseCheck Dim Count Dim strEmailDelete Count = 0 strEmailDelete = Trim(Request("lstMemberList")) SQLDeleteMember = "DELETE FROM member WHERE member_email = '" & strEmailDelete & "' AND group_name = '" & LoginId & "';" 'response.write SQLDeleteMember conn.execute(SQLDeleteMember) Set objRSExpenseCheck= conn.execute("select * from member where group_name = '" & LoginId & "';") Do While Not objRSExpenseCheck.EOF If (strComp(objRSExpenseCheck("group_name"),LoginId ,VBTextCompare) =0) Then Count = Count + 1 End If objRSExpenseCheck.MoveNext Loop If strEmailDelete = "" Then Response.Write "There is No member in the group to Delete." Else If Count = 0 Then conn.Execute SQLDeleteMember Response.Write "The Member was successfully deleted from your group." Else Response.Write "The Member can not be deleted from the group until all expenses are cleared." End If End If objRSExpenseCheck.Close Set objRSExpenseCheck = Nothing LoginSuccess Case 4 ' Start New Account LoginId = Trim(Request("hiddenGroupId")) 'Set objRSExpenseDelete= Nothing Dim SQLNewAccount SQLNewAccount = "Update expense set processed='Y',processDate='"&Date()&"',processedBy='"&session("email")&"' WHERE group_name = '" & LoginId & "';" conn.Execute SQLNewAccount Response.Write "Your Expence account was all cleared and you can start a fresh expence account." LoginSuccess Case 5 'Back to Home Page LoginId = Request("hiddenGroupId") LoginSuccess End Select Sub LoginFailure Response.Redirect "loginpage.asp" End Sub Sub LoginSuccess() %>

Add a New Record

Transaction Type:
Select an Income Method
Select an Expense Method

Amount  
Date        " value="<%=now()%>" style="width:100%;">
Details    
Added By
<% 'Fileup "filename", "", "file", "web", "", "", "" %>


Submit Bulk Records

<% if transID<>"" then 'e = inputbox("enter a nunber ") if even = (transID mod 2 = 0) then colorcode="blue" ' "even number" else colorcode="red" '"not an even number" end if Response.Write(" ["& msg & "("&transID&")]") else Response.write(" ") end if %>
 
<% End sub 'fileup "", "", "file", "web", "", "", "" sub fileup(nombre, etiqueta, tipo, valor, cols, multi, valida) dim formulario,html,color %> <% color="#f5f5f5" html="
" & vbCrlf html=html & "" & vbCrlf html=html & vbTab & "
" & vbCrlf html=html & vbTab & "
" & vbCrlf html=html & "" & vbCrlf html=html & vbTab & "" & vbCrlf html=html & "
" & vbCrlf formulario=formulario & html response.write formulario end Sub 'footer() %>

Copyright © TradeHUB Canada Inc. All Rights Reserved