<%@ Page Language="C#" MasterPageFile="Admin.Master" AutoEventWireup="true" CodeBehind="Termadd.aspx.cs" Inherits="Mvcb2b.admin.Termadd" Title="出版期数添加" ValidateRequest="false" %>
<%@ MasterType VirtualPath="Admin.Master" %>
<%@ Register src="controls/Yearselect.ascx" tagname="Yearselect" tagprefix="uc1" %>
<%@ Register src="controls/Monthselect.ascx" tagname="Monthselect" tagprefix="uc2" %>
<%@ Register src="controls/Dayselect.ascx" tagname="Dayselect" tagprefix="uc5" %>
<%@ Register src="controls/Upmappic.ascx" tagname="Upmappic" tagprefix="uc6" %>
<%@ Register src="controls/Upqipdf.ascx" tagname="Upqipdf" tagprefix="uc3" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<script type="text/javascript" src="Comja/up.js"></script>
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript">
function setCheckInstartdate(d) {
    document.getElementById("<%=startdate_txt.ClientID%>").value = d;
}
function setCheckInenddate(d) {
    document.getElementById("<%=enddate_txt.ClientID%>").value = d;
}
 function upqipdf() {
   var path=$("#ctl00_ContentPlaceHolder1_downpdf_txt_qipdf_txt").val();
   if (path!=""){alert("请先删除PDF文件！");return false;}
    <%if (Upfile!=null){ %>
    var upfile= "<%=Upfile%>";
	upfilebox(upfile);		
    return false;
    <%} %>
 }
$(document).ready(function () {
    var $dt = $('#uppic_rar .dt');
    var $dd = $('#uppic_rar .dd');
    $dt.each(function (n) {
        $(this).click(function () { /*点击时运行的函数*/
            if ($(this)[0].checked) {
                var nowobj = $(this)[0];
                $dt.each(function (j) {
                    if ($(this)[0] != nowobj) {
                        $(this)[0].checked = false;
                    }
                });
                $dd.slideUp(); /*全部关闭*/
                $($dd[n]).slideDown();
            }
        });
    });


    var $dtpdf = $('#uppdf_rar .dt');
    var $ddpdf = $('#uppdf_rar .dd');
    $dtpdf.each(function (n) {
        $(this).click(function () { /*点击时运行的函数*/
            if ($(this)[0].checked) {
                var nowobj = $(this)[0];
                $dtpdf.each(function (j) {
                    if ($(this)[0] != nowobj) {
                        $(this)[0].checked = false;
                    }
                });
                $ddpdf.slideUp(); /*全部关闭*/
                $($ddpdf[n]).slideDown();
            }
        });
    });

});
function Win_open(link) {
    window.open(link, '', 'top=200,left=450,width=550,height=380,scrollbars=yes,resizable=yes');
}
function makeqipage() {
        var qiid=$('#<%=id_txt.ClientID%>').val();
        if (qiid=="0")
        {
            $("#qipdfmake span").html("<strong style='color:red;'>请先保存出版刊期！</strong>");
            return false;
        }        
}
</script>
<div class="path">当前位置： <%=Data.Bkname %> >>  出版期数添加</div>
<h3><asp:Literal  ID="Literal1" runat="server"></asp:Literal></h3>
<table width="92%" border="0" class="editor" align="center" style="background-color:#f5f5f5;" cellpadding="3" cellspacing="1">     
<tr>
  <td colspan="2" class="bg_must" style="padding-left:18px;padding-top:4px;font-weight:bold;">必填选项</td>
  </tr>
<tr><td width="180" align="right"><span style="color: Red">*</span>本期开始日期：</td><td><asp:TextBox ID="startdate_txt" runat="server" Text="" Width="120px" style="vertical-align:middle"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="开始日期不能为空!" Display="None" ValidationGroup="Haosubmit" ControlToValidate="startdate_txt"></asp:RequiredFieldValidator>
 <a onclick="event.cancelBubble=true;" href="javascript:showCalendar('dimg1',false,'<%=startdate_txt.ClientID%>',null,'setCheckInstartdate')"><img src="calendar/timebtn.gif" alt="" width="34" height="21" style="vertical-align:middle" border="0" align="middle"  id="dimg1" /></a> <span style="color:#ccc;">&nbsp; 可直接输入日期如：2012-2-12</span> </td></tr>   
<tr><td align="right"><span style="color: Red">*</span>本期结束日期：</td><td><asp:TextBox ID="enddate_txt" runat="server" Text="" Width="120px" style="vertical-align:middle"></asp:TextBox> <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="结束日期不能为空!" Display="None" ValidationGroup="Haosubmit" ControlToValidate="enddate_txt"></asp:RequiredFieldValidator><a onclick="event.cancelBubble=true;" href="javascript:showCalendar('dimg2',false,'<%=enddate_txt.ClientID%>',null,'setCheckInenddate')"><img src="calendar/timebtn.gif" alt="" width="34" height="21" style="vertical-align:middle" border="0" align="middle"  id="dimg2" /></a></td></tr>
<tr><td align="right"><span style="color: Red">*</span>总第：</td><td><asp:TextBox ID="totalqi_txt" runat="server" Text="" Width="30px" ValidationGroup="Haosubmit"></asp:TextBox>期 <span style="color:#ccc;">前台按此编号排序</span><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="总第多少期不能为空" Display="None" ValidationGroup="Haosubmit" ControlToValidate="totalqi_txt"></asp:RequiredFieldValidator>
           <asp:comparevalidator id="comparevalidator2" runat="server" ErrorMessage="总第多少期只能为数字!" ControlToValidate="totalqi_txt"	ValidationGroup="Haosubmit" Display="None" Type="Integer" Operator="DataTypeCheck"></asp:comparevalidator>
&nbsp;今年第<asp:TextBox ID="y_qi_txt" runat="server" Text="" Width="30px"></asp:TextBox>期</td></tr>
<tr><td align="right"><span style="color: Red">*</span>发行日期：</td><td><uc1:Yearselect ID="year_txt"  runat="server"  />年 <uc2:Monthselect  ID="month_txt" runat="server" />月 <uc5:Dayselect ID="day_txt" runat="server" />日 </td></tr>
<tr><td align="right">属性：</td>
<td>
<asp:CheckBox ID="isshow_txt" runat="server" /> <span style="color:#108410;">前台显示</span> &nbsp;
</td>
</tr>
<tr>
  <td colspan="2"  class="bg_must" style="padding-left:18px;padding-top:4px;font-weight:bold;">选填选项</td>
</tr>
<tr><td align="right" valign="top">封面图片：</td>
<td><uc6:Upmappic ID="Upmappic1" runat="server" />    <span style="color:Gray">仅对期刊杂志</span>
</td></tr>
<tr><td align="right">封面链接：</td>
<td><asp:TextBox ID="qilink_txt" runat="server" Text="" Width="150px"></asp:TextBox>
   <span style="color:Gray">仅对期刊杂志</span>
</td>
</tr>

<%--
<tr><td align="right" valign="top">在线下载（打包图片）：</td>
<td>请上传本期所有图片打包文件：<br />
<table width="100%" border="0" id="uppic_rar" cellspacing="0" cellpadding="0">
  <tr>
    <td><input name="downpic" id="downpic1" type="checkbox" class="dt" checked="checked" value="0" /> 直接上传</td>
  </tr>
  <tr id="forup1"  class="dd">
    <td><uc3:Upallfiles ID="downpic_txt" runat="server" /></td>
  </tr>
  <tr>
    <td><input name="downpic" id="downpic2" type="checkbox" class="dt" value="1" /> 浏览已上传文件
    <span style="color:Gray;">(可浏览用FTP软件批量上传的文件 如：Img/2011/10/qipic6.rar)</span>
    </td>
  </tr>
  <tr id="forup2" class="seeno dd">
    <td>
    <div style="width:100%;height:24px;line-height:24px;">
    <div style="width:258px;float:left;"><input type="text" value="" name="downpic_txt2" style="width:250px;" id="downpic_txt2"  /></div>
    <div style="width:51px;float:left;"> <a class="browse" href="javascript:Win_open('FileBrowse.aspx?n=downpic_txt2');" title="点击此处浏览已上传到服务器文件.."><span>浏览</span></a></div>
    </div>
    <div id="downpic_txt2_img"></div></td>
  </tr>
  <tr >
    <td><input name="downpic" id="downpic3"  type="checkbox" class="dt" value="2" /> 直接输入在线下载文件网址</td>
  </tr>
  <tr id="forup3" class="seeno dd">
    <td><input type="text" value="http://" style="width:250px;" name="downpicurl_txt" id="downpicurl_txt"  /></td>
  </tr>
</table></td>
</tr>--%>

<tr><td align="right" valign="top">在线下载（打包PDF）：</td>
<td>请上传本期所有<%=Mvcbll.Share.BkType.Pagename%>PDF打包文件：<br />
<table width="100%" border="0" id="uppdf_rar" cellspacing="0" cellpadding="0">
  <tr>
    <td><input name="downpdf" id="downpdf1" type="checkbox" class="dt" checked="checked" value="0" /> 直接上传</td>
  </tr>

<tr id="forpdfup1"  class="dd"><td  style="position:relative;">
  <uc3:Upqipdf ID="downpdf_txt" runat="server" />  
 <div class="make" id="qipdfmake" style="top:-7px;left:435px;"><a href="javascript:void(0);" onclick="makeqipage();" title="一键自动生成版面" >一键发布</a> <span></span> </div>
 </td></tr> 


  <tr>
    <td><input name="downpdf" id="downpdf2" type="checkbox" class="dt" value="1" /> 浏览已上传PDF文件包
    <span style="color:Gray;">(可浏览用FTP软件批量上传的文件 如：Img/2011/10/qipdf6.pdf)</span>
    </td>
  </tr>
  <tr id="forpdfup2" class="seeno dd">
    <td>
    <div style="width:100%;height:24px;line-height:24px;">
    <div style="width:308px;float:left;"><input type="text" value="" name="downpdf_txt2" style="width:300px;" id="downpdf_txt2"  /></div>
    <div style="width:51px;float:left;"> <a class="browse" href="javascript:Win_open('FileBrowse.aspx?n=downpdf_txt2');" title="点击此处浏览已上传到服务器文件.."><span>浏览</span></a></div>
    </div>
    <div id="downpdf_txt2_img"></div></td>
  </tr>
  <tr >
    <td><input name="downpdf" id="downpdf3"  type="checkbox" class="dt" value="2" /> 直接输入在线下载PDF文件包网址</td>
  </tr>
  <tr id="forpdfup3" class="seeno dd">
    <td><input type="text" value="http://" style="width:300px;" name="downpdfurl_txt" id="downpdfurl_txt2"  /></td>
  </tr>
</table></td>
</tr>


<tr><td colspan="2" align="center">
<asp:HiddenField ID="id_txt" runat="server" />
<asp:Button ID="Add" runat="server" Text="添加" Width="58px"  ValidationGroup="Haosubmit" onclick="Add_Click" />&nbsp;<asp:validationsummary id="ValidationSummary1"  runat="server" ShowMessageBox="True" ShowSummary="False"  ValidationGroup="Haosubmit"></asp:validationsummary> <input type="button" value="返回" name="go" style="width:58px;" onclick="javascript:history.go(-1);"  /></td></tr>
</table>

 <div class="help">
    <h4>? 帮助</h4>
        <ul>        
        <li>1. 请不要添加两期以上的空期（即不要添加没有版面内容的刊期），否则过多空期会导致前台找不到报刊内容而提示出错.</li>
        <li>2. 前台在线下载默认为PDF打包下载.</li>
        <li>3. 本处一键发布仅能自动发布生成版面图片，不包括文章内容的自动发布.</li>
        <li>4. 杂志支持：1,2,3,4,5,6……end/1,2-3,4-5,6-7,8……end；杂志首页和尾页必须为单页，对开页只能是偶数开头。</li>
        </ul>
   </div>  
</asp:Content>
