<%@ Page Language="C#" AutoEventWireup="true"
    Inherits="MyITJob.Admin_Advertise" Codebehind="Advertise_AddAD.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" />

    <script language="JavaScript" type="text/javascript">
<!--
function CheckForm()
{
  if(myform.ADName.value==''){
    alert('广告名称不能为空！');
    myform.ADName.focus();
    return false;
  }
  if(myform.ADType[2].checked == true && myform.ADText.value==''){
    alert('广告文本不能为空！');
    myform.ADText.focus();
    return false;
  }
  if(myform.ADType[3].checked == true && myform.ADCode.value==''){
    alert('广告代码不能为空！');
    myform.ADCode.focus();
    return false;
  }
  if(myform.Priority.value==''){
    alert('广告权重不能为空！');
    myform.Priority.focus();
    return false;
  }
}

function ADTypeChecked(i)
{
  document.myform.ADType[i].checked = true;
  Change_ADType();
}

function Change_ADType()
{
  for (var j=0;j<document.myform.ADType.length;j++){
    var ot = eval('document.all.ADContent_' + (j + 1) + '');
    if(document.myform.ADType[j].checked==true){
      ot.style.display = '';
    }
    else{
      ot.style.display = 'none';
    }
  }
}
//-->
    </script>

</head>
<body>
    <form id="myform" onsubmit='return CheckForm();' runat="server">
        <div>
            <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
                <tr class='topbg'>
                    <td height='22' colspan='10'>
                        <table width='100%'>
                            <tr class='topbg'>
                                <td align='center'>
                                    <b>网 站 广 告 管 理</b></td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr class='tdbg'>
                    <td width='70' height='30'>
                        <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 width='100%' border='0' align='center' cellpadding='0' cellspacing='0' class='border'>
                <tr class='title'>
                    <td height='22' colspan='2' class='topbg' align='center'>
                        <strong>广 告 属 性 设 置</strong></td>
                </tr>
                <tr align='center'>
                    <td class='tdbg' valign='top' width='255'>
                        <table width='100%' border='0' cellpadding='2' cellspacing='1'>
                            <tr>
                                <td align='center'>
                                    <b>所属版位</b></td>
                            </tr>
                            <tr>
                                <td>
                                    <asp:ListBox ID="Select1" runat="server" Height="360px" Width="250px"></asp:ListBox>
                                </td>
                            </tr>
                        </table>
                        <td valign='top'>
                            <table width='100%' border='0' cellpadding='2' cellspacing='1'>
                                <tr class='tdbg'>
                                    <td width='70' align='right'>
                                        <strong>广告名称：</strong></td>
                                    <td align="left">
                                        <input name='ADName' type='text' id='ADName' size='58' maxlength='50' value='' runat="server" />
                                        <font color='red'>*</font>
                                    </td>
                                </tr>
                                <tr class='tdbg'>
                                    <td width='70' align='right'>
                                        <strong>广告类型：</strong></td>
                                    <td align="left">
                                        <input type='radio' name='ADType' value='1' onclick='Change_ADType();' id="Radio1"
                                            runat="server" checked />
                                        图片&nbsp;&nbsp;
                                        <input type='radio' name='ADType' value='2' onclick='Change_ADType();' id="Radio2"
                                            runat="server" />
                                        动画&nbsp;&nbsp;
                                        <input type='radio' name='ADType' value='3' onclick='Change_ADType();' id="Radio3"
                                            runat="server" />
                                        文本&nbsp;&nbsp;
                                        <input type='radio' name='ADType' value='4' onclick='Change_ADType();' id="Radio4"
                                            runat="server" />
                                        代码&nbsp;&nbsp;
                                        <input type='radio' name='ADType' value='5' onclick='Change_ADType();' id="Radio5"
                                            runat="server" />
                                        页面&nbsp;&nbsp;
                                        <input type='radio' name='ADType' value='6' onclick='Change_ADType();' id="Radio6"
                                            runat="server" />
                                        页面&nbsp;&nbsp;
                                    </td>
                                </tr>
                                <tr class='tdbg'>
                                    <td width='70' align='right'>
                                        <strong>广告内容：</strong></td>
                                    <td height='265' valign='top'>
                                        <table id='ADContent_1' width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'
                                            style='display: '>
                                            <tr align='center' class='tdbg2'>
                                                <td colspan='2'>
                                                    <strong>广告内容设置--图片</strong></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    图片地址：</td>
                                                <td align="left">
                                                    <input name='ImgUrl' type='text' id='ImgUrl' size='58' maxlength='255' runat="server" />
                                                    <br /><font color='red'>*如在“/AD”之前还有其他的路径，请删除。正确的路径应为/AD/UploadAdPic/xxx...</font>
                                                </td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    图片上传：</td>
                                                <td align="left">
                                                    <asp:FileUpload ID="FileUpload1" runat="server" Width="284px" />
                                                    <asp:Button ID="UpImgButton" runat="server" Text="上传" Height="20px" OnClick="UpImgButton_Click" /></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    图片尺寸：</td>
                                                <td align="left">
                                                    宽：
                                                    <input name='ImgWidth' type='text' id='ImgWidth' size='6' maxlength='5' value=''
                                                        runat="server" />
                                                    像素&nbsp;&nbsp;&nbsp;&nbsp; 高：
                                                    <input name='ImgHeight' type='text' id='ImgHeight' size='6' maxlength='5' value=''
                                                        runat="server" />
                                                    像素
                                                </td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    链接地址：</td>
                                                <td align="left">
                                                    <input name='LinkUrl' type='text' id='LinkUrl' size='58' maxlength='100' runat="server" />
                                                </td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    链接提示：</td>
                                                <td align="left">
                                                    <input name='LinkAlt' type='text' id='LinkAlt' value='' size='58' maxlength='50'
                                                        runat="server" />
                                                </td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    链接目标：</td>
                                                <td align="left">
                                                    <asp:RadioButtonList ID="LinkTarget" runat="server" RepeatDirection="Horizontal"
                                                        RepeatLayout="Flow">
                                                        <asp:ListItem Selected="True" Value="1">新窗口</asp:ListItem>
                                                        <asp:ListItem Value="0">原窗口</asp:ListItem>
                                                    </asp:RadioButtonList></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    广告简介：</td>
                                                <td align="left">
                                                    <textarea name='ADIntro' cols='48' rows='4' id='ADIntro' runat="server"></textarea>
                                                </td>
                                            </tr>
                                        </table>
                                        <table id='ADContent_2' width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'
                                            style='display: none'>
                                            <tr align='center' class='tdbg2'>
                                                <td colspan='2'>
                                                    <strong>广告内容设置--动画</strong></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    动画地址：</td>
                                                <td align="left">
                                                    <input name='FlashUrl' type='text' id='FlashUrl' size='58' maxlength='255' runat="server" />
                                                    <br /><font color='red'>*如在“/AD”之前还有其他的路径，请删除。正确的路径应为/AD/UploadAdPic/xxx...</font>
                                                </td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    动画上传：</td>
                                                <td align="left">
                                                    <asp:FileUpload ID="FileUpload_Flash" runat="server" Width="284px" />
                                                    <asp:Button ID="UpFlashButton" runat="server" Text="上传" Height="20px" OnClick="UpFlashButton_Click" /></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    动画尺寸：</td>
                                                <td align="left">
                                                    宽：
                                                    <input name='FlashWidth' type='text' id='FlashWidth' size='6' maxlength='5' value=''
                                                        runat="server" />
                                                    像素&nbsp;&nbsp;&nbsp;&nbsp; 高：
                                                    <input name='FlashHeight' type='text' id='FlashHeight' size='6' maxlength='5' value=''
                                                        runat="server" />
                                                    像素
                                                </td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    背景透明：</td>
                                                <td align="left">
                                                    <asp:RadioButtonList ID="FlashWmode" runat="server" RepeatDirection="Horizontal"
                                                        RepeatLayout="Flow">
                                                        <asp:ListItem Selected="True" Value="0">不透明</asp:ListItem>
                                                        <asp:ListItem Value="1">透明</asp:ListItem>
                                                    </asp:RadioButtonList></td>
                                            </tr>
                                        </table>
                                        <table id='ADContent_3' width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'
                                            style='display: none'>
                                            <tr align='center' class='tdbg2'>
                                                <td colspan='2'>
                                                    <strong>广告内容设置--文本</strong></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td colspan='2' align='center'>
                                                    <textarea name='ADText' cols='64' rows='15' id='ADText' runat="server"></textarea>
                                                </td>
                                            </tr>
                                        </table>
                                        <table id='ADContent_4' width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'
                                            style='display: none'>
                                            <tr align='center' class='tdbg2'>
                                                <td colspan='2'>
                                                    <strong>广告内容设置--代码</strong></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td colspan='2' align='center'>
                                                    <textarea name='ADCode' cols='64' rows='15' id='ADCode' runat="server"></textarea>
                                                </td>
                                            </tr>
                                        </table>
                                        <table id='ADContent_5' width='100%' border='0' cellpadding='2' cellspacing='1' bgcolor='#ffffff'
                                            style='display: none'>
                                            <tr align='center' class='tdbg2'>
                                                <td colspan='2'>
                                                    <strong>广告内容设置--页面</strong></td>
                                            </tr>
                                            <tr class='tdbg'>
                                                <td width='80' align='right'>
                                                    页面地址：</td>
                                                <td>
                                                    <textarea name='WebFileUrl' cols='48' rows='4' id='WebFileUrl' runat="server"></textarea>
                                                </td>
                                            </tr>
                                        </table>
                                    </td>
                                </tr>
                                <tr class='tdbg'>
                                    <td width='70' align='right'>
                                        <strong>广告权重：</strong></td>
                                    <td align="left">
                                        <input name='Priority' type='text' id='Priority' size='4' maxlength='3' value='1'
                                            runat="server" />
                                        <font color='red'>*</font> 此项为版位广告随机显示时的优先权，权重越大显示机会越大。
                                    </td>
                                </tr>
                                <tr class='tdbg'>
                                    <td width='70' align='right'>
                                        <strong>广告统计：</strong></td>
                                    <td align="left">
                                        &nbsp;统计浏览数：
                                        <input name='Views' type='text' id='Views' size='5' maxlength='6' value='0' runat="server" />
                                        &nbsp;&nbsp;&nbsp;&nbsp; &nbsp;统计点击数：
                                        <input name='Clicks' type='text' id='Clicks' size='5' maxlength='6' value='0' runat="server" />
                                    </td>
                                </tr>
                                <tr class='tdbg'>
                                    <td width='70' align='right'>
                                        <strong>审核状态：</strong></td>
                                    <td align="left">
                                        <input name='Passed' type='checkbox' id='Passed' value='yes' checked runat="server" />
                                        通过审核
                                    </td>
                                </tr>
                            </table>
                        </td>
                </tr>
            </table>
            <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1'>
                <tr>
                    <td height='40' colspan='2' align='center'>
                        &nbsp;<input type='submit' name='Submit' value=' 添 加 ' id="Submit1" onserverclick="Submit1_ServerClick"
                            runat="server" />
                    </td>
                </tr>
            </table>
            <table width='100%' border='0' align='center' cellpadding='2' cellspacing='1' class='border'>
                <tr class='tdbg'>
                    <td class="topbg">
                        <div align="center">
                            Copyright 2009-2019  <%=Application["PageTitle"] %> All Rights Reserved.</div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</body>
</html>
