<?php
require_once("../check.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<title>广告设置</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<script src="../js/jquery-1.11.1.min.js"></script>
<script>
$(function(){
   $(".a1").click(function(){
    $(".title").html('当前正在编辑:【 <span class="adtitle">广告一区</span> 】广告位');
    $("#content").load("../../ad/html.php?p=top.php");
    $(this).css("backgroundColor","#FF0000");
    $(this).css("color","#FFFFFF");
    $(".a2").css("backgroundColor","#E6E6E6");
    $(".a2").css("color","#FF0000");
    $(".a3").css("backgroundColor","#E6E6E6");
    $(".a3").css("color","#FF0000");
    $("#ad").val("top.php");
   });

   $(".a2").click(function(){
    $(".title").html('当前正在编辑:【 <span class="adtitle">广告二区</span> 】广告位');

    $("#content").load("../../ad/html.php?p=center.php");
    $(this).css("backgroundColor","#FF0000");
    $(this).css("color","#FFFFFF");
    $(".a1").css("backgroundColor","#E6E6E6");
    $(".a1").css("color","#FF0000");
    $(".a3").css("backgroundColor","#E6E6E6");
    $(".a3").css("color","#FF0000");
    $("#ad").val("center.php");
   });
   
   $(".a3").click(function(){
    $(".title").html('当前正在编辑:【 <span class="adtitle">广告三区</span> 】广告位');

    $("#content").load("../../ad/html.php?p=bottom.php");
    $(this).css("backgroundColor","#FF0000");
    $(this).css("color","#FFFFFF");
    $(".a2").css("backgroundColor","#E6E6E6");
    $(".a2").css("color","#FF0000");
    $(".a1").css("backgroundColor","#E6E6E6");
    $(".a1").css("color","#FF0000");
    $("#ad").val("bottom.php");
   });
   
   $("#form").click(function(){
    var ad = $("#ad").val();
    var content = $("#content").val();
    if(ad==""){
        alert('请在左边选择广告位进行编辑后再保存!');
        return false;
    }
    $.post("../core/ad.php",{
        ad:ad,
        content:content
    },function(aa,bb){
        alert('已更新!');
        location.href='ad.php';
        return false;
    });
    
   });
});
</script>
<body>
<style>
body{
    margin:0;
    padding:0;
    text-align:center;
}
#table{
    margin-top:5px;
    width:950px;
    height:auto;
    height:auto;
    display: table;
    text-align:left;
}

#table .left{
    float:left;
    margin-left:10px;
    width:252px;
    height:482px;
    background-image:url("../images/ad.png");
}
#table .right{
    float:right;
    width:650px;
    height:550px;
}
#table .left .a1{
    margin-top:70px;
    margin-left:13px;
    width:226px;
    height:46px;
    display:table;
    text-align:center;
    line-height:46px;
    color:#FF0000;
    background-color: #E6E6E6;
}

#table .left .a2{
    margin-top:33px;
    margin-left:13px;
    width:226px;
    height:46px;
    display:table;
    text-align:center;
    line-height:46px;
    color:#FF0000;
    background-color: #E6E6E6;
}

#table .left .a3{
    margin-top:132px;
    margin-left:13px;
    width:226px;
    height:77px;
    display:table;
    text-align:center;
    line-height:77px;
    color:#FF0000;
    background-color: #E6E6E6;
}
#table .left .a1:hover{
    background-color: #FF0000;
    color:#FFFFFF;

}
#table .left .a2:hover{
    background-color: #FF0000;
    color:#FFFFFF;

}
#table .left .a3:hover{
    background-color: #FF0000;
    color:#FFFFFF;

}
#table .right .title{
    margin-top:50px;
    height:50px;
    line-height:50px;
    color: #006697;
    font-size:16px;
}
#table .adtitle{
    color: #FF0000;
    font-size:16px;
}
</style>
<div id="table">
<div class="left">
<div class="a1">广告一区</div>
<div class="a2">广告二区</div>
<div class="a3">广告三区</div>
</div>
<div class="right">
<div class="title">请在<span style="color: red;">左边</span>选择相应广告位进行编辑!</div>
<input type="hidden" id="ad" value="" />
<div>
<textarea id="content" style="width: 100%;height:320px;resize: none;"></textarea>
</div>
<div style="text-align: right;"><span style="color: #8C8C8C;font-size:14px;">支持HTML格式</span>&nbsp;<input style="width: 200px;height:35px;line-height:35px;" id="form" type="button" value="提交保存" /></div>
</div>
</div>
</body>