Created
September 3, 2013 22:35
-
-
Save whyisjake/6430530 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<csinclude record="cs_lay/93" field="pre" current="comm" page="faire" faire="ba11" nav="bayarea/2011" show_sponsors="y" newsletter="yes"/> | |
<csif cond="{cs.cgi.x-date}" eq="2011-05-22"> | |
<h2>Maker Faire Bay Area 2011 At-a-Glance Sunday May 22, 2011</h2> | |
<p><strong>View </strong> | |
<a href="http://makerfaire.com/bayarea/2011/schedule/grid.csp">Saturday</a> | |
| | |
Sunday | |
<cselse> | |
<h2>Maker Faire Bay Area 2011 At-a-Glance Saturday May 21, 2011</h2> | |
<p><strong>View </strong> | |
Saturday | |
| | |
<a href="http://makerfaire.com/bayarea/2011/schedule/grid.csp?x-date=2011-05-22">Sunday</a> | |
</csif> | | |
<a href="http://makerfaire.com/bayarea/2011/MF11_StageSchedule.pdf">Printable PDF</a></p> | |
<table border="1"> | |
<tr><td></td> | |
<td> Center Stage</td> | |
<td> Innovation Stage </td> | |
<td> Make: Live Stage</td> | |
<td> Craft Demo Stage</td> | |
<td> Maker Square</td> | |
<td> Homegrown Village </td> | |
<td> Health 2.0 Stage</td> | |
<td> Pedal Powered Stage</td> | |
<td> Tesla Stage</td> | |
<td> Coke Zero and Mentos Stage</td> | |
<td> Lifesize Mousetrap </td> | |
<td> Craft Booth Hands-On</td> | |
<td> Young Makers </td></tr> | |
<csperl> | |
my $db = $cfg->{_db}; | |
my $debug = $cgi->param('debug'); | |
my $dbh = $cfg->dbhandle; | |
my $day = $cgi->param('x-date') || '2011-05-21'; | |
my $sql = qq~select distinct slot.time_start from slot,e,e_slot_l,loc where date = '$day' and ( (e.cs_rid = e_slot_l.e_id AND slot.cs_rid = e_slot_l.slot_id) AND (e.status <> 'proposed' and e.status <> 'rejected') AND (loc.id_event LIKE '%[2590]%' and slot.id_event = 2590) ) group by e.cs_rid order by slot.date,slot.time_start~; | |
my $cmd = $dbh->prepare( $sql ); | |
$cmd->execute; | |
my $date = ""; | |
my $time = ""; | |
my @LOCS = (171,172,240,174,175,176,244,142,183,181,150,241,178); | |
while ( my $data = $cmd->fetchrow_hashref() ) { | |
my %DATA = %{$data}; | |
my $time = $db->time_format($DATA{'time_start'},'%l:%i%p'); | |
print "<tr><td>$time</td>"; | |
foreach my $loc_id (@LOCS) { | |
my $rec = new CS::Record( cfg => $cfg, table => 'slot', where => "id_event = 2590 AND id_loc = $loc_id and time_start = '$DATA{time_start}' and date = '$day' " ); | |
if ($rec->{ARGS}->{'cs_rid'}) { | |
my $l = new CS::Links ( cfg => $cfg, table => 'e', record => $rec ); | |
my $e_rec = $l->firstRecord; | |
if ($e_rec->{ARGS}->{'cs_rid'}) { | |
#print qq~<td>$e_rec->{ARGS}->{'name'} $e_rec->{ARGS}->{'cs_rid'}</td>\n~; | |
print "<td>"; | |
print qq~<a href="/cs/admin/view/slot/$rec->{ARGS}->{'cs_rid'}">slot/$rec->{ARGS}->{'cs_rid'}</a><br />\n~ if $debug; | |
print qq~<a href="/cs/admin/view/e/$e_rec->{ARGS}->{'cs_rid'}">e/$e_rec->{ARGS}->{'cs_rid'}</a><br />\n~ if $debug; | |
my $p = new CS::Parse( cfg => $cfg, path => "e/$e_rec->{ARGS}->{'cs_rid'}", buffered => 1 ); | |
print $p->parse_template( "e/web_schedule.view" ); | |
my $pstart = $rec->{ARGS}->{'time_start'}; | |
$pstart = $db->time_format("$pstart",'%l%p'); | |
my $pend = $db->time_format($rec->{ARGS}->{'time_end'},'%l%p'); | |
if ($loc_id eq 178 | $loc_id eq 241) { | |
print qq~($pstart - $pend)~ if $pstart ne $pend; | |
} | |
print "</td>"; | |
} else { | |
print "<td> </td>"; | |
} | |
} else { | |
print "<td> </td>"; | |
} | |
} | |
print qq~</tr>~; | |
} | |
</csperl> | |
</table> | |
<!-- End the new stuff --> | |
<br clear="all" /> | |
<csinclude record="cs_lay/93" field="post" current="comm" page="faire" faire="ba11" nav="bayarea/2011" show_sponsors="y" newsletter="yes" /> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment