Re: RSVP script anyone ???
| From: | Richard Lynch | Date: | Mon, 25 Jun 2001 07:03:51 +0000 |
| Subject: | Re: RSVP script anyone ??? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-55113@lists.php.net to get a copy of this message | ||
Here's an RSVP script we use at http://uncommonground.com for our annual
Jeff Buckley birthday party tribute party every November 17th. :-)
It's PostgreSQL, and bound to have some crap you don't want, and missing
features you do want, but it's a start.
We found that there were people who called/emailed or even trust US Postal
anyway, so we had to integrate things by hand, and unless you plan on
getting married a lot :-), it's easier to do it once by hand than code up a
whole admin interface for you to add people to the online respondents...
Even if you're building a wedding-registry service portal site thingie,
you'll probably find that you'll have happier customers if you just email
them each RSVP and let them do their "real" RSVP off-line by hand.
PS Any Buckley fans should RSVP as early as possible. It pretty much sells
out the day we announce it. :-)
---- rsvp.sql -----
create sequence rsvpid;
create table rsvp(
id int4 default nextval('rsvpid'),
coming int2,
publiccoming int2,
publicname int2,
publicemail int2,
publiccomments int2,
name text,
email text,
comments text
);
create unique index rsvpidindex on rsvp(id);
--------------------
---- rsvp.htm ------
<?php
function font($size = 3){
return "<FONT FACE=Palatino,Arial SIZE=$size>";
}
?>
<HTML>
<HEAD><TITLE>RSVP - Buckley Birthday Bash</TITLE></HEAD>
<BODY BGCOLOR=FFFFFF LINK=663300 VLINK=663300 TEXT=663300 ALINK=663300>
<CENTER><B>
<?php font(6)?>RSVP - <A HREF=index.htm>Buckley Birthday
Bash</A></FONT><BR>
<?php font(2)?><A HREF="#rsvp">RSVP Here!</A></FONT>
</B></CENTER>
<?php
require 'connect.inc';
if (!$connection){
die('RSVP System Offline</FONT></BODY></HTML>');
}
if (isset($rsvp)){
$query = 'insert into rsvp (coming, publiccoming, publicname,
publicemail, publiccomments, name, email, comments) ';
$query .= 'values(' . (isset($coming) ? 1 : 0);
$query .= ', ' . (isset($publiccoming) ? 1 : 0);
$query .= ', ' . (isset($publicname) ? 1 : 0);
$query .= ', ' . (isset($publicemail) ? 1 : 0);
$query .= ', ' . (isset($publiccomments) ? 1 : 0);
$query .= ", '$name', '$email', '$comments')";
file://echo $query . "<BR>\n";
$insert = pg_exec($connection, $query) or die('RSVP System
Offline</FONT></BODY></HTML>');
mail('loudcoffee@aol.com', 'RSVP - Buckley Birthday Bash',
"$name\n$email\nis " . (isset($coming) ? '' : 'NOT ') .
"coming\n$comments",
"From: $email\nReply-To: $email");
if (isset($subscribe)){
mail('ugfans-request@uncommonground.com', 'subscribe',
'subscribe',
"From: $email\nReply-To: $email");
}
}
$query = 'select name, email, comments, coming, publiccoming, publicname,
publicemail, publiccomments from rsvp order by coming desc, name';
$rsvp = pg_exec($connection, $query) or die('RSVP System
Offline</FONT></BODY></HTML>');
$rsvpcount = 0;
$comingcount = 0;
$privatecomingcount = 0;
$notcomingseparatorprinted = 0;
echo "<CENTER><TABLE CELLPADDING=5>\n";
echo " <TR><TD>" . font() .
"<B>Name</B></FONT></TD><TD>" . font() .
"<B>Email</B></FONT></TD><TD>" . font() .
"<B>Comments</B></TD></TR>\n";
while (list($name, $email, $comments, $coming, $publiccoming,
$publicname, $publicemail, $publiccomments) = @pg_fetch_row($rsvp,
$rsvpcount++)){
if (!$coming && !$notcomingseparatorprinted){
echo " <TR VALIGN=TOP><TD COLSPAN=3 ALIGN=CENTER><HR>" . font() .
"<I>Unable To Attend</I></TD></TR>\n";
$notcomingseparatorprinted = 1;
}
if ($publiccoming){
echo " <TR VALIGN=TOP>\n";
echo " <TD>" . font() . ($publicname ? $name : '') .
"</FONT></TD>\n";
echo " <TD>" . font() . ($publicemail ? $email : '') .
"</FONT></TD>\n";
echo " <TD>" . font() . ($publiccomments ? $comments : '') .
"</FONT></TD>\n";
echo " </TR>\n";
}
else{
if ($coming){
$privatecomingcount++;
}
}
if ($coming){
$comingcount++;
}
}
if ($privatecomingcount){
echo " <TR><TD COLSPAN=3 ALIGN=CENTER><HR><I>" . font() .
"And
$privatecomingcount more!</FONT></I></TD></TR>\n";
}
echo " <TR><TD COLSPAN=3 ALIGN=CENTER><HR><I>" . font() .
"$comingcount
attendees and counting!</FONT>" . font(2) . "<BR>This count does not reflect
RSVPs of multiple people in one -- Fear not, the humans will look out for
you.</FONT></I></TD></TR>\n";
echo "</TABLE></CENTER>\n";
?>
<A NAME=rsvp>
<FORM ACTION=rsvp.htm METHOD=POST>
<CENTER><TABLE BORDER=1>
<TR>
<TD COLSPAN=3><?php echo font();?><I>
<P>
Due to the overwhelming amount of <A HREF=rsvp.htm>RSVP's</A> we have
received, we will no longer be taking them via the website.
All admittance after RSVP's have been let in, will be on a first
come, first served basis. Any other questions can be directed to
Uncommon Ground @ 773.929.0415
</P>
Thank You, Uncommon Ground<BR>
Feel Free To Sign Our <A HREF=../guestbook.htm>Guestbook</A> For
General Comments<BR>
You wish to join our <A
HREF=mailto:ugfans-request@uncommonground.com?subject=subscribe>Mailing
List</A> by sending an email:<BR>
To: ugfans-request@uncommonground.com<BR>
Subject: Subscribe
</I></FONT></TD>
</TR>
</TABLE></CENTER>
</FORM>
<?php include('../toolbar.htm');?>
</BODY>
</HTML>
<?php exit;?>
------------------------
--
WARNING richard@zend.com address is an endangered species -- Use
ceo@l-i-e.com
Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm