<?php
if(!isset($_SESSION)) 
session_start();
if(!isset($_SESSION['admin_wsvc']))
{
header("location: admin.php");
}
include 'common/header.php';
$error = "Restricted In Demo Mode";
 ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- TemplateBeginEditable name="doctitle" -->
<title>Edit Ads: <?php echo(get_title()) ?></title>
</head>
<body class="metrouicss" onload="prettyPrint()">
<div class="container" style="width:940px;margin: auto">
<div class="page">
<div class="nav-bar" style="background:<?php echo(retColor()); ?>">
    <div class="nav-bar-inner padding10">
        <span class="pull-menu"></span>

        <a href="<?php echo(rootpath()) ?>"><span class="element brand">
            <img class="place-left" src="images/logo32.png" style="height: 20px"/>
           <?php echo(get_title()) ?>
        </span></a>
    </div>
</div>
</div>

    <div class="page secondary with-sidebar">
        <div class="page-header">
            <div class="page-header-content">
                <h1>Ad Management</h1>
                <a href="#" onclick="window.history.back();" class="back-button big page-back"></a>
            </div>
        </div>

        <?php include 'inc/sidebar.php'; ?>
        <div class="page-region">
            <div class="page-region-content">
                <div class="span5">
                     <div class="grid">
					 <div class="row">
					 <?php
if(isset($_POST['banner']))
{
$banner = $_POST["banner"];
$medrec1 = $_POST["medrec1"];
$medrec2 = $_POST["medrec2"];
update_ads($banner,$medrec1,$medrec2);
}
?>
<form action="ads.php" method="post">
<h3>Banner Ad - 468x60</h3>  
 <div class="input-control textarea">
        <textarea name="banner"><?php echo(show_banner_ad()) ?></textarea>
    </div>  
<h3>Medium Rectangle Ad 1 - 300x250</h3>  
 <div class="input-control textarea">
        <textarea name="medrec1"><?php echo(show_medrec_ad()) ?></textarea>
    </div>
	<h3>Medium Rectangle Ad 2 - 300x250</h3>  
 <div class="input-control textarea">
        <textarea name="medrec2"><?php echo(show_medrec2_ad()) ?></textarea>
    </div>     	
                                    </select>
                                </div>
<input type="submit" class="bg-color-green" value="Update">
</form>
</div>
<?php               
if(isset($_POST['banner']))
{
?>
<span class="label success">Ads Updated Successfully</span>
<?php 
}
?>
 </div>

				</div>
            </div>
        </div>
    </div>

<?php include 'common/footer.php'; ?>