<%@ Page Language="C#" AutoEventWireup="true" EnableEventValidation="false" CodeBehind="downloadadd.aspx.cs"
    Inherits="FangPage.Admin.downloadadd" %>

<%@ Register Assembly="FangPage.Control" Namespace="FangPage.Control" TagPrefix="cc1" %>
<!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/style.css" type="text/css" rel="stylesheet">
    <style type="text/css">
     body{
            background-image: url(images/main_bg.gif);
            background-repeat: repeat-x;
            background-color: #CEE7FC;
        }
    </style>

    <script language="javascript" type="text/javascript" src="../plugins/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">
		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("uploadfile.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">
     <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" Width="300" runat="server">
                        </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">
                        <asp:CheckBox ID="isindex" runat="server" Text="首页显示" ToolTip="ID:1" />
                        <asp:CheckBox ID="isrec" runat="server" Text="推荐" ToolTip="ID:2" />
                    </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="Stars" Width="300" runat="server">
                        </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:TextBox ID="Credits" Width="300" runat="server">
                        </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:TextBox ID="Filesize" Width="300" runat="server">
                        </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:TextBox ID="Fileid" Width="300"  runat="server">
                        </cc1:TextBox><asp:CheckBox ID="allowupload" runat="server" Text="本地上传" />
                    </td>
                </tr>
                <tr class="TdBgL" id="showdivs" style="display: none">
                    <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:FileUpload ID="uploadfile" CssClass="k" runat="server" Width="300px" />
                    </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="Downurl" Width="300" runat="server">
                        </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:TextBox ID="ShowUrl" Width="300" runat="server">
                        </cc1:TextBox>
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td style="padding-right: 3px; padding-left: 40px; 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: 250px;" colspan="2">
                        <input type="hidden" id="attachments" name="attachments" runat="server" />
                        <textarea id="Content" name="Content" style="display: none" runat="server"></textarea>
                        <iframe id="WebEditor" src="../editor/ewebeditor.aspx?id=Content&style=mini&sortid=<%=sortid%>&attachmentsid=attachments"
                            frameborder="0" scrolling="no" width="100%" height="250"></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">
                        <textarea id="Desc" name="Desc" runat="server" style="width: 99%" rows="4"></textarea>
                    </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" colspan="2" bgcolor="#f7f7f7" height="129" onclick="searchDoc()">
                                            <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="Postdatetime" runat="server"></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="Hidden" runat="server" Text="隐藏" />&nbsp;&nbsp;<asp:CheckBox ID="allowcomment"
                            runat="server" Text="允许评论" />
                    </td>
                </tr>
                <tr class="TdBgL">
                    <td height="35" style="width: 100px">
                        &nbsp;
                    </td>
                    <td style="padding-left: 10px">
                        &nbsp;
                        <cc1:Button ID="Button1" runat="server" OnClick="Button1_Click" />&nbsp;&nbsp;
                        <button class="ManagerButton" type="button" onclick="javascript:window.location.href='downloadmanage.aspx?sortid=<%=sortid%>';">
                            <img src="images/arrow_undo.gif" />返 回</button>
                    </td>
                </tr>
            </tbody>
        </table>
    </form>

    <script language="javascript" type="text/javascript">
       showdiv();
         function showdiv()
         {
            if(form1.allowupload.checked==true)
            {
                showdivs.style.display='block';
            }
            else
            {
                showdivs.style.display='none';
            }
         } 
    </script>
</body>
</html>
