<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="advsedit.aspx.cs" Inherits="Focus.Admin.advsedit" %>

<%@ Register TagPrefix="cc1" Namespace="Focus.Control" Assembly="Focus.Control" %>
<!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 id="Head1" runat="server">
    <title>编辑广告</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <link href="styles/calendar.css" type="text/css" rel="stylesheet" />
    <link href="styles/style.css" type="text/css" rel="stylesheet">

    <script language="javascript" type="text/javascript" src="../calendar/WdatePicker.js"></script>

    <script language="javascript" type="text/javascript" src="js/ajax.js"></script>

    <script language="javascript" type="text/javascript" src="js/main.js"></script>

    <script language="javascript" type="text/javascript" src="js/auction.js"></script>

    <script language="javascript" type="text/javascript">
		function searchDoc(){
	        var ret = window.showModalDialog("attachimglist.aspx?aidlist="+$("attachments").value,"","dialogWidth:630px;status:no;status:no;dialogHeight:635px;scrollbars:no");
	        try
	        {
	            if(ret.filename!=""){
		            $("DefaultPic").value=ret.filename;
		            $("titleimg").src=ret.sfilename;
	            }
	        }
	        catch(e){}
        }
        
        function UploadDoc(){
	        var ret = window.showModalDialog("uploadimg.aspx?type=image&sortid=<%=sortid%>","","dialogWidth:450px;status:no;status:no;dialogHeight:200px;scrollbars:no");
	        try
	        {
	            if(ret.aid!="")
	            {
	              if ($("attachments").value!=""){
				       $("attachments").value = $("attachments").value + ",";
			      }
			      $("attachments").value = $("attachments").value + ret.aid;
	            }
	            
	            if(ret.filename!=""){
		            $("DefaultPic").value=ret.filename;
		            $("titleimg").src=ret.sfilename;
	            }
	        }
	        catch(e){}
        }
    </script>

    <meta content="MSHTML 6.00.3790.0" name="GENERATOR" />
</head>
<body leftmargin="5" topmargin="5" rightmargin="5" bottommargin="5" background="Images/main_bg.gif">
    <form id="Form1" runat="server">
    <table class="TdBg" cellspacing="1" cellpadding="0" width="100%" border="0">
        <tbody>
            <tr valign="middle">
                <td class="Tdimg" style="padding-left: 10px" height="28" colspan="2">
                    <img height="18" src="images/bbs_find.gif" width="18" align="absMiddle" border="0">
                    <strong>编辑广告，所在栏目：<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label></strong>
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                    广告标题：
                </td>
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                    <cc1:TextBox ID="title" runat="server" RequiredFieldType="暂无校验" CanBeNull="必填" Width="300"></cc1:TextBox>
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                    分类：
                </td>
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                    <cc1:DropDownList ID="typeid" runat="server">
                    </cc1:DropDownList>
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                    显示顺序：
                </td>
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                    <cc1:TextBox ID="displayorder" runat="server" CanBeNull="必填" RequiredFieldType="数据校验"
                        Text="0" Width="100"></cc1:TextBox>
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 3px; padding-left: 20px; padding-bottom: 3px; padding-top: 3px"
                    height="22" align="left" colspan="2">
                    广告内容：
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px;
                    height: 350px;" colspan="2">
                    <input type="hidden" id="attachments" name="attachments" runat="server" />
                    <textarea id="Content" name="Content" style="display: none" runat="server"></textarea>
                    <iframe id="Iframe1" src="../editor/ewebeditor.aspx?id=Content&style=coolblue&sortid=<%=sortid%>&attachmentsid=attachments"
                        frameborder="0" scrolling="no" width="100%" height="350"></iframe>
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                    广告图片：
                </td>
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                    <div style="margin-left: 5px; width: 160px; margin-right: 5px">
                        <table style="margin-top: 1px; margin-bottom: 1px" cellspacing="0" cellpadding="0"
                            width="160" align="center" border="0">
                            <tbody>
                                <tr>
                                    <td style="border-right: #ccc 1px solid; border-top: #ccc 1px solid; border-left: #ccc 1px solid;
                                        border-bottom: #ccc 1px solid;cursor:hand" bgcolor="#f7f7f7" height="129" onclick="searchDoc()" colspan="2">
                                        <div align="center">
                                            <img id="titleimg" alt="广告图片" style="max-height:105px; max-width:140px;" onerror="this.src='images/none.gif'" src="" border="0"></div>
                                    </td>
                                </tr>
                                <tr>
                                    <td style="padding-left: 5px" height="22" align="center">
                                        <a href="javascript:searchDoc()">选择</a>
                                    </td>
                                    <td style="padding-left: 5px" height="22" align="center">
                                            <a href="javascript:UploadDoc()">上传</a>
                                        </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <input type="hidden" id="DefaultPic" name="DefaultPic" runat="server" />
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                    链接地址：
                </td>
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                    <cc1:TextBox ID="url" runat="server" RequiredFieldType="暂无校验" CanBeNull="可为空" Size="60"
                        MaxLength="50"></cc1:TextBox>
                </td>
            </tr>
            <tr class="TdBgL">
                <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                    期限限制：
                </td>
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                    <asp:CheckBox ID="allowdatetime" runat="server" Text="是否使用期限限制 " />
                </td>
            </tr>
        </tbody>
    </table>
    <div id="showdatetime" style="width: 100%; display: none">
        <table class="TdBg" cellspacing="1" cellpadding="0" width="100%" border="0">
            <tbody>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        开始时间：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:Calendar ID="starttime" runat="server" ReadOnly="False" ScriptPath="js/calendar.js">
                        </cc1:Calendar>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                        结束时间：
                    </td>
                    <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                        <cc1:Calendar ID="endtime" runat="server" ReadOnly="False" ScriptPath="js/calendar.js">
                        </cc1:Calendar>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <table class="TdBg" cellspacing="1" cellpadding="0" width="100%" border="0">
        <tbody>
            <tr class="TdBgL">
                <td style="padding-right: 10px; width: 100px;" height="22" align="right">
                    状态：
                </td>
                <td style="padding-right: 3px; padding-left: 3px; padding-bottom: 3px; padding-top: 3px">
                    <cc1:RadioButtonList ID="status" runat="server" RepeatColumns="3">
                        <asp:ListItem Value="0" Selected="True">未审核</asp:ListItem>
                        <asp:ListItem Value="1">审核通过</asp:ListItem>
                        <asp:ListItem Value="2">审核未通过</asp:ListItem>
                    </cc1:RadioButtonList>
                </td>
            </tr>
            <tr class="TdBgL">
                <td height="35" style="width: 100px">
                    &nbsp;
                </td>
                <td style="padding-left: 10px">&nbsp;
                    <cc1:Button ID="AddAdInfo" runat="server" Text=" 提 交 " OnClick="AddAdInfo_Click">
                    </cc1:Button>&nbsp;&nbsp;
                    <button class="ManagerButton" type="button" onclick="javascript:window.location.href='advsmanage.aspx?sortid=<%=sortid%>';">
                                    <img src="images/arrow_undo.gif" />返 回</button>
                </td>
            </tr>
        </tbody>
    </table>

    <script language="javascript" type="text/javascript">
         KL.GetThumbnail($("DefaultPic").value);
         showdatetimes();
         function showdatetimes()
         {
            if(Form1.allowdatetime.checked==true)
            {
		        showdatetime.style.display='block';
            }
            else
            {
                showdatetime.style.display='none';
            }
         } 
    </script>

    </form>
</body>
</html>
