$alladvertisements = array(); while ($alladvertisements[] = $db->fetcharray()) { } $ads = ''; for ($i = 0; $i < count($alladvertisements) - 1; $i++) { foreach ($alladvertisements as $field => $value) { if ($field == 'bannerID') { if (checkhttptext($alladvertisements[$i]->banner_clickURL)) { $ads .= '<div id= "banner_imgs" >'; $ads .= '<a href="' . $alladvertisements[$i]->banner_clickURL . '" >'; $ads .= '<img src= "' . makeRelativepath($alladvertisements[$i]->banner_imageurl, 7) . '" border="0" ></a>'; $ads .= '</div>'; } else { $ads .= '<div id= "banner_imgs" >'; $ads .= '<a href="http://' . $alladvertisements[$i]->banner_clickURL . '" >'; $ads .= '<img src= "' . makeRelativepath($alladvertisements[$i]->banner_imageurl, 7) . '" border="0" ></a>'; $ads .= '</div>'; } } } } /** * Get the sponsored links */ $sql = " select banner_clickURL from corporate_partners_imgs ba "; $sql .= " where ba.banner_show = '1' "; if (!($result = $db->query($sql))) { die('Error:' . $db->error()); } $links = array(); while ($links[] = $db->fetcharray()) {
require '../admin/coreclass.php'; session_start(); // if user is not login..redirect him to login page if (!isset($_SESSION['login'])) { header('Location: ../admin/login.php'); } if (isset($_SESSION['login'])) { $userID = $_SESSION['userID']; $usertype = $_SESSION['usertype']; } $imageID = $_GET['imageID']; $db = new database(); $sql = " select * from stockphotos where imageID= '{$imageID}' "; if (!($result = $db->query($sql))) { die('Error:' . $db->error()); } $image = array(); while ($image[] = $db->fetcharray()) { } $imagename = $image[0]->image_filename; $sql = " delete from stockphotos \r\n\t\t where imageID= '{$imageID}' "; if (!($result = $db->query($sql))) { die('Error:' . $db->error()); } //unlink( makeRelativepath($imagename, 4) ); if ($result) { // Log the activity $action = new activity(); $action->track_activity($userID, $action->deleting_image, makeRelativepath($imagename, 7)); } header('location: ' . $_SERVER['HTTP_REFERER']);