home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet 1996 World Exposition
/
park.org.s3.amazonaws.com.7z
/
park.org.s3.amazonaws.com
/
cgi-bin
/
Japan
/
Theme.0105
/
waiting.cgi
< prev
Wrap
Text File
|
2017-09-21
|
5KB
|
224 lines
#!/usr/local/bin/perl5
$| = 1;
# script for meeting room
# jrh
$CgiPath = '/stage/htdocs/cgi-bin/Japan/Theme';
push(@INC, "$CgiPath");
require 'jcode.pl'; # tends to be in /usr/local/lib/perl
require 'read-form.pl'; # tends to be in your cgi path
require 'meetinit.pl';
require 'frames.pl';
$ThisFile = '/stage/htdocs/cgi-bin/Japan/Theme/entry.cgi';
# print "Content-type: text/html\n\n";
&read_in_data;
&init_dbm;
&check_open;
&print_html;
&close_dbm;
#########################################################################
sub read_in_data {
# read in submitted form data contents into the hash %FormDataHash
&ReadInFormData(\%FormDataHash);
foreach $Key (keys(%FormDataHash)) {
# print "//$Key:$FormDataHash{$Key}//\n";
}
$ParkName = $FormDataHash{'park'};
# print "$FormDataHash{'gif'}\n";
# print "$UserName\n";
}
sub init_dbm {
$LastPath = "$ThemePath/$ParkName/park/dbm/$LastAccess";
$UserPath = "$ThemePath/$ParkName/park/dbm/$UserAccess";
$EntryPath = "$ThemePath/$ParkName/park/dbm/$EntryTime";
$GifPath = "$ThemePath/$ParkName/park/dbm/$GifNumber";
dbmopen(%LastAccessToPage,$LastPath,0666);
dbmopen(%UserAccessToPage,$UserPath,0666);
dbmopen(%EntryToPage,$EntryPath,0666);
dbmopen(%GifToPage,$GifPath,0666);
}
sub check_open {
# Set Up Constant factors
$ExpireTime = time - $ExpiryTime;
$WhileNo = $FrameNo + 1;
$Key = 1;
# Clean out expired frames
while ($Key < $WhileNo) {
if ($LastAccessToPage{$Key} > 0) {
if ($LastAccessToPage{$Key} < $ExpireTime) {
$CleanKey = $Key;
$UserAccessToPage{$Key} = "vacant";
$LastAccessToPage{$Key} = 0;
$GifToPage{$Key} = "$ThemeSite$ThemeURL/$ParkName/park/image/vacancy.gif";
&clean_frame;
}
}
$Key++;
}
$Key = 1;
while ($Key < $WhileNo) {
$Users[$Key] = $UserAccessToPage{$Key};
$Last[$Key] = $LastAccessToPage{$Key};
$Entry[$Key] = $EntryToPage{$Key};
if ($Last[$Key] == 0) {
$Entry[$Key] = 'soon';
}
else {
$Entry[$Key] = gmtime($Entry[$Key]);
$Entry[$Key] = "$Entry[$Key] GMT";
}
$Gif[$Key] = $GifToPage{$Key};
$Key++;
}
# Check for open frames
$Open = 0;
$Key = 1;
while ($Key < $WhileNo) {
if ($LastAccessToPage{$Key} == 0) {
$Open++;
$LastKey = $Key;
}
$Key++;
}
}
sub print_html {
select(STDOUT);
# tell the server that we're sending data back now
print "Content-type: text/html\n\n";
# now send the server some html stuff
print '
<html>
<head>
<META HTTP-EQUIV=REFRESH CONTENT=25; URL=waiting.cgi">
<title>pocket park waiting</title></head>
<basefont size="3">
<body bgcolor="#ffffff">
<br>
<center>
<table width="95%" cellpadding="0" cellspacing="0">
<tr>';
if ($Open == 0) {
print '<td align="center"><font size="5">All seats full!</font></td>';
}
else {
print "<td align=\"center\"><font size=\"5\">$Open seat(s) free!</font></td>";
}
print '
</tr>
</table>';
print "<form action=\"$ThemeCgi/entry.cgi\" method=\"POST\">";
print '<table><tr valign="top">';
print "<td><input type=\"radio\" name=\"gif\" value=\"face1.gif\"></td><td><img src=\"$ThemeURL/$ParkName/park/image/face1.gif\"></td>";
print "<td><input type=\"radio\" name=\"gif\" value=\"face2.gif\"></td><td><img src=\"$ThemeURL/$ParkName/park/image/face2.gif\"></td>";
print "<td><input type=\"radio\" name=\"gif\" value=\"face3.gif\"></td><td><img src=\"$ThemeURL/$ParkName/park/image/face3.gif\"></td>";
print "<td><input type=\"radio\" name=\"gif\" value=\"face4.gif\"></td><td><img src=\"$ThemeURL/$ParkName/park/image/face4.gif\"></td>";
print "<td><input type=\"radio\" name=\"gif\" value=\"face5.gif\"></td><td><img src=\"$ThemeURL/$ParkName/park/image/face5.gif\"></td>";
print "<td><input type=\"radio\" name=\"gif\" value=\"face6.gif\"></td><td><img src=\"$ThemeURL/$ParkName/park/image/face6.gif\"></td>";
print '
</tr></table>
<br>
You can also use your own URL for a picture.<BR>
<INPUT TYPE="TEXT" NAME="urlgif" SIZE=40 VALUE="http://"><BR>
Please select your face. Then....
<input type="submit" value="Enter!">';
print "<input type=\"hidden\" name=\"park\" value=\"$ParkName\">";
print '
</form>
<table border width="90%" cellpadding="2" cellspacing="2">';
print "<tr><td align=\"center\"><img src=\"$Gif[6]\" width=60 height=60></td>";
print "<td>$Users[6]</td>";
print "<td>$Entry[6]</td></tr>";
print "<tr><td align=\"center\"><img src=\"$Gif[5]\" width=60 height=60></td>";
print "<td>$Users[5]</td>";
print "<td>$Entry[5]</td></tr>";
print "<tr><td align=\"center\"><img src=\"$Gif[4]\" width=60 height=60></td>";
print "<td>$Users[4]</td>";
print "<td>$Entry[4]</td></tr>";
print "<tr><td align=\"center\"><img src=\"$Gif[3]\" width=60 height=60></td>";
print "<td>$Users[3]</td>";
print "<td>$Entry[3]</td></tr>";
print "<tr><td align=\"center\"><img src=\"$Gif[2]\" width=60 height=60></td>";
print "<td>$Users[2]</td>";
print "<td>$Entry[2]</td></tr>";
print "<tr><td align=\"center\"><img src=\"$Gif[1]\" width=60 height=60></td>";
print "<td>$Users[1]</td>";
print "<td>$Entry[1]</td></tr>";
print '</table>
</body>
<hr>
<adress><center>
theme pavilion sensorium@IWE\'96 JAPAN
</center></adress>
</html>';
}
sub close_dbm {
dbmclose(%LastAccessToPage);
dbmclose(%UserAccessToPage);
dbmclose(%EntryToPage);
}