<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "/var/www/vhosts/actionmc.com.au/httpdocs/cmsAdmin/lib/viewer_functions.php";

  list($google_analyticsRecords, $google_analyticsMetaData) = getRecords(array(
    'tableName'   => 'google_analytics',
    'where'       => whereRecordNumberInUrl(1),
    'loadUploads' => '0',
    'limit'       => '1',
  ));
  $google_analyticsRecord = @$google_analyticsRecords[0]; // get first record
  
  list($pre_owned_bikes_logosRecords, $pre_owned_bikes_logosMetaData) = getRecords(array(
    'tableName'   => 'pre_owned_bikes_logos',
    'allowSearch' => '0',
  ));
  
   list($weekly_specialsRecords, $weekly_specialsMetaData) = getRecords(array(
    'tableName'   => 'weekly_specials',
    'limit'       => '1',
    'allowSearch' => '0',
  ));
   
   list($store_locationsRecords, $store_locationsMetaData) = getRecords(array(
    'tableName'   => 'store_locations',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $store_locationsRecord = @$store_locationsRecords[0]; // get first record
  
     list($home_page_left_top_boxRecords, $home_page_left_top_boxMetaData) = getRecords(array(
    'tableName'   => 'home_page_left_top_box',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $home_page_left_top_boxRecord = @$home_page_left_top_boxRecords[0]; // get first record
  
  list($finance_insuranceRecords, $finance_insuranceMetaData) = getRecords(array(
    'tableName'   => 'finance_insurance',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $finance_insuranceRecord = @$finance_insuranceRecords[0]; // get first record
  
    list($city_products_soldRecords, $city_products_soldMetaData) = getRecords(array(
    'tableName'   => 'city_products_sold',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $city_products_soldRecord = @$city_products_soldRecords[0]; // get first record
  
  list($parramatta_products_soldRecords, $parramatta_products_soldMetaData) = getRecords(array(
    'tableName'   => 'parramatta_products_sold',
    'where'       => whereRecordNumberInUrl(1),
    'limit'       => '1',
  ));
  $parramatta_products_soldRecord = @$parramatta_products_soldRecords[0]; // get first record
 

  // show error message if no matching record is found
  if (!$finance_insuranceRecord) {
    header("HTTP/1.0 404 Not Found");
    print "Record not found!";
    exit;
  }

?>
<?php include_once "/var/www/vhosts/actionmc.com.au/httpdocs/newsite/includes/spambot-email-protector.php" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/easySlider1.5.js"></script>
<script type="text/javascript">
		$(document).ready(function(){	
			$("#slider").easySlider();
		});	
	</script>
</head>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("");
pageTracker._trackPageview();
} catch(err) {}</script>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" class="maintable">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="975"><table width="1000" border="0" align="center" cellpadding="0" cellspacing="0" class="header">
              <tr>
                <td height="146" id="logo"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="105" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="32%" rowspan="2"><div class="logo"><a href="index.php"><img src="images/action-mc-logo.jpg" width="285" height="100" border="0" /></a></div></td>
                        <td width="38%" rowspan="2"><div class="slogan"><a href="finance-insurance.php"><img src="images/slogan.jpg" width="360" height="90" border="0" /></a></div></td>
                        <td height="32" align="center"><div class="socialnetworks"><img src="images/socialnetworks.jpg" width="240" height="32" border="0" usemap="#Map" /></div></td>
                      </tr>
                      <tr>
                        <td width="30%" align="center" valign="top" class="ridingconditions">                        
                          <div class="weather"><!--Weatherzone forecast button-->
  <script type="text/javascript" src="http://www.weatherzone.com.au/woys/graphic_forecast.jsp?postcode=2000&locality=sydney"></script>
<a href="http://www.weatherzone.com.au/radar.jsp">lightning tracker</a>
<!--end Weatherzone forecast button--></div>Today's Riding Conditions</td>
                      </tr>
                    </table></td>
                  </tr>
                  <tr>
                    <td height="35" align="center"><div class="nav"><a href="new-motorcycles.php"><img src="images/bnt1.jpg" width="120" height="35" border="0" /></a><a href="new-scooters.php"><img src="images/bnt2.jpg" width="120" height="35" border="0" /></a><a href="learner-legal.php"><img src="images/bnt3.jpg" width="120" height="35" border="0" /></a><a href="finance-insurance.php"><img src="images/bnt4.jpg" width="120" height="35" border="0" /></a><a href="sell-your-bike.php"><img src="images/bnt5.jpg" width="120" height="35" border="0" /></a><a href="accessories.php"><img src="images/bnt6.jpg" width="120" height="35" border="0" /></a><a href="tyre-specials.php"><img src="images/bnt7.jpg" width="120" height="35" border="0" /></a><a href="service-booking.php"><img src="images/bnt8.jpg" width="120" height="35" border="0" /></a></div></td>
                  </tr>
                </table></td>
                </tr>
              </table></td>
              </tr>
              <tr>
                <td height="250"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                      <tr>
                        <td width="50%" align="left"><div class="lefttop">
                          <table width="100%" border="0" cellpadding="0" cellspacing="0" class="lefttoptxt">
                            <tr>
                              <td align="left" valign="top"><?php $home_page_left_top_boxRecord['content'] = preg_replace("/<p>/i", "<br>",  $home_page_left_top_boxRecord['content'] ); ?>
							  <?php $home_page_left_top_boxRecord['content'] =  preg_replace("/<\/p>/i", "", $home_page_left_top_boxRecord['content'] ); ?>
                              <span><?php echo $home_page_left_top_boxRecord['content'] ?></span></td>
                            </tr>
                            <tr>
                              <td align="center" valign="bottom"><!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
                                <!-- STEP 2a: Display Uploads for field 'logos' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?php foreach ($home_page_left_top_boxRecord['logos'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
            <a href="http://<?php echo $upload['info1'] ?>" target="_blank"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" hspace="5" border="0" /></a>
            <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" alt="" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" hspace="5" border="0" /><br/>

          <?php else: ?>
            <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

          <?php endif ?>
        <?php endforeach ?>
        <?php if (!$home_page_left_top_boxRecord): ?>
      No record found!<br/><br/>
    <?php endif ?></td>
                            </tr>
                          </table>
                        </div></td>
                        <td width="50%" align="right" class="righttopunder"><div id="content">
                        
                        <div class="righttop"></div></td>
                      </tr>
                    </table></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td><div class="middletitlebar"></div></td>
              </tr>
              <tr>
                <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><div class="headertxt"><?php echo $store_locationsRecord['title'] ?> Store Location</div></td>
                  </tr>
                  <tr>
                    <td><div class="financeinsurancecontent">  
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td valign="top">&nbsp;</td>
          <td align="center" valign="top">&nbsp;</td>
        </tr>
        <tr>
          <td valign="top"><p><strong>Address:</strong> <?php echo $store_locationsRecord['address'] ?><br/>
            <?php echo $store_locationsRecord['address_1'] ?><br/>
            <?php echo $store_locationsRecord['suburb'] ?>, <?php echo $store_locationsRecord['state'] ?></p>
            <br/>
            
            <strong>Phone:</strong> <?php echo $store_locationsRecord['phone'] ?><br />
            <br/>
            <strong>Fax:</strong> <?php echo $store_locationsRecord['fax'] ?><br />
            <br />
            <strong>Email:</strong> <a href="mailto:<?php echo $store_locationsRecord['email'] ?>"><?php echo $store_locationsRecord['email'] ?></a><br/>
            <br />
            <strong>Trading Hours</strong><br /><?php echo $store_locationsRecord['trading_hours'] ?><br/>
            <br />
            <?php echo $store_locationsRecord['other_text'] ?><br/></td>
          <td width="550" align="center" valign="top"><?php echo $store_locationsRecord['map'] ?></td>
        </tr>
      </table>
      <p>
        <?php if (!$store_locationsRecord): ?>
      No record found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->
</p>
                    </div></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td><div class="middletitlebar">
                  
                </div></td>
              </tr>
              <tr>
                <td valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><div class="headertxt">Pre Owned Bikes</div></td>
                  </tr>
                  <tr>
                    <td align="center"><div class="hp_preowned_bike_items">  
                      <p>
                        <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
                        <?php foreach ($pre_owned_bikes_logosRecords as $record): ?>
                        <!-- STEP 2a: Display Uploads for field 'logo' (Paste this anywhere inside STEP2 to display uploads) -->
                        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
                        <?php foreach ($record['logo'] as $upload): ?>
                        <?php if ($upload['hasThumbnail']): ?>
                        <a href="used-motorcycles.php?manufacturer=<?php echo $record['title'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" hspace="5" vspace="7" border="0" /></a>
                        <?php elseif ($upload['isImage']): ?>
                        <img src="<?php echo $upload['urlPath'] ?>" alt="" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" hspace="5" vspace="7" />
                      <br/><br />
<br/>
                        
                        <?php else: ?>
                        <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a>
                        <?php endif ?>
                        <?php endforeach ?>
  <!-- STEP2a: /Display Uploads -->
  <?php endforeach ?>
  
  <?php if (!$pre_owned_bikes_logosRecords): ?>
  No records were found!<?php endif ?>
  <!-- /STEP2: Display Records -->
</p>
</div></td>
                  </tr>
                </table></td>
              </tr>
              <tr>
                <td><div class="middletitlebar">
                
                </div></td>
              </tr>
              <tr>
                <td><div align="center">
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td align="center" valign="top"><div class="headertxt">City Location</div></td>
                      <td align="center" valign="top">&nbsp;</td>
                      <td align="center" valign="top"><div class="headertxt">Weekly Special</div></td>
                      <td align="center" valign="top">&nbsp;</td>
                      <td align="center" valign="top"><div class="headertxt">Parramatta Location</div></td>
                    </tr>
                    <tr>
                      <td width="32%" align="center" valign="top"><div class="hp_city_location">
                        <p><a href="store-locations.php?title=city"><img src="images/citymap.jpg" width="250" height="250" border="0" /><br />
                          </a>Click Map for Full size view</p>
                          <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
      Products Sold at <?php echo $city_products_soldRecord['title'] ?><br/>
      <br/>


      <!-- STEP 2a: Display Uploads for field 'logos' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?php foreach ($city_products_soldRecord['logos'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
            <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
            <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

          <?php else: ?>
            <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

          <?php endif ?>
        <?php endforeach ?>
        <?php if (!$city_products_soldRecord): ?>
      No record found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records --><br />
                        </p>
                      </div></td>
                      <td width="1%" align="center" valign="top"><div class="vdotted">
                      <p>&nbsp;</p>
                    </div></td>
                      <td width="32%" align="center" valign="top"><div class="hp_weekly_specials">  
                        <p>
                          <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
                          <?php foreach ($weekly_specialsRecords as $record): ?>
                          <span class="weeklyspecialstxt"><?php echo $record['content'] ?></span><br/>
                          <!-- STEP 2a: Display Uploads for field 'image' (Paste this anywhere inside STEP2 to display uploads) -->
                          <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
                          <?php foreach ($record['image'] as $upload): ?>
                          <?php if ($upload['hasThumbnail']): ?>
                          <a href="<?php echo $record['_link'] ?>"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" border="0" /></a><br/>
                          
                          <?php elseif ($upload['isImage']): ?>
                          <a href="<?php echo $record['_link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" border="0" /></a></p>
                        <?php else: ?>
                          <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>
                          
                          <?php endif ?>
                          <?php endforeach ?>
                          <!-- STEP2a: /Display Uploads -->
                          <?php endforeach ?>
                          
                          <?php if (!$weekly_specialsRecords): ?>
                          No records were found!<br/><br/>
                        </p>
    <?php endif ?>
  <!-- /STEP2: Display Records --></div></td>
                      <td width="1%" align="center" valign="top"><div class="vdotted">
                      <p>&nbsp;</p>
                    </div></td>
                      <td width="32%" align="center" valign="top"><div class="hp_parramatta_location">
                        <p><a href="store-locations.php?title=parramatta"><img src="images/parramattamap.jpg" width="250" height="250" border="0" /><br />
                          </a>Click Map for Full size view<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
                        </p>
                        <p><!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
      Products Sold at <?php echo $parramatta_products_soldRecord['title'] ?><br/>
      <br/>


      <!-- STEP 2a: Display Uploads for field 'logos' (Paste this anywhere inside STEP2 to display uploads) -->
        <!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
        <?php foreach ($parramatta_products_soldRecord['logos'] as $upload): ?>
          <?php if ($upload['hasThumbnail']): ?>
            <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" />
            <?php elseif ($upload['isImage']): ?>
            <img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

          <?php else: ?>
            <a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

          <?php endif ?>
        <?php endforeach ?>
        <?php if (!$parramatta_products_soldRecord): ?>
      No record found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->                          <br />
                        </p>
                      </div></td>
                    </tr>
                  </table>
                </div></td>
              </tr>
              <tr>
                <td><?php include("includes/footer.inc.php"); ?></td>
              </tr>
            </table></td>
            </tr>
          </table></td>
        </tr>
      </table></td>
  </tr>
</table>

<map name="Map" id="Map">
  <area shape="rect" coords="17,2,43,29" href="index.php" />
  <area shape="rect" coords="48,4,75,29" href="http://twitter.com/ActionMc" target="_blank" />
  <area shape="rect" coords="79,4,105,28" href="http://www.facebook.com/ActionMotorcycles" target="_blank" />
  <area shape="rect" coords="110,5,177,29" href="http://www.paypal.com.au/au" target="_blank" />
</map>
</body>
</html>