#records exist - process if ($myPager->showTotal() == 1) { $itemz = "muffin"; } else { $itemz = "muffins"; } echo '<div align="center">We have ' . $myPager->showTotal() . ' ' . $itemz . '!</div>'; $tdWidth = number_format(100 / COLS, 0); # Here we determine the number of columns we'll be using $pos = 0; echo '<table align="center" border="0" width="90%" style="border-collapse:collapse" cellpadding="2" cellspacing="2"><tr>'; while ($row = mysqli_fetch_assoc($result)) { //dbOut() function is a 'wrapper' designed to strip slashes, etc. of data leaving db $pos++; #creates a meaningful image prefix out of table name and name of item $imagePrefix = createImagePrefix('muffins', dbOut($row['MuffinName'])); echo '<td width="' . $tdWidth . '%"><div class="myborder">'; echo '<img src="' . VIRTUAL_PATH . 'upload/' . $imagePrefix . dbOut($row['MuffinID']) . '_thumb.jpg" hspace="5" vspace="5" align="middle" />'; echo '<a href="' . VIRTUAL_PATH . 'demo/demo_view_meaningful.php?id=' . dbOut($row['MuffinID']) . '">' . dbOut($row['MuffinName']) . '</a>'; echo ' <i>only</i> <font color="red">$' . money_format("%(#10n", dbOut($row['Price'])) . '</font><br />'; echo dbOut($row['Description']) . '</div></td>'; if ($pos % COLS === 0 && is_array($row)) { echo '</tr><tr>'; } } while ($pos % COLS) { //loop to fill in final row echo '<td> </td>'; $pos++; } echo "</tr></table>";
*/ # END CONFIG AREA ---------------------------------------------------------- get_header(); #defaults to theme header or header_inc.php ?> <h3 align="center"><?php echo smartTitle(); ?> </h3> <p>This page, along with demo_list_meaningful.php, demonstrate a paging List/View web application.</p> <p>This version incorporates image uploads with meaningful file names for better search engine indexing.</p> <?php #creates a meaningful image prefix out of table name and name of item $imagePrefix = createImagePrefix('muffins', $MuffinName); if ($foundRecord) { #records exist - show muffin! ?> <h3 align="center">A Yummy <?php echo $MuffinName; ?> Muffin!</h3> <div align="center"><a href="<?php echo VIRTUAL_PATH; ?> demo/demo_list_meaningful.php">More Muffins?!?</a></div> <table align="center"> <tr> <td><img src="<?php echo VIRTUAL_PATH;