[-*Smarty*-]
[-config_load file="default.conf"-]
[-*Load the Language Definitions*-]
[-config_load file="lang.$USER_LANG"-]

[-* we want to include out stylesheet for this view*-]
[-fetch file="$TPL_STYLE_PATH/week.css" assign="css"-]
[-eval var=$css-]

[-if $PRINT_VIEW != 1-]
[-*Main Navigation*-]
[-include file="$TPL_NAME/views/global/navigation.html"-]
[-/if-]

<table width="100%" border="0" cellpadding="5" cellspacing="0" class="weekheader">
    <tr>
        <td nowrap width="100%" align="center" valign="middle" class="weekheader">
      <a href="[-$PREV_WEEK_URL-]">Previous Week &lt;</a>
          [-pc_week_range date=$DATE sep=" - " format=#_PC_DATE_FORMAT_MDY#-]
      <a href="[-$NEXT_WEEK_URL-]">&gt; Next Week</a>
    [-if $PRINT_VIEW != 1-]
    <td nowrap align="right" valign="top" class="weekheader">
      [-pc_view_select label=#_PC_TPL_VIEW_LABEL# class=""-]
    </td>
    [-/if-]
  </tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="calcontainer"><tr><td>
  [-* Loop through the EventsByDate array : This array contains data for each day in the view. *-]
  [-pc_sort_events var="S_EVENTS" sort="category" order="asc" value=$A_EVENTS-]
  [-foreach name=dates item=events key=cdate from=$S_EVENTS-]
      [-assign var="dayname" value=$cdate|date_format:"%w"-]
      [-assign var="day" value=$cdate|date_format:"%d"|string_format:"%1d"-]
      [-assign var="month" value=$cdate|date_format:"%m"|string_format:"%1d"-]
      [-assign var="month" value=$month-1-]
      [-assign var="year" value=$cdate|date_format:"%Y"|string_format:"%4d"-]
    <table width="100%" border="0" cellpadding="5" cellspacing="0" class="dayheader">
          <tr>
            <td width="100%" class="dayheader">
                <a href="[-pc_url action=day date=$cdate-]">
          [-if $USE_INT_DATES eq true-]
            [-pc_date_format date=$cdate format=#_PC_DATE_FORMAT_INT#-]
          [-else-]
            [-pc_date_format date=$cdate format=#_PC_DATE_FORMAT_STD#-]
          [-/if-]
          </a>
              </td>
          </tr>
      </table>



    [-* Loop through the events for this day and display the event data *-]
    [-assign var="oldCat" value=""-]
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="eventslist">
      <tr>
        <td class="eventslist" width="100%">
            [-assign var="oldCat" value="xxx"-]


              [-assign var="oldCat" value="xxx"-]
              [-foreach name=events item=event from=$S_EVENTS.$cdate-]
                [-assign var="count" value=$count+1-]
                [-assign var="cCat" value=$event.catname-]
                [-if $oldCat != $cCat-]
                  [-if $smarty.foreach.events.first != true-]
                    </table> <!-- end [-$oldCat-] -->
                     </div>
                  [-/if-]
                  <div style="height: 20px; font-size:14px; padding: 3px 0px 0px 9px; background-color: [-$event.catcolor-];">
                    <div style="float: left;"><b>[-$event.catname-]</b></div><div style="float: right;">[-pc_date_format date=$cdate format=#_PC_DATE_FORMAT_STD#-]&nbsp;&nbsp;</div>
                  </div>
                  <div style="padding: 2px; border:solid 5px [-$event.catcolor-]; margin-bottom: 5px;">
                  <table border="0" cellpadding="0" cellspacing="0" class="eventdetails">  <!-- begin [-$cCat-] -->

<tr>
  <th style="width: 120px;">Name</th>
  <th style="width: 50px;">When</th>
  <th style="width: 190px;">Where</th>
  <th style="width: 360px;">Description</th>
</tr>

                  [-assign var="count" value=0-]
                [-/if-]

                [-if $24HOUR_TIME-]
                  [-assign var="timestamp" value=$event.startTime|date_format:#_PC_TIME_FORMAT_24#-]
                [-else-]
                  [-assign var="timestamp" value=$event.startTime|date_format:#_PC_TIME_FORMAT_12#-]
                [-/if-]

                [-if $count % 2 == 0-]
              <tr class="hilite1">
                [-else-]
              <tr class="hilite2">
                [-/if-]

              <td style="width: 120px;">
                <b>
[-*                [-$event.title|strip_tags-] *-]
                [-$event.title-]
                </b>
              </td>

              <td style="width: 50px;">
                [-if $event.alldayevent == 0-]
                    [-$timestamp-]
                [-elseif $event.alldayevent == 1-]
                    All day event
                [-else-]
                    &nbsp;
                [-/if-]
              </td>


              <td style="width: 190px;">
              [-if $event.location != '' || $event.street1 != '' || $event.street2 != '' || $event.city != '' || $event.state != '' || $event.postal != ''-]
                <p><b>[-#_PC_LOCATION#-]:</b><br />
                [-if $event.location != ''-]
                    [-$event.location-]<br />
                [-/if-]
                [-if $event.street1 != ''-]
                    [-$event.street1-]<br />
                [-/if-]
                [-if $event.street2 != ''-]
                    [-$event.street2-]<br />
                [-/if-]
                [-if $event.city != ''-]
                    [-$event.city-]
                [-/if-]
                [-if $event.state != ''-]
                    [-$event.state-]
                [-/if-]
                [-if $event.postal != ''-]
                    [-$event.postal-]
                [-/if-]

                <br />[-$event.google_maps_link-]
                </p>
              [-/if-]

              [-if $event.contname != '' || $event.conttel != '' || $event.contemail != '' || $event.website != ''-]
                <p><b>[-#_PC_CONTACT#-]:</b><br />
                [-if $event.contname-]
                    [-$event.contname-]<br />
                [-/if-]
                [-if $event.conttel-]
                    [-$event.conttel-]<br />
                [-/if-]
                [-if $event.contemail-]
                    <a href="mailto:[-$event.contemail-]">[-$event.contemail-]</a><br />
                [-/if-]
                [-if $event.website-]
                    <a href="[-$event.website-]" target="_blank">[-$event.website_display-]</a><br />
                [-/if-]
                </p>
              [-/if-]

              </td>

              <td style="width: 360px;">
                [-$event.hometext-]

                [-if $event.fee != ''-]
                  <br /><b>Fee:</b> [-$event.fee-]
                [-/if-]
              </td>

              </tr>

                [-assign var="oldCat" value=$event.catname-]
                [-if $smarty.foreach.events.last-]
                  [-* we need to close out the <div> tag *-]
              </table>
              </div>
                [-/if-]
              [-foreachelse-]
                  <center><b>[-#_PC_NO_EVENTS#-]</b></center>
              [-/foreach-]


        </td>
      </tr>
    </table>
  [-/foreach-]
</td></tr></table>
[-if $PRINT_VIEW != 1-]
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr>
        <td align="right">
            <a href="[-pc_url action="week" print="true"-]">[-#_PC_THEME_PRINT#-]</a>
        </td>
    </tr>
</table>
[-/if-]
[-*footer*-]
[-include file="$TPL_NAME/views/global/footer.html"-]
