;
$EVENTS = $DAY->{events};
$total_events=0; %><!-- BEGIN DATE GATHERING -->
<% FOREACH EVENTLIST%>
<% FOREACH EVENT%>
<% $titlearray=$EVENT->{'details'}->{'title'};
$montharray='month'.$EVENT->{'details'}->{'title'};
# print 'COUNTRY READS: '.$EVENT->{'details'}->{'country'}.'<BR>';
$thismonth=$DAY->{'monthabbreviation'};
push(@$montharray,$thismonth);
push(@$titlearray,$DAY->{'dd'}); %>
<%/FOREACH%>
<%/FOREACH%>
<!-- END DATE GATHERING -->
<div id="showsContainer">
<%FOREACH EVENTLIST%>
<%IF EVENTS EXIST%>
<% if ($total_events < $maxevents) { %>
<%FOREACH EVENT%>
<%$flag=0;%>
<%$titlearray=$EVENT->{'details'}->{'title'};%>
<%$montharray='month'.$EVENT->{'details'}->{'title'};%>
<%foreach $dupetest(@titleevent) {%>
<%if ($EVENT->{'details'}->{'title'} eq $dupetest) {
$flag=1;
}%>
<%};%>
<% $eventcountry=lc($EVENT->{'details'}->{'country'}); %>
<%if ($searchcountry eq "$eventcountry") {%>
<% $eventstate=lc($EVENT->{'details'}->{'state'}); %>
<%if ( ($searchstate eq "") or ($searchstate =~ m/$eventstate/ ) ) {%>
<%if ($flag eq 0) {%>
<%$total_events++;%>
<% $firstdate = shift(@$titlearray);
$lastdate = pop(@$titlearray);
$firstmonth = shift(@$montharray);
$lastmonth = pop(@$montharray);
$firstdow=$DAY->{dayabbreviation};
%>
<div class="date"><%=$firstmonth%>, <%=$firstdate%><% if ($lastdate) { %>~<%if
($firstmonth ne $lastmonth) {%><%=$lastmonth;%><%};%><%=$lastdate;%><%};%></div>
<!-- <div class="time"> @ <%=(($hour > 12)?$hour-12:$hour)%>:<% print sprintf("%02d",$minute); %> <%=(($hour > 11)?"PM":"AM")%> - </div> -->
<div class="location"><%= EVENT FIELD(location) %></div>
<div class="info"> <%= EVENT FIELD(description) %></div><br />
<%push(@titleevent,$EVENT->{'details'}->{'title'});%>
<%}%>
<%}%>
<%}%>
<%/FOREACH%>
<%} %>
<%/IF%>
<%/FOREACH%>
</div>
<%if ($total_events) {%>
<p align="left" style="padding-left:10px; margin-top: 20px; margin-bottom: 0">Total Shows: <%=$total_events%><BR>
<%} else {%><I>No Shows Scheduled</I><%}%>
<p></p>
<a target="_blank"
href="<%=$AdminConfig->get("calendar_url")%>?calendar=<%=$Calendar%>"><div class="location"><u>go to the Man Alive Calendar</u></div></a>