AdMentor homepage

/asp/freeapps/pollmentor/admin_poll.asp

<!--#include file="incpollmentor.asp"--> <!--#include file="admin_includelogin.asp"--> <% ''''''''''' (C) Stefan Holmberg 1999 - 2006 ''''''''''' Free to use if these sourcecode lines is not deleted ''''''''''' http://www.aspcode.net Dim id Dim count1, answer1 Dim count2, answer2 Dim count3, answer3 Dim count4, answer4 Dim count5, answer5 Dim count6, answer6 Dim count7, answer7 Dim count8, answer8 count1 = Request.Form("count1") answer1 = Request.Form("answer1") count2 = Request.Form("count2") answer2 = Request.Form("answer2") count3 = Request.Form("count3") answer3 = Request.Form("answer3") count4 = Request.Form("count4") answer4 = Request.Form("answer4") count5 = Request.Form("count5") answer5 = Request.Form("answer5") count6 = Request.Form("count6") answer6 = Request.Form("answer6") count7 = Request.Form("count7") answer7 = Request.Form("answer7") count8 = Request.Form("count8") answer8 = Request.Form("answer8") Dim oConn Set oConn = PollMentor_GetDatabaseConn() Dim oRS If Request.QueryString("save")="yes" Then Set oRS = Server.CreateObject("ADODB.Recordset") Dim sID sID = Request.QueryString("id") If sID = "" Then sID = 0 Else sID = CInt( sID) End If oRS.Open "select * from " & Poll_GetTablePrefix()& "poll where id = " & sID, oConn, 1, 3 If Request.QueryString("action") = "new" Or Request.QueryString("action") ="edit" Then If Request.QueryString("action") = "new" Then oRS.AddNew oRS("createdwhen") = Now() End If If count1 = "" Then count1=0 End If oRS("count1") = count1 oRS("answer1") = answer1 If count2 = "" Then count2=0 End If oRS("count2") = count2 oRS("answer2") = answer2 If count3 = "" Then count3=0 End If oRS("count3") = count3 oRS("answer3") = answer3 If count4 = "" Then count4=0 End If oRS("count4") = count4 oRS("answer4") = answer4 If count5 = "" Then count5=0 End If oRS("count5") = count5 oRS("answer5") = answer5 If count6 = "" Then count6=0 End If oRS("count6") = count6 oRS("answer6") = answer6 If count7 = "" Then count7=0 End If oRS("count7") = count7 oRS("answer7") = answer7 If count8 = "" Then count8=0 End If oRS("count8") = count8 oRS("answer8") = answer8 oRS("question") = Request.Form("question") End If If Request.QueryString("action") = "del" Then oRS.Delete Else oRS.Update End If oRS.Close Set oRS = Nothing oConn.Close Set oConn = Nothing Response.Redirect "admin_default.asp" End If %> <html> <head> <% If Request.QueryString("action") = "edit" Then Dim oRS2 Set oRS2 = oConn.Execute( "select * from " & Poll_GetTablePrefix() & "poll where id = " & Request.QueryString("id") ) question = oRS2("question") answer1 = oRS2("answer1") count1 = oRS2("count1") answer2 = oRS2("answer2") count2 = oRS2("count2") answer3 = oRS2("answer3") count3 = oRS2("count3") answer4 = oRS2("answer4") count4 = oRS2("count4") answer5 = oRS2("answer5") count5 = oRS2("count5") answer6 = oRS2("answer6") count6 = oRS2("count6") answer7 = oRS2("answer7") count7 = oRS2("count7") answer8 = oRS2("answer8") count8 = oRS2("count8") oRS2.Close Else End If %> <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>PostcardMentor - Admin interface</title> <style type="text/css"> <!-- body { font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000} td { font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000} th { font-family: Arial, Geneva, Helvetica, Verdana; font-size: smaller; color: #000000} A:link {text-decoration: none;} A:visited {text-decoration: none;} A:hover {text-decoration: underline;} --> </style> </head> <body> <table align="center" bgColor="#ECECD9" border="0" cellPadding="3" cellSpacing="0" height="100%" width="100%"> <tbody> <tr> <td vAlign="top" width="50%" height="60"> <b><a href="http://www.aspcode.net"><font face="verdana,arial,helvetica" size="1">http://www.aspcode.net</font></a></b> </td> <td vAlign="top" width="468" height="60"> <b><font face="verdana,arial,helvetica" size="+2">Admin interface</font></b> <table border="0" width="100%"> <tr> <td width="50%"> </td> </tr> </table> </td> </tr> <tr> <td height="100%" vAlign="top" width="100%" colspan="2"> <table align="center" bgColor="#ffffff" border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%"> <tbody> <tr> <td height="100%" vAlign="top" width="85%"> <table bgColor="#ffffff" border="0" cellPadding="10" cellSpacing="0" height="100%" width="100%"> <tbody> <tr> <td align="left" height="100%" vAlign="top" width="65%"> <table border="0" width="100%"> <tr> <td width="50%"><b><font color="#aa3333" face="verdana,arial,helvetica" size="4">PollMentor <%=Session("fullname")%></font></b> </td> <td width="50%"> <%=FAQ_GetAd(1) %> </td> </tr> </table> <hr color="#000066" noShade SIZE="1"> <table border="0" width="100%"> <tr> <td width="70%"> <p align="left"><b>Question</b><br> <% Dim sURL sURL = "admin_poll.asp?save=yes&action=" & Request.QueryString("action") sURL = sURL & "&id=" & Request.QueryString("id") %> <form method="POST" action="<%=sURL%>"> <table border="1" width="100%"> <tr> <td width="29%">Text:</td> <td width="71%"><input type="text" name="question" size="40" value="<%=question%>"></td> </tr> <tr> <td width="29%">Answer 1:<br> <input type="text" name="answer1" size="20" value="<%=answer1%>"></td> <td width="71%">Nr of votes:<br> <input type="text" name="count1" size="20" value="<%=count1%>"></td> </tr> <tr> <td width="29%">Answer 2:<br> <input type="text" name="answer2" size="20" value="<%=answer2%>"></td> <td width="71%">Nr of votes:<br> <input type="text" name="count2" size="20" value="<%=count2%>"></td> </tr> <tr> <td width="29%">Answer 3:<br> <input type="text" name="answer3" size="20"