Current File : /home/bassmoto/public_html.oct5/index.phpOLD
<?php

function extractText($array){
	if(count($array) <= 1){
		//we only have one tag to process!
		for ($i = 0; $i<count($array); $i++){
			$node = $array[$i];
			$value = $node->get_content();
		}
		return $value;
	} 	
}	
?>

<html>
<head>
	<title>Bass Sports Motor</title>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
	<META NAME="DESCRIPTION" CONTENT="vehicle sales website">
	<META NAME="KEYWORDS" CONTENT="automotive, car">

	<style>
		.BlackLink {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:black; font-weight:bold; text-decoration:none}
		a.BlackLink:hover {text-decoration: underline}
		
		.BlackLinkB {font-family:tahoma, verdana, helvetica, arial; font-size:13; color:black; font-weight:bold; text-decoration:none}
		a.BlackLinkB:hover {text-decoration: underline}
		
		.BlackLinkC {font-family:tahoma, verdana, helvetica, arial; font-size:13; color:white; font-weight:bold; text-decoration:none}
		a.BlackLinkC:hover {text-decoration: underline}

		.BlueLink {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:blue; font-weight:bold; text-decoration:underline}
		a.BlueLink:hover {text-decoration: underline}

		.RedLink {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:red; font-weight:bold; text-decoration:none}
		a.RedLink:hover {text-decoration: underline}

		a.CatLinks {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:white; font-weight:bold; text-decoration:none}
		a.CatLinks:hover {text-decoration:underline}

		a.SubCatLinks {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:#878888; font-weight:normal; text-decoration:none}
		a.SubCatLinks:hover {text-decoration:underline}
		
		a.SubCatLinksB {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:black; font-weight:normal; text-decoration:none}
		a.SubCatLinksB:hover {text-decoration:underline}

		.TitleLinks {font-family:tahoma, verdana, helvetica, arial; font-size:12; color:black; font-weight:bold; text-decoration:none}
		a.TitleLinks:hover {text-decoration:underline}

		.ItemText {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:black; font-weight:regular; text-decoration:none}
	
		body {background-color:white; font-family:tahoma, verdana, helvetica, arial; font-size:11; color:black; font-weight:regular; text-align:left}

		td {font-family:tahoma, verdana, helvetica, arial; font-size:11; font-weight:regular; text-decoration:none}

		.sm {font-family:tahoma, verdana, helvetica, arial; font-size:11}

		input, select, textarea {font-family:tahoma, verdana, helvetica, arial; font-size:11; color:black; border-width:1; border-color:black}

	</style>

</head>

<body bgcolor="#CCCCCC" background="images/bg.gif" topmargin=0>
<table width="693" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr valign="top">     
          <td width="693"><img src="images/logo.jpg" width="693" height="287"></td>
     
  </tr>
  
  <tr valign="top" Height="100">
          <td bgcolor="#FFFF01" align="center" width="693"><b>COSTA MESA, CA TEL: (714) 915-2210</b><br>
          <b>HOURS VARY, PLEASE CALL FOR SHOWING AND DETAILS</b><br><b>All major credit cards and debit cards accepted</b>

          </td>
  </tr>
  
  <tr> 
    <td bgcolor="#FFFF01" valign="top">
    <table width="100%" cellspacing="0" cellpadding="0">
<?php
$dh = opendir('./xml/');
$fileCount = 0;
$file = readdir($dh);
do {
	if (eregi("^..?$", $file)) {
		continue;
	}
	$open = "./xml/".$file;
	$xml = domxml_open_file($open);

	//we need to pull out all the things from this file that we will need to 
	//build our links
	$root = $xml->root();
	$id = $root->get_attribute("id");
	
	$mimage_array = $root->get_elements_by_tagname("mimage");
	$mainimage = extractText($mimage_array);

	$price_array = $root->get_elements_by_tagname("price");
	$price = extractText($price_array);
	
	$vname_array = $root->get_elements_by_tagname("vname");
	$vname = extractText($vname_array);
	
	$mileage_array = $root->get_elements_by_tagname("mileage");
	$mileage = extractText($mileage_array);
	
	$status_array = $root->get_elements_by_tagname("status");
	$status = extractText($status_array);

//	if ($status != "live"){
//		continue;
//	}

$fileCount++;

if ($fileCount == 1){
echo "<tr>";
}
?>

                <td width="33%" valign="top">
  	              <table width="100%" cellspacing="0" cellpadding="0">
		        <tr><td align="center"><div style="margin-bottom:15px"><a href="cardetail.php?file=<?php echo $id; ?>.xml"><img src="images/<?php echo $mainimage; ?>" border="0"></a></div></td></tr>
  		        <tr><td align="center"><div style="margin-left:15px; margin-right:15px"><a class=SubCatLinksB href="cardetail.php?file=<?php echo $id; ?>.xml"><b><?php echo $name; ?></b></a></div></td></tr>
		        <tr><td align="center"><div style="margin-left:15px; margin-right:15px;"><a class=SubCatLinksB href="cardetail.php?file=<?php echo $id; ?>.xml"><?php echo $mileage ; ?> km - $<?php echo $price ; ?></a></div><td></tr>
		        <tr><td align="center"><div style="margin-left:15px; margin-right:15px; margin-bottom:15px;"><?php if ($status == "Sold") { ?><font color="red" size="12"><b><?php echo $status; ?></b></font><?php } else { echo $status; }?></div></td></tr>
	              </table>
	            </td>
	            <td><img src="images/spacer.gif" height="1" width="10"></td><td width="1" background="images/dot_vertical.jpg"><img src="images/spacer.gif" border="0" width="1" height="1"></td><td><img src="images/spacer.gif" height="1" width="10"></td>

<?php
if ($fileCount == 3) {
echo "</tr>";

$fileCount = 0;
}
	
} while (false !== ($file = readdir($dh))) 
?>
   	            
   	          </table>
    </td>
  </tr>

    <tr valign="top" Height="100">
          <td bgcolor="#FFFF01" align="center" width="693"><p></p></td>
  </tr>             
   	          
   	         
  <tr> 
    <td bgcolor="#000000"><table width="693" border="0" align="center" cellpadding="6" cellspacing="0">
        <tr> 
          <td width="223" height="31" bgcolor="#CCCCCC"><font color="#000000"><strong>Copyright 
            2005- 2006 
            Al Bass            </strong></font></td>
          <td width="534" bgcolor="#000000"><div align="center"><a href="index.php" class="CatLinks">home</a> 
            | <a href="advanced.php" class="CatLinks">search</a> | <a href="login.php" class="CatLinks">login</a> 
            | <a href="r1.php" class="CatLinks">register</a> | <a href="mailto:sales@bassmotorsports.com" class="CatLinks">contact 
            us</a> | <a href="agreement.php" class="CatLinks">terms of use</a></div></td>
        </tr>
      </table></td>
  </tr>
</table>
</body>

</html>