<%@ Language=VBScript %>
<!--#include file="includes.asp"-->
<HTML>
<HEAD><TITLE>Add/Edit Donor</TITLE>
<LINK REL="StyleSheet" HREF="css/default.css" TYPE="text/css" MEDIA="all">
<% Response.Expires = 0 %>
</head>
<div class="center">
<BODY link="black" alink="red" vlink="lightblue" topmargin = "10%" bgcolor="lightblue" FONT="SANSERIF"><h1 >Donors</h1>
<%
dim strSql
dim strSql2
dim rsVols
dim passdonorid
dim strAddEdit
Dim rs
Dim DonorBusName
dim VolunteerID
dim VolFName
dim VolLName
Dim DonorType
Dim DonorSubType
Dim DonorEmail
Dim DonorWebsite
Dim DonorDept
Dim DonorAddress
Dim DonorAddress2
Dim DonorCity
Dim DonorState
Dim DonorZip
Dim DonorPhone
Dim DonorPhone2
Dim DonorFAX
Dim StartedYear
Dim Active
Dim FID
Dim DonorNotes
dim strtype
dim strsubtype
dim strVolID
dim strVolFName
dim strVolLName
dim strTaxYear
dim rs3
dim strSql3
intdonor=request.querystring("donorid")
strSql="Select * from tdonors WHERE fldDonorID = " & intdonor & ";"
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open ConString
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open strSql, Conn
if not rs.eof then
VolunteerID= rs("fldVolunteerID")
DonorBusName = rs.fields("fldDonorBusName")
VolID = rs.fields("fldVolunteerID")
DonorType = rs.fields("fldDonorType")
DonorSubType= rs("fldDonorSubType")
DonorEmail = rs.fields("fldDonorEmail")
DonorWebsite = rs.fields("fldDonorWebsite")
DonorDept = rs.fields("fldDonorDept")
DonorAddress = rs.fields("fldDonorAddress")
DonorAddress2 = rs.fields("fldDonorAddress2")
DonorCity = rs.fields("fldDonorCity")
DonorState = rs.fields("fldDonorState")
DonorZip = rs.fields("fldDonorZip")
DonorPhone = rs.fields("fldDonorPhone")
DonorPhone2 = rs.fields("fldDonorPhone2")
DonorFAX = rs.fields("fldDonorFAX")
strTaxYear = rs.fields("fldActiveYear")
Active = rs.fields("fldActive")
FID = rs.fields("fldfid")
DonorNotes = rs.fields("fldDonorNotes")
else
response.write "bozo" & intdonor
end if
%>
<p><font color="blue"> <a href="getdonors.asp?userID=<%=intUserID%>">Return to Donors Menu</a></font></br></p>
<a href="webmainmenu.asp?userID=<%=intUserID%>">Return to Main Menu</a>
<form action="testeditdonor.asp" method="post" >
<table>
<tr>
<th>Donor ID </th>
<th> Donor Type</th>
<th> Volunteer</th>
<th> Business Name</th>
<th> Donor Email</th><p>
<th> Website</th><p>
</tr>
<tr>
<td><%=intdonor%></td>
<%strSql3="Select * from webdonortypeandsub"
<!--Set Conn = Server.CreateObject("ADODB.Connection")-->
<!--Conn.Open ConString-->
Set rs3 = Server.CreateObject("ADODB.Recordset")
rs3.Open strSql3, Conn
if not rs3.eof then %>
<td>
<font size ="8pt">
<select style =width:"150px";name="Types_Subtypes" >
<%
rs3.movefirst
end if
do while not rs3.eof
strType = rs3("fldDonorType")
strSubtype = rs3("fldDonorTypeSub")
IF donortype = strType and donorSubtype = strsubtype then%>
<option value=<%=strType%>><% =strType%>__<% =strSubtype %>SELECTED</option>
<%else%>
<option value=<% =strType%>><% =strType%>__<% =strSubtype %></option>
<%end if
rs3.movenext
loop
rs3.Close
set rs3 = Nothing%>
</font>
</td>
</select>
<%strSql2="Select * from LU_tVolunteers WHERE fldActive = -1 ORDER BY fldVolFirstName"
<!--Set Conn = Server.CreateObject("ADODB.Connection")-->
<!--Conn.Open ConString-->
Set rsVols = Server.CreateObject("ADODB.Recordset")
rsVols.Open strSql2, Conn
%>
<td>
<font size ="8pt"><select style =width:"150px";name="Volunteers" >
<%
rsVols.movefirst
do while not rsVols.eof
strVolID = rsVols("fldVolunteerID")
strVolFName = rsVols("fldVolFirstName")
strVolLName = rsVols("fldVolLastName")
if strVolID = VolunteerID then%>
<option value=<% =strVolID%>><% =strVolID%>__<% =strVolFName%>_<% =strVolLName%>SELECTED</option>
<%ELSE%>
<option value=<% =strVolID%>><% =strVolID%>__<% =strVolFName%>_<% =strVolLName%> </option>
<%END IF
rsVols.movenext
loop%>
</font></td></select>
<td><input type="text" name ="DonorBusName" value = "<%=DonorBusName%>"/></td>
<td><input type="text" name="DonorEmail" value = "<%=DonorEmail%>"/></td>
<td><input type="text" name="DonorWebsite" value = "<%=DonorWebsite%>"/></td>
</tr>
<tr>
<th> Phone</th>
<th> Phone2</th>
<th> FAX</th>
</tr>
<tr>
<td><input type="text" name="DonorPhone" value = "<%=DonorPhone%>"/></td>
<td><input type="text" name="DonorPhone2" value = "<%=DonorPhone2%>"/></td>
<td><input type="text" name="DonorFAX" value = "<%=DonorFAX%>"/></td>
</tr>
<tr>
<th> Dept</th>
<th> Address</th>
<th> Address2</th>
<th> City</th>
<th> State</th>
<th> Zip</th>
</tr>
<tr>
<td><input type="text" name="DonorDept" value = "<%=DonorDept%>"/></td>
<td><input type="text" name="DonorAddress" value = "<%=DonorAddress%>"/></td>
<td><input type="text" name="DonorAddress2" value = "<%=DonorAddress2%>"/></td>
<td><input type="text" name="DonorCity" value = "<%=DonorCity%>"/></td>
<td><input type="text" name="DonorState" value = "<%=DonorState%>"/></td>
<td><input type="text" name="DonorZip" value = "<%=DonorZip%>"/></td>
</tr>
<tr>
<th> Tax Year</th>
<th> Started Year</th>
<th> Active?</th>
<th> FID</th>
</tr>
<tr>
<td><input type="text" name="strTaxYear" value = "<%=strTaxYear%>"/></td>
<td><input type="text" name="StartedYear" value = "<%=StartedYear%>"/></td>
<td><input type="checkbox" name="Active" value="<%=Active%>"/></td>
<td><input type="text" name="FID" value ="<%=FID%>"/></td>
</tr>
<tr>
<th width="400px"> Notes</th>
</tr>
<div width="400px">
<tr width="400px" >
<td width="400px" style="word-wrap: break-word;"><input type="text" name="DonorNotes" value="<%=DonorNotes%>"/></td>
</tr>
</div>
<tr>
<input type="hidden" name="passdonorid"value = "<% =intdonor%>">
<input type="hidden" name="DonorType"value = "<% =strType%>">
<input type="hidden" name="DonorSubType"value = "<% =strSubtype%>">
</tr>
<input type="hidden" name="volid"value = "<% =strvolid%>">
<input class = "btncenter" type="submit" name = "EditDonor" value = "Update Record" bgcolor="darkblue" >
</form>
</div>
<%rsVols.Close
set rsVols = Nothing%>
</body>
</html>