To EXCELLENT product company...
I'm trying to output to a viewer page something very simple, but of course, slightly beyond my ability. In our database we have inventory ad records, some added by dealer accounts (the relational table part), and some by the admin. All ads view to the public fine. What we want to accomplish is a separate page that displays the following:
Dealer Name, Dealer Website Link, Link to Dealer Ads in our Inventory
Using generator code I can display the dealer name and the website link, but pulling the correct link to that dealer's ads from our database isn't quite working correctly.
Here's the page code I'm using that needs help:
top code:
--------
<?php
require_once "/home/content/e/q/u/equipmart/html/emaAdmin/lib/viewer_functions.php";
list($dealer_infoRecords, $dealer_infoMetaData) = getRecords(array(
'tableName' => 'dealer_info',
));
list($inventoryRecords, $inventoryMetaData) = getRecords(array(
'tableName' => 'inventory',
'perPage' => '7',
'orderBy' => 'RAND()',
));
$inventoryRecord =& $inventoryRecords[0]; // get first record
// load referenced records for our fields
beta_lookupRelatedFields(array(
'table' => 'inventory',
'recordList' => &$inventoryRecords,
'fieldList' => array(
'manufacturer', 'model' => 'model', 'equipment_type'
),
));
?>
-------------------
and here's the code to display the table, that repeats for each record...
------------------------
<!--display record code begins-->
<!-- STEP2: Display Records (Paste this where you want your records to be listed) -->
<h1>Our Dealers, Brokers and Partners</h1>
<?php foreach ($dealer_infoRecords as $record): ?>
<table border="0" cellpadding="5" cellspacing="0" width=100%>
<tr>
<td valign="top" width=50%>
<?php if ($record['dealer_business_name']): ?>
<b/><?php echo $record['dealer_business_name'] ?></b/>
<?php endif ?>
</td>
<td valign="top" width=25%>
<?php if ($record['dealer_website']): ?>
<a href="<?php echo $record['dealer_website'] ?>" target="_blank"><font color="#900000" size="2"><b/>click to visit website</b/></font></a>
<?php endif ?>
</td>
<td valign="top" width=25%>
<?php if ($record['dealer_business_name']): ?>
<a href="inventoryList.php?createdByUserNum=<?php echo $inventoryRecord['createdByUserNum']; ?>">
<font color="#900000" size="2"><b/>click to view ads</b/></font>
</a>
<?php endif ?>
</td>
</tr>
</table>
<?php endforeach; ?>
<?php if (!$dealer_infoRecords): ?>
There are no records available for that search at this time. Click BACK in your browser.<br/><br/>
<?php endif ?>
<!-- /STEP2: Display Records -->
<!--display record code ends-->
---------------------------------
Thanks in advance for any help. If you want to see the visual for the page online, I can PM the URL to whomever wishes to assist.