<?php header('Content-type: application/xml; charset=utf-8'); ?><?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<?php
 /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once("./includes/functions.inc.php");
 // load viewer library
 $libraryPath = 'cmsAdmin/lib/viewer_functions.php';
 $dirsToCheck = array('/home/towingeq/public_html/','','../','../../','../../../');
 foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
 if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

 // load records
  list($trucksRecords, $trucksRecordsMetaData) = getRecords(array(
	'tableName'   => 'trucks',
	'where'       => "accountNum = '" . $accountsRecord['num'] . "'",	
	'limit'       => '5',
	'debugSql'    => true,
		'chassis_manufacturers' => 'chassis_manufacturerNum',
		'chassis_models'        => 'chassis_modelNum',
		'equipment_manufacturers'        => 'equipment_manufacturerNum'
  ));
  
  $accountsRecord = @$accountsRecords[0]; // get first record

  // show error message if no matching record is found
  if (!$accountsRecord) { dieWith404("Record not found!"); }
?>

<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel> 
  <atom:link href="http://www.artistsofpalmbeachcounty.org/rss/happening-now-rss.xml.php" rel="self" type="application/rss+xml" />
    <title>TowingEquipmentSearch.com</title> 
      <link>http://towingequipmentsearch.com</link> 
      <description>Your site for Towing Equipment sales</description>
      
      <language>en-us</language>
      
      <item>
      <title>http://TowingEquipmentSearch.com</title>
      <description> Wrecker sales </description>
      <guid isPermaLink="true">http://www.towingequipmentsearch.com</guid>
      <pubDate><?php echo date('r'); ?></pubDate> 
      </item>

<?php foreach ($trucksRecords as $record): ?> 
        <item> 
          <title><?php echo $record['chassisYear'] . ' ' . $record['chassis_manufacturers.name'] ; ?>,<?php echo $record['equipment_model']; ?></title> 
          <link>http://www.towingequipmentsearch.com<?php echo $record['_link'] ?></link> 
          <description><?php echo $record['chassisYear'] . ' ' . $record['chassis_manufacturers.name'] ; ?>,<?php echo $record['equipment_model']; ?></description> 
          <pubDate><?php echo date("r", strtotime($record['date'])) ?></pubDate> 
          <guid isPermaLink="true">http://www.towingequipmentsearch.com<?php echo $record['_link'] ?></guid> 
        </item> 
<?php endforeach ?> 
  </channel> 
</rss>