Banner Updated!

"; if (isset($_GET['action'])) { if( 0 == strcmp('new', $_GET['action'])) { $list = false; if (isset($_POST['save'])) { $sql = "INSERT INTO $adMangler->adsTable ( `width`, `height`, `active`, `approved`, `type`, `code`, `url`, `advertiser`, `base` ) VALUES ( ".intval($_POST['width']).", ".intval($_POST['height']).", ".intval($_POST['active']).", ".intval($_POST['approved']).", \"".$_POST['type']."\", \"".$_POST['code']."\", \"".$_POST['url']."\", \"".$_POST['advertiser']."\", ".intval($_POST['base'])." );"; $wpdb->query($sql); echo $message; $sql = "SELECT * FROM $adMangler->adsTable ORDER BY id DESC LIMIT 1"; $banner = $wpdb->get_row($sql); echo $adMangler->FormatAd($banner->type, $banner->code); } } else if (0 == strcmp('delete', $_GET['action']) && isset($_GET['id'])) { $sql = "DELETE FROM $adMangler->adsTable WHERE id=".intval($_GET['id']); $wpdb->query($sql); $list = true; } else if (0 == strcmp('edit', $_GET['action']) && isset($_GET['id'])) { $list = false; if (isset($_POST['save'])) { $sql = "UPDATE $adMangler->adsTable SET width=".intval($_POST['width']).", height=".intval($_POST['height']).", active=".intval($_POST['active']).", approved=".intval($_POST['approved']).", type=\"".$_POST['type']."\", code=\"".$_POST['code']."\", url=\"".$_POST['url']."\", advertiser=\"".$_POST['advertiser']."\", base=".intval($_POST['base'])." WHERE id=".intval($_GET['id']); $wpdb->query($sql); echo $message; } } if (isset($_GET['id'])) { $sql = "SELECT * FROM $adMangler->adsTable WHERE id=".intval($_GET['id']); $banner = $wpdb->get_row($sql); echo $adMangler->FormatAd($banner->type, $banner->code); } } if (!$list): ?>

Edit Banner

Will this ad be used when we have no purchased ads to show?
   Delete

View Banners

Add New Banner

adsTable"; $results = $wpdb->get_results($sql); ?>
Action Preview Advertiser Active Approved Base Type Size
Edit | Delete preview
code; ?>
advertiser; ?> active) ? "Yes" : "No"; ?> approved) ? "Yes" : "No"; ?> base) ? "Yes" : "No"; ?> type; ?> width; ?>xheight; ?>