function editphotos($rid) { $sql = "select * from `rentorhire_images` where rentorhire_id='" . $rid . "'"; $result = $this->mysql->getdata($sql); $str = ""; $i = 1; $photos = $this->getPhotos($rid); if (is_array($photos)) { $ph = new photo(); foreach ($photos as $data) { $img = $ph->getPhotoById($data['photo_id'], 2); $str .= '<div id="image' . $i . '">' . $i . '. <a href="javascript:;" onclick="loadPage(\'/ajax/display_image.php?id=' . $data['photo_id'] . '\')"><img src="' . $img . '" border="0"></a>'; $str .= "<a href=\"javascript:;\" onclick=\"loadAjax('/ajax/rentorhire/removeimage.php?imageid=" . $data['photo_id'] . "','image" . $i . "');\">Remove this Image</a></div>"; $i++; } } return $str; }
<?php session_start(); require_once $_SERVER['DOCUMENT_ROOT'] . "/common/class/photo.class.php"; $ph = new photo(); $img = $ph->getPhotoById($_GET['id'], 3); echo '<img src="' . $img . '">';
<tr> <th valign="top"> Description:</th> <td valign="top"><?php echo $rentorhire_data['description']; ?> </td> </tr> <tr> <th valign="top"> Related photos:</th> <td><?php $photos = $rentorhire->getPhotos($_GET['id']); if ($photos) { echo "<ul style=\"list-style:none\">"; $ph = new photo(); foreach ($photos as $photo) { $img = $ph->getPhotoById($photo['photo_id'], 2); echo '<li><a href="javascript:;" onclick="loadPage(\'/ajax/display_image.php?id=' . $photo['photo_id'] . '\')"><img src="' . $img . '" border="0"></a></li>'; } echo "</ul>"; } ?> </td> </tr> </table> <?php include "subfooter.php";