<?php

  /* STEP 1: LOAD RECORDS - Copy this PHP code block near the TOP of your page */
  require_once "../cmsAdminFrench/lib/viewer_functions.php";

$where = "num=num";

if((@$_REQUEST['mounting_french'] != "undefined") && (@$_REQUEST['mounting_french']) ) {
   $where .= " AND mounting_french LIKE '%" . mysql_real_escape_string($_REQUEST['mounting_french']) . "%' ";
}
if((@$_REQUEST['distribution'] != "undefined") && (@$_REQUEST['distribution']) ) {
   $where .= " AND distribution LIKE '%\t" . mysql_real_escape_string($_REQUEST['distribution']) . "\t%' ";
}
if((@$_REQUEST['lamping'] != "undefined") && (@$_REQUEST['lamping']) ) {
   $where .= " AND lamping LIKE '%" . mysql_real_escape_string($_REQUEST['lamping']) . "%' ";
}


    list($itemsRecords, $itemsMetaData) = getRecords(array(
    'tableName'   => 'items',
    'allowSearch' => true,
  ));
 // load records from 'mounting'
  list($mountingRecords, $mountingMetaData) = getRecords(array(
    'tableName'   => 'mounting',
    'loadUploads' => true,
    'allowSearch' => true,
  ));
  
  // load records from 'mounting-french'
  list($mounting_frenchRecords, $mounting_frenchMetaData) = getRecords(array(
    'tableName'   => 'mounting_french',
    'loadUploads' => true,
    'allowSearch' => true,
  ));
  
?>
     

  <table width="750" align="center" cellpadding="2" cellspacing="2" class="margin-table-search-results">
  <tr>  <?php foreach ($itemsRecords as $record): ?>     
   <td width="175" align="left"> 
                 <?php foreach ($record['main_image'] as $upload): ?>
         

          <?php if ($upload['isImage']): ?>
<a href="<?php echo $record['link'] ?>"><img src="<?php echo $upload['urlPath'] ?>" alt="" class="img-bord" width="150" height="150" border="0" /></a>     <?php endif ?>
        <?php endforeach ?>
    <table width="150" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2" height="3"></td>
      </tr>
      <tr>
         <td height="65" valign="top">
         <?php foreach ($record['small_logo'] as $upload): ?>
            <a href="<?php echo $record['link'] ?>">
               <img src="<?php echo $upload['urlPath'] ?>" alt="<?php echo $record['name'] ?>" border="0">
            </a>
         <?php endforeach ?>
         </td>
         <td align="right" valign="top">
           <div class="text-12-no-justify-search" style="margin-top:5px;">
               <?php echo $record['mounting_french'] ?>
            </div>
         </td>
      </tr>
      <tr>
         <td height="15"></td>
      </tr>
    </table>
   </td>  
   <?php $maxCols=4; if (@++$count % $maxCols == 0): ?>  </tr>  <tr>  <?php endif ?>  <?php endforeach ?>  </table>


</tr>
    </table>

