%
@Language=VBScript
@CodePage=1256
%>
<%
Response.Buffer=false
Response.CacheControl="no-cache"
CookiWritten=false
if (Request("StatID")<>"") and (Request("Doit")<>"") then
if not Response.Cookies("Stat"&Request("StatID")).HasKeys then
Response.Cookies("Stat"&Request("StatID"))("Visited")="done"
Response.Cookies("Stat"&Request("StatID")).Expires="31/12/2006"
CookiWritten=true
end if
end if
%>
الإستبيانات
<%
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Application("DBPath"))
Set StatRS=Conn.Execute("Select * from Stat")
do while not StatRS.eof
if StatRS("Active") then
if Request.Cookies("Stat"&StatRS("StatID")).HasKeys and (not CookiWritten) then
AlreadyVisited=true
else
AlreadyVisited=false
end if
if (not AlreadyVisited) and (Request("Doit")<>"") and (Int(Request("StatID"))=StatRS("StatID")) then
Conn.Execute "Update Ans Set AnsCount=AnsCount+1 Where AnsID=" & Request("Ans")
AlreadyVisited=true
end if
if (StatRS("PublishResults")) and ((AlreadyVisited) or ((Request("Doit")<>"") and (Request("StatID")=StatRS("StatID")))) then
%>
شكراً للمشاركة
<%=StatRS("Question")%>
<%
Set AnsRS=Conn.Execute("Select * from Ans Where Stat="&StatRS("StatID"))
Set TotalRS=Conn.Execute("Select Sum(AnsCount) from Ans Where Stat="&StatRS("StatID"))
do while not AnsRS.eof
%>
|
<%=AnsRS("AnsText")%>
|
<%if TotalRS(0)<>0 then%>
<%=FormatPercent(AnsRS("AnsCount")/TotalRS(0))%>
<%end if%>
|
<%
AnsRS.MoveNext
loop
%>
|
عدد المشاركين في الاستبيان :
|
<%=TotalRS(0)%>
|
|
تاريخ بدء التصويت :
|
<%=DatePart("d",StatRS("StartDate"))&"/"&DatePart("m",StatRS("StartDate"))&"/"&DatePart("yyyy",StatRS("StartDate"))%>
|
<%
elseif AlreadyVisited and (not StatRS("PublishResults")) then
%>
<%
else
%>
استبيان للرأي
<%=StatRS("Question")%>
<%
end if
end if
StatRS.MoveNext
Loop
StatRS.Close
%>