CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> Archive -> CodeCharge.Discussion

 online polling

Print topic Send  topic

Author Message
Roger
Posted: 06/28/2001, 7:34 PM

How is the poll being done at gotocode.com ?
Is it using CC?

--

Rgds
Roger Tng


CodeCharge
Posted: 07/03/2001, 11:27 AM

The Poll is done using Version 1.2 Beta and currently works only in
ASP&Templates.
If you use ASP&Templates and have version 1.2 Beta, you can copy the text
below and paste it into CodeCharge as a new form

(This is the first time we're trying this method of component sharing.
Theoretically, you should be able to copy the text between the lines below,
then click on "Paste Form" button in CodeCharge.)

Community page, Vote section:
====================
<Form Name="Vote" Type="Grid" Order="03" Table="vote_items" OrderField=""
NewLine="False" SQL="SELECT vote_items.*
FROM voting INNER JOIN vote_items ON voting.vote_id = vote_items.vote_id
WHERE (((voting.vote_active)=True)) order by vote_results desc;
" AllowInsert="False" AllowUpdate="True" AllowDelete="True"
AllowCancel="True" AllowSorting="True" InsertButtonCaption="<input
type=submit name=AddVote value=Vote>" DeleteButtonCaption="Delete"
UpdateButtonCaption="Update" CancelButtonCaption="Cancel"
SearchButtonCaption="Search" Action="" Action2="" CreateValidRules="True"
CategoryID="" CategoryName="" ParCategoryID="" UsePageScroller="False"
RecordsPerPage="" Orientation="Horizontal" Title="Vote
</font><br> <font face="verdana, tahoma, arial"
size="2" color=000000>{Caption}" Header="<form
action="VoteResults.asp">

" Footer="<center><input type=submit name=AddVote
value=Vote></br>
<a href="VoteResults.asp">[Results]</a></center>
</form>" OrderByDirection="Asc" Where="" GridType="Tabular"
UseSQL="True" UseCustomStyle="True" FormMethod="POST" ShowFirst="False"
ShowFirstCaption="" ShowPrev="True" ShowPrevCaption="" ShowNext="True"
ShowNextCaption="" ShowLast="False" ShowLastCaption="" PageNumbers="True"
NavigatorType="CurrentPageOnly" NumberOfPages="10" ShowTotalPages="False"
StyleName="" StyleType="None"><Field Type="Label" Caption=""
DataSource="vote_item_id" Name="vote_item_id" PK="False" Size=""
Required="True" LookupTable="" LookupIDField="" LookupNameField=""
LookupSQL="" LOV="" Page="" Format="Number" Rows="" MaxLength="4"
CheckedValue="1" UncheckedValue="0" DefaultValue="<input
type="radio" name=VoteItem value={vote_item_id}>" IsHTML="True"
IsPassword="False" Unique="False" URLField="" UseURLField="False"
AddTransitParams="True" JoinType="=" RadioListType="Vertical"
CustomInitialValue="False" DisplayValue="Any" SubmitValue=""
ListBoxSize="1"/><Field Type="Label" Caption="" DataSource="vote_item_name"
Name="vote_item_name" PK="False" Size="" Required="False" LookupTable=""
LookupIDField="" LookupNameField="" LookupSQL="" LOV="" Page=""
Format="Text" Rows="" MaxLength="50" CheckedValue="1" UncheckedValue="0"
DefaultValue="" IsHTML="False" IsPassword="False" Unique="False" URLField=""
UseURLField="False" AddTransitParams="True" JoinType="="
RadioListType="Vertical" CustomInitialValue="False" DisplayValue="Any"
SubmitValue="" ListBoxSize="1"/><Event Type="Open" Language="ASP">SetVar
"Caption", DLookUp("voting", "vote_desc", "vote_active=1")</Event><Event
Type="Show" Language="ASP">fldvote_item_id="<input type=""radio""
name=""VoteItem""
value="""&fldvote_item_id&""">"</Event><FormStyle
Type="PageBODY"></FormStyle><FormStyle Type="FormTABLE">background-color:
#ffffff; border-width: 0; width:150 px</FormStyle><FormStyle
Type="FormHeaderTD"></FormStyle><FormStyle
Type="FormHeaderFONT">font-family: Arial, Tahoma, Verdana, Helvetica;
font-size: 14pt; color: #000000; font-weight: bold</FormStyle><FormStyle
Type="FieldCaptionTD">background-color: #de1818</FormStyle><FormStyle
Type="FieldCaptionFONT">font-family: Verdana, Tahoma, Arial, Helvetica;
font-size: 10pt; color: #ffffff; font-weight: bold</FormStyle><FormStyle
Type="DataTD">background-color: #ffffff</FormStyle><FormStyle
Type="DataFONT">font-family: Verdana, Tahoma, Arial, Helvetica; font-size:
10pt; color: 000000</FormStyle><FormStyle Type="ColumnTD">background-color:
#de1818</FormStyle><FormStyle Type="ColumnFONT">font-family: Verdana,
Tahoma, Arial, Helvetica; font-size: 10pt; color: #ffffff; font-weight:
bold</FormStyle></Form>
====================

Vote Results, Results section:
====================
<Form Name="VoteResults" Type="Grid" Order="01" Table="vote_items"
OrderField="" NewLine="False" SQL="SELECT vote_items.*
FROM voting INNER JOIN vote_items ON voting.vote_id = vote_items.vote_id
" AllowInsert="False" AllowUpdate="True" AllowDelete="True"
AllowCancel="True" AllowSorting="True" InsertButtonCaption="<input
type=submit name=AddVote value=Vote>" DeleteButtonCaption="Delete"
UpdateButtonCaption="Update" CancelButtonCaption="Cancel"
SearchButtonCaption="Search" Action="" Action2="" CreateValidRules="True"
CategoryID="" CategoryName="" ParCategoryID="" UsePageScroller="False"
RecordsPerPage="" Orientation="Horizontal" Title="Poll Results
</font><br> <font face="verdana, tahoma, arial"
size="2" color=000000>{Caption}" Header="" Footer=""
OrderByDirection="Asc" Where="" GridType="Tabular" UseSQL="True"
UseCustomStyle="False" FormMethod="POST" ShowFirst="False"
ShowFirstCaption="" ShowPrev="True" ShowPrevCaption="" ShowNext="True"
ShowNextCaption="" ShowLast="False" ShowLastCaption="" PageNumbers="True"
NavigatorType="CurrentPageOnly" NumberOfPages="10"
ShowTotalPages="False"><Field Type="Hidden" Caption=""
DataSource="vote_item_id" Name="vote_item_id" PK="True" Size=""
Required="True" LookupTable="" LookupIDField="" LookupNameField=""
LookupSQL="" LOV="" Page="" Format="Number" Rows="" MaxLength="4"
CheckedValue="1" UncheckedValue="0" DefaultValue="<input
type="radio" name=VoteItem value={vote_item_id}>" IsHTML="True"
IsPassword="False" Unique="False" URLField="" UseURLField="False"
AddTransitParams="True" JoinType="=" RadioListType="Vertical"
CustomInitialValue="False" DisplayValue="Any" SubmitValue=""
ListBoxSize="1"/><Field Type="Label" Caption="" DataSource="vote_item_name"
Name="vote_item_name" PK="False" Size="" Required="False" LookupTable=""
LookupIDField="" LookupNameField="" LookupSQL="" LOV="" Page=""
Format="Text" Rows="" MaxLength="50" CheckedValue="1" UncheckedValue="0"
DefaultValue="" IsHTML="False" IsPassword="False" Unique="False" URLField=""
UseURLField="False" AddTransitParams="True" JoinType="="
RadioListType="Vertical" CustomInitialValue="False" DisplayValue="Any"
SubmitValue="" ListBoxSize="1"/><Field Type="Label" Caption=""
DataSource="vote_results" Name="vote_results" PK="False" Size=""
Required="False" LookupTable="" LookupIDField="" LookupNameField=""
LookupSQL="" LOV="" Page="" Format="Number" Rows="" MaxLength="50"
CheckedValue="1" UncheckedValue="0" DefaultValue="" IsHTML="True"
IsPassword="False" Unique="False" URLField="" UseURLField="False"
AddTransitParams="True" JoinType="=" RadioListType="Vertical"
CustomInitialValue="False" DisplayValue="Any" SubmitValue=""
ListBoxSize="1"/><Event Type="Open" Language="ASP">voteaction =
GetParam("AddVote")
if IsEmpty(GetParam("VoteItem")) then vote_id = DLookUp("voting", "vote_id",
"vote_active=1")
if not IsEmpty(GetParam("vote_id")) then vote_id = GetParam("vote_id")
if voteaction="Vote" then
if not IsEmpty(GetParam("VoteItem")) then
if DLookUp("vote_items", "count(vote_item_id)", "vote_item_id=" &
GetParam("VoteItem")) > 0 then
vote_id = DLookUp("vote_items", "vote_id",
"vote_item_id="& GetParam("VoteItem"))
If IsEmpty(Session("UserId")) then
UserID=0
else
UserID=Session("UserId")
end if

If cn.execute("SELECT count(*) FROM users_votes WHERE
vote_id="&vote_id&" AND ((user_id=" & UserID & " and
user_id<>0) or IP='" &
Request.ServerVariables("REMOTE_ADDR")&"')").fields.item(0)=0 then
update_voite_items_sql = "update vote_items set
vote_results=vote_results+1 where vote_item_id=" &
ToSQL(GetParam("VoteItem"),"Number")
cn.execute update_voite_items_sql
insert_users_votes = "insert into users_votes (user_id, item_id,
vote_id,IP) values (" & UserID & "," &
ToSQL(GetParam("VoteItem"),"Number") & "," & vote_id &
",'"&Request.ServerVariables("REMOTE_ADDR")&"')"
cn.execute insert_users_votes
else
AlredyVote=True
end if
end if
end if
end if
TotalVoices=Dlookup("vote_items", "sum(vote_results)",
"vote_id="&vote_id)
sWhere=" where voting.vote_id="&vote_id
if alredyvote then
SetVar "Caption", "<font color=red>Sorry, but you can't vote
twice</font><br>"&DLookUp("voting", "vote_desc",
"vote_id="&vote_id)
else
SetVar "Caption", DLookUp("voting", "vote_desc", "vote_id="&vote_id)
end if</Event><Event Type="Show" Language="ASP">If TotalVoices<>0 then
Percent=Round((fldvote_results/TotalVoices)*100,1)
else
Percent=0
end if
fldvote_results="<img src=images/bar.gif width="&Int(Percent)&"
height=10>&nbsp"&Percent&"%&nbsp("&fldvote_results&am
p;")"</Event></Form>
====================




"Roger" <roger@web4sme.net> wrote in message
news:9hgpf7$fpf$1@news.codecharge.com...
> How is the poll being done at gotocode.com ?
> Is it using CC?
>
> --
>
> Rgds
> Roger Tng
>
>
>


   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.