<html dir="rtl">
<head>
<title>תוצאות הסקר</title>
<link rel="stylesheet" type="text/css" href="styles.css"><meta http-equiv="content-type" content="text/html;charset=windows-1255" />
<meta name="verify-v1" content="BnfsFfYT6nNW4AcnOhWGZAgtpjcsVw51ehnhYAKW5Lc=" />
</head>
<body background="back.gif">
<center>
<%
num_vote=Request.Form("opt")
ip_address= Request.ServerVariables("REMOTE_ADDR")
%>
<!--מאפס אפלקציות-->
<% For i=1 TO 4 %>
<% Application("Voting" & i)=0 %>
<% Next %>
<!--מתחבר למסד ובודק אם האייפי קיים-->
<%
Set oConn = Server.CreateObject("ADODB.Connection")
oConn.Open "Driver={Microsoft Access Driver (*.mdb)};" & _
"Dbq= D:\content\users1\aviad\db\seker.mdb;" & _
"Uid=admin;" & _
"Pwd=;"
Set tableRs=Server.CreateObject("ADODB.Recordset")
check_ip_table= "Select * From table1 WHERE ip=('" & ip_address & "')"
tableRs.Open check_ip_table, oConn,3,3
%>
<% found_ip=true %>
<!--אם האייפי לא קיים במסד בצע-->
<% IF tableRs.EOF Then %>
<%
Insert_SQL="Insert Into table1(ip,num) values('" & ip_address & "','" & num_vote & "')"
oConn.Execute(Insert_SQL)
found_ip=false
%>
<% End IF %>
<% tableRs.Close %>
<!--בונה טבלה ווירטואלית שם בה את ההצבעות ואז מכניס באפלקציה המתאימה-->
<% Set tableRs=Server.CreateObject("ADODB.Recordset") %>
<% For j=1 TO 4 %>
<%
Check_Votes="Select * From table1 WHERE num=('" & j & "')"
tableRs.Open Check_Votes, oConn,3,3
%>
<% mone=tableRs.RecordCount %>
<% Application("Voting" & j)=mone %>
<% tableRs.Close %>
<% Next %>
<%
oConn.Close
Set oConn= nothing
Set tableRs= nothing
%>
<table>
<tr>
<td>
<font size="5">
<u>
תוצאות הסקר:
</u>
</font>
</td>
</tr>
<tr>
<td>
אפשרות א:
<br>
<img src="voting.gif" width="<%= Application("Voting1")*10 %>">
</td>
</tr>
<tr>
<td>
אפשרות ב:
<br>
<img src="voting.gif" width="<%= Application("Voting2")*10 %>">
</td>
</tr>
<tr>
<td>
אפשרות ג:
<br>
<img src="voting.gif" width="<%= Application("Voting3")*10 %>">
</td>
</tr>
<tr>
<td>
אפשרות ד:
<br>
<img src="voting.gif" width="<%= Application("Voting4")*10 %>">
</td>
</tr>
</table>
<% IF found_ip=true Then %>
<br>
<font color="red"> <b> הצבעת בסקר זה, אינך יכול להצביע שנית. </b> </font>
<% End IF %>
</center>
</body>
</html>