<%@ Page Language="C#" AutoEventWireup="true"
    Inherits="MyITJob.Admin_Advertise_AddAD_Manage" Codebehind="Advertise_AddAD_Manage.aspx.cs" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title><%=Application["PageTitle"]%></title>
    <link href="../images/Admin_Style.css" rel="stylesheet" type="text/css" />
    <div id='dHTMLADPreview' style='z-index: 1000; left: 0px; visibility: hidden; width: 10px;
        position: absolute; top: 0px; height: 10px'>
    </div>

    <script language='JavaScript' type="text/javascript">
<!--
var tipTimer;
function locateObject(n, d)
{
   var p,i,x;
   if (!d) d=document;
   if ((p=n.indexOf('?')) > 0 && parent.frames.length)
   {d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
   if (!(x=d[n])&&d.all) x=d.all[n]; 
   for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
   for (i=0;!x&&d.layers&&i<d.layers.length;i++) x=locateObject(n,d.layers[i].document); return x;
}
function ShowADPreview(ADContent)
{
  showTooltip('dHTMLADPreview',event, ADContent, '#ffffff','#000000','#000000','6000')
}
function showTooltip(object, e, tipContent, backcolor, bordercolor, textcolor, displaytime)
{
   window.clearTimeout(tipTimer)
   if (document.all) {
       locateObject(object).style.top=document.body.scrollTop+event.clientY+20
       locateObject(object).innerHTML='<table style="font-family:宋体; font-size: 9pt; border: '+bordercolor+'; border-style: solid; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; background-color: '+backcolor+'" width="10" border="0" cellspacing="0" cellpadding="0"><tr><td nowrap><font style="font-family:宋体; font-size: 9pt; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table> '
       if ((e.x + locateObject(object).clientWidth) > (document.body.clientWidth + document.body.scrollLeft)) {
           locateObject(object).style.left = (document.body.clientWidth + document.body.scrollLeft) - locateObject(object).clientWidth-10;
       } else {
           locateObject(object).style.left=document.body.scrollLeft+event.clientX
       }
       locateObject(object).style.visibility='visible';
       tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
       return true;
   } else if (document.layers) {
       locateObject(object).document.write('<table width="10" border="0" cellspacing="1" cellpadding="1"><tr bgcolor="'+bordercolor+'"><td><table width="10" border="0" cellspacing="0" cellpadding="0"><tr bgcolor="'+backcolor+'"><td nowrap><font style="font-family:宋体; font-size: 9pt; color: '+textcolor+'">'+unescape(tipContent)+'</font></td></tr></table></td></tr></table>')
       locateObject(object).document.close()
       locateObject(object).top=e.y+20
       if ((e.x + locateObject(object).clip.width) > (window.pageXOffset + window.innerWidth)) {
           locateObject(object).left = window.innerWidth - locateObject(object).clip.width-10;
       } else {
           locateObject(object).left=e.x;
       }
       locateObject(object).visibility='show';
       tipTimer=window.setTimeout("hideTooltip('"+object+"')", displaytime);
       return true;
   } else {
       return true;
   }
}
function hideTooltip(object) {
    if (document.all) {
        locateObject(object).style.visibility = 'hidden';
        locateObject(object).style.left = 1;
        locateObject(object).style.top = 1;
        return false;
    } else {
        if (document.layers) {
            locateObject(object).visibility = 'hide';
            locateObject(object).left = 1;
            locateObject(object).top = 1;
            return false;
        } else {
            return true;
        }
    }
}
//-->
    </script>

    <script language="javascript" type="text/javascript">
function CheckItem(CB){
  if(document.myform.chkAll.checked){
    document.myform.chkAll.checked = document.myform.chkAll.checked&0;
  }
  if (CB.checked)
    hL(CB);
  else
    dL(CB);
  var TB=TO=0;
  for (var i=0;i<myform.elements.length;i++) {
    var e=myform.elements[i];
    if ((e.name != 'chkAll') && (e.type=='checkbox')) {
      TB++;
      if (e.checked) TO++;
    }
  }
  myform.chkAll.checked=(TO==TB)?true:false;
}
function CheckAll(form){
  for (var i=0;i<form.elements.length;i++){
    var e = form.elements[i];
    if (e.name != 'chkAll' && e.disabled == false && e.type == 'checkbox') {
      e.checked = form.chkAll.checked;
      if (e.checked)
        hL(e);
      else
        dL(e);
    }
  }
}

function hL(E){
  while (E.tagName!='TR') {E=E.parentElement;}
  E.className='tdbg2';
}
function dL(E){
  while (E.tagName!='TR') {E=E.parentElement;}
  E.className='tdbg';
}

    </script>

</head>
<body>
    <form id="myform" runat="server">
        <div>
            <table align="center" border="0" cellpadding="2" cellspacing="1" class="border" width="100%">
                <tr class="topbg">
                    <td colspan="10" height="22">
                        <table width="100%">
                            <tr class="topbg">
                                <td align="center">
                                    <b>网 站 广 告 管 理</b></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr class="tdbg">
                    <td height="30" width="70">
                        <strong>管理导航：</strong></td>
                    <td>
                        <a href="Advertise_AddZone_Manage.aspx">广告版位管理</a> |&nbsp; <a href="Advertise_AddZone.aspx">
                            添加新版位</a> |&nbsp; <a href="Advertise_AddAD_Manage.aspx">网站广告管理</a> |&nbsp; <a href="Advertise_AddAD.aspx">
                                添加新广告</a> |</td>
                </tr>
            </table>
            <br />
            <table align="center" border="0" cellpadding="2" cellspacing="1" class="border" width="100%">
                <tr class="topbg" height="22">
                    <td width='30' align='center'>
                        <strong>选中</strong></td>
                    <td width='30' align='center'>
                        <strong>ID</strong></td>
                    <td width='65' align='center'>
                        <strong>预览图片</strong></td>
                    <td align='center'>
                        <strong>广告名称</strong></td>
                    <td width='60' align='center'>
                        <strong>广告类型</strong></td>
                    <td width='40' align='center'>
                        <strong>权重</strong></td>
                    <td width='50' align='center'>
                        <strong>点击数</strong></td>
                    <td width='50' align='center'>
                        <strong>浏览数</strong></td>
                    <td width='40' align='center'>
                        <strong>已审核</strong></td>
                    <td width='150' align='center'>
                        <strong>操作</strong></td>
                </tr>
                <asp:Repeater ID="RP1" runat="server">
                    <ItemTemplate>
                        <tr class='tdbg' onmouseout="this.className='tdbg'" onmouseover="this.className='tdbgmouseover'">
                            <td width='30' align='center'>
                                <asp:CheckBox ID="CheckBox1" runat="server" ToolTip='<%#Eval("id") %>' /></td>
                            <td width='30' align='center'>
                                <%#Eval("id") %>
                            </td>
                            <td width='65' align='center'>
                                <a onmouseover="ShowADPreview('<img src=<%#Eval("ImgUrl") %>>')" onmouseout="hideTooltip('dHTMLADPreview')"
                                    href='?Action=PreviewZone&ADID=<%#Eval("id") %>' title='<%#Eval("ADIntro") %>'>预览</a>
                            </td>
                            <td>
                                <%#Eval("ADName") %>
                            </td>
                            <td width='60' align='center'>
                                <%#Eval("ADTypeText") %>
                            </td>
                            <td width='40' align='center'>
                                <%#Eval("Priority") %>
                            </td>
                            <td width='50' align='center'>
                                <font color='#999999'>
                                    <%#Eval("Views") %>
                                </font>
                            </td>
                            <td width='50' align='center'>
                                <font color='#999999'>
                                    <%#Eval("Clicks") %>
                                </font>
                            </td>
                            <td width='40' align='center'>
                                <b>
                                    <%#Eval("Passed") %>
                                </b>
                            </td>
                            <td width='150' align='center'>
                                <a href='Advertise_AddAD.aspx?Action=ModifyAD&ADID=<%#Eval("id") %>'>修改</a> <a href='?Action=DelAD&ADID=<%#Eval("id") %>'
                                    onclick="return confirm('确定要删除此广告吗？');">删除</a> <a href='?Action=SetADPassed&ADID=<%#Eval("id") %>'>
                                        审核/取消</a>
                            </td>
                        </tr>
                    </ItemTemplate>
                </asp:Repeater>
            </table>
            <input id="chkAll" name="chkAll" onclick="CheckAll(this.form)" type="checkbox" value="checkbox" />
            <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="删除选定版位" />
            <table border="0" cellpadding="0" cellspacing="0" width="100%">
                <tr>
                    <td height="18" width="669">
                        共<b>
                            <asp:Label ID="LbRecord" runat="server" ForeColor="Red"></asp:Label>
                        </b>条记录 页数:
                        <asp:Label ID="CurrentPage" runat="server" ForeColor="Red"></asp:Label>
                        /
                        <asp:Label ID="TotalPage" runat="server" ForeColor="Red"></asp:Label>
                        页 <b>
                            <asp:Label ID="LbPageRecord" runat="server"></asp:Label>
                        </b>篇文章/页
                        <asp:HyperLink ID="Linkhead" runat="server">首页</asp:HyperLink>
                        <asp:HyperLink ID="LinkPrev" runat="server">上一页</asp:HyperLink>
                        <asp:HyperLink ID="LinkNext" runat="server">下一页</asp:HyperLink>
                        <asp:HyperLink ID="LinkFoot" runat="server">尾页</asp:HyperLink></td>
                </tr>
            </table>
            <br />
            <table border="0" cellpadding="3" cellspacing="1" width="100%">
                <tr>
                    <td class="topbg">
                        <div align="center">
                            Copyright 2009-2019  <%=Application["PageTitle"] %> All Rights Reserved.</div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
