<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "/services/webpages/a/x/axislighting.com/public/cmsAdmin/lib/viewer_functions.php";

   list($brandsRecords, $brandsMetaData) = getRecords(array(
    'tableName'   => 'brands',
    'where'       => whereRecordNumberInUrl(1),
   
  ));
  $brandsRecord = @$brandsRecords[0]; // get first record
  
  
  list($downloadsRecords, $downloadsMetaData) = getRecords(array(
    'tableName'   => 'downloads',
  ));
  
 	 $product_images = array(); 
	$brochure = array(); 
	$specification_sheets = array(); 
 
foreach($downloadsRecords as $downloadsRecord){ 
   if($downloadsRecord['product_images']){ 
         $product_images[]=$downloadsRecords['product_images']; 
    } 
   if($downloadsRecord['brochure']){ 
         $brochures[]=$downloadsRecords['brochure']; 
    } 
   if($downloadsRecord['specification_sheets']){ 
         $specification_sheets[]=$downloadsRecords['specification_sheets']; 
    } 
}

?>

<!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>Welcome to Axis Lighting!</title>
<style type="text/css">
<!--
body {
	background-color: #2e353e;
}
-->
</style>
<link href="axis.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="stmenu.js"></script>
<script type="text/javascript" src="stlib.js"></script>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script src="SpryAssets/SpryCollapsiblePanel.js" type="text/javascript"></script>
<link href="SpryAssets/SpryCollapsiblePanel.css" rel="stylesheet" type="text/css" />
</head>
<body>
 <table width="100%" border="0" cellspacing="0" cellpadding="0"><tr><td>
     
 



      <p>
        <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
        <?php foreach ($downloadsRecords as $record): ?>
        
        
        <!-- STEP 2a: Display Uploads for field 'brand_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 -->
       
        <!-- STEP2a: /Display Uploads -->
        
        
        
        <!-- STEP 2a: Display Uploads for field 'brand_photo' (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 -->
        
        
        
        <!-- STEP 2a: Display Uploads for field 'brochure' (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['brochure'] as $upload): ?>
        
        <a href="<?php echo $upload['urlPath'] ?>" target="_blank"><?php echo $upload['info1'] ?></a><br/>
        
        
        <?php endforeach ?>
        <!-- STEP2a: /Display Uploads -->
        
        
        
        <!-- STEP 2a: Display Uploads for field 'product_images' (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['product_images'] as $upload): ?>
        
        <a href="<?php echo $upload['urlPath'] ?>" target="_blank"><?php echo $upload['info1'] ?></a><br/>
        
        
        <?php endforeach ?>
        <!-- STEP2a: /Display Uploads -->
        
        
        
        <!-- STEP 2a: Display Uploads for field 'specification_sheets' (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['specification_sheets'] as $upload): ?>
        
        <a href="<?php echo $upload['urlPath'] ?>" target="_blank"><?php echo $upload['info1'] ?></a><br/>
        
        
        <?php endforeach ?>
        <!-- STEP2a: /Display Uploads -->
        
        
        
       
        
        
      </p>
      <hr/>
    <?php endforeach ?>

    <?php if (!$downloadsRecords): ?>
      No records were found!<br/>
      <pre>&nbsp;</pre>
      <br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->


  

  <!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
  <?php if (!$downloadsRecords): ?>
      No records were found!<br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->

  <br/></td>
      </tr>
    </table>
</body>
</html>
