<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/common.jsp"%>
<title>专题管理</title>
</head>
<link rel="stylesheet" type="text/css" href="${staticPath}webupload/progress.css">
<link rel="stylesheet" type="text/css" href="${staticPath}css/jquery.datetimepicker.css" />
<body>
<%@ include file="../common/head.jsp"%>
<div class="screen main">
    <%@ include file="../common/left.jsp" %>
    <div class="main-content">
   		<div class="main-title">
   		<c:if test="${type==0}">专题产品管理</c:if>
   		<c:if test="${type==1}">专题栏目管理</c:if>
   		</div>
        
        <form name="dataForm" class="search-form" action="export.do" method="post">
        <div class="search-group">
            <input type="hidden" id="type" name="type" value="${type}" />
            <c:if test="${type==0}">
	            <div class="search-item"><div class="label">产品名称：</div><input type="text" id="productName" name="productName" class="text {text:'请输入产品名称'}" value="${productName}" size="12"/></div>
	            <div class="search-item"><div class="label">品牌：</div><input type="text" id="brandName" name="brandName" class="text {text:'请输入品牌名称'}" value="${brandName}" size="12"/></div>
            </c:if>
            <c:if test="${type==1}">
	            <div class="search-item"><div class="label">栏目名称：</div><input type="text" id="productName" name="productName" class="text {text:'请输入栏目名称'}" value="${productName}" size="12"/></div>
	            <div class="search-item"><div class="label">内容：</div><input type="text" id="brandName" name="brandName" class="text {text:'请输入内容名称'}" value="${brandName}" size="12"/></div>
            </c:if>
            <div class="search-item"><div class="label">广告主：</div><input type="text" id="advMaster" name="advMaster" class="text {text:'请输入广告主'}" value="${advMaster}" size="12"/></div>
            <div class="search-item">
                <div class="label">播出环境：</div>
              <select id="showEnv" name="showEnv">
                  <option value="">请选择</option>
                  <option value="0">新闻</option>
                  <option value="1">电视剧</option>
                  <option value="2">广告片</option>
                  <option value="3">栏目</option>
                  <option value="4">宣传片</option>
                  <option value="5">小品</option>
                  <option value="6">电影</option>
                  <option value="7">天气预报</option>
                  <option value="8">动画片</option>
                  <option value="9">记录片</option>
              </select>
            </div>
         </div>   
         <div class="search-group">  
            <div class="search-item">
                <div class="label">播出媒体：</div>
                <select id="mediaName" name="mediaName">
                    <option value="">请选择</option>
                </select>
            </div>
            <div class="search-item"><div class="label">播出节目：</div><input type="text" id="tvName" name="tvName" class="text {text:'请输入播出节目'}" value="${tvName}" size="11"/></div>
            <div class="search-item"><div class="label">联系方式：</div><input type="text" id="phone" name="phone" class="text {text:'请输入联系方式'}" value="${phone}" size="11"  maxlength="20"/></div>
            <div class="search-item"><div class="label">播出日期：</div><div class="twoContent"><input type="text" name="showDateStart" id="showDateStart" class="text {text:'开始时间'}" size="7" /><span>-</span><input type="text" name="showDateEnd" id="showDateEnd" class="text {text:'结束时间'}" size="7" /></div></div>
         </div>
         <div class="search-group">     
            <div class="search-item"><div class="label">播出时间：</div><div class="twoContent"><input type="text" name="showTimeStart" id="showTimeStart" class="text {text:'开始日期'}"  size="7"/><span>-</span><input type="text" name="showTimeEnd" id="showTimeEnd" class="text {text:'结束日期'}"  size="7"/></div></div>
            <div class="search-item"><div class="label">刊例(万)：</div><div class="twoContent"><input type="text" name="priceMin" id="priceMin" class="text {text:'最小刊例'}"  size="7"  onkeyup="isNumber(this)" maxlength="8" /><span>-</span><input  type="text" name="priceMax" id="priceMax" class="text {text:'最大刊例'}"  size="7"  onkeyup="isNumber(this)" maxlength="8"/></div></div>
            <div class="search-item"><div class="label">时长(分)：</div><div class="twoContent"><input type="text" name="showDurationMin" id="showDurationMin" class="text {text:'最小时长'}" size="7" onkeyup="isNumber(this)" maxlength="6"/><span>-</span><input  type="text" name="showDurationMax" id="showDurationMax" class="text {text:'最大时长'}" size="7" onkeyup="isNumber(this)" maxlength="6"/></div></div>                    
            <div class="search-item">
                <a href="javascript:void(0);" onclick="getList(1)" class="search-btn">搜 索</a>
            </div>          
         </div>
        </form>
        <div class="table-content">
			<div class="rFloat buttons">
				<c:if test="${type==0}">
					<c:if test="${funcMap['special_advertise_add'] eq 1}">
						<a href="javascript:platformModfiy('add','专题广告信息' ,'','${type}');" class="btn">+新增</a>
					</c:if>
					<c:if test="${funcMap['special_advertise_import_template'] eq 1}">
						<a href="${staticPath}excel/专题产品模板.xlsx" class="btn">下载模板</a>
					</c:if>
					<c:if test="${funcMap['special_advertise_import'] eq 1}">
						<span class="btn upfile">
							<form id="fileForm" action="import_excel.do?type=${type}" method="post" enctype="multipart/form-data" target="hframe">
								<span class="webuploader-pick">导入</span> <input type="file" name="excelfile" id="excelfile" onchange="importExcel()" ; />
								<input type="hidden" id="isSure" name="isSure">
							</form>
						</span>
					</c:if>
					<c:if test="${funcMap['special_advertise_export'] eq 1}">
						<a href="javascript:document.dataForm.submit();" class="btn">导出</a>
					</c:if>
				</c:if>

				<c:if test="${type==1}">
					<c:if test="${funcMap['special_platform_add'] eq 1}">
						<a href="javascript:platformModfiy('add','专题栏目信息' ,'','${type}');" class="btn">+新增</a>
					</c:if>
					<c:if test="${funcMap['special_platform_import_template'] eq 1}">
						<a href="${staticPath}excel/专题栏目模板.xlsx" class="btn">下载模板</a>
					</c:if>
					<c:if test="${funcMap['special_platform_import'] eq 1}">
						<span class="btn upfile">
							<form id="fileForm" action="import_excel.do?type=${type}" method="post" enctype="multipart/form-data" target="hframe">
								<span class="webuploader-pick">导入</span> <input type="file" name="excelfile" id="excelfile" onchange="importExcel()" ; />
								<input type="hidden" id="isSure" name="isSure">
							</form>
						</span>
					</c:if>
					<c:if test="${funcMap['special_platform_export'] eq 1}">
						<a href="javascript:document.dataForm.submit();" class="btn">导出</a>
					</c:if>
				</c:if>
			</div>
			已选 <span id="checkCount" class="orange">0</span> 条&nbsp;&nbsp;
			<c:if test="${funcMap['special_advertise_delete'] eq 1 and type == 0}">
				<a href="javascript:void(0);" onclick="delRecordBatch();" class="btn del">批量删除</a>
			</c:if>
			<c:if test="${funcMap['special_platform_delete'] eq 1 and type ==1}">
				<a href="javascript:void(0);" onclick="delRecordBatch();" class="btn del">批量删除</a>
			</c:if>
			<table class="table mTop10" cellpadding="0" cellspacing="0">
                <thead>
                <tr>
                    <th width="4%"><input type="checkbox" class="checkbox checkbox-white {click:checkAll}" name="all" value="" /></th>
                    <c:if test="${type==0}">
                       <th width="10%">产品名称</th>
                       <th width="10%">品牌</th>
                    </c:if>
                    <c:if test="${type==1}">
                       <th width="10%">栏目名称</th>
                       <th width="10%">内容</th>
                    </c:if>
                    <th width="8%">广告主</th>
                    <th width="8%">媒体</th>
                    <th width="8%">播出日期</th>
                    <th width="8%">播出时间</th>
                    <th width="8%">播出环境</th>
                    <th width="8%">播出节目</th>
                    <th width="8%">联系方式</th>
                    <th width="6%">时长(分)</th>
                    <th width="6%">刊例价格(万)</th>
                    <th width="8%">操作</th>
                </tr>
                </thead>
                <tbody id="list">
                </tbody>
            </table>
            <div class="mTop20">
                <div id="page" class="rFloat"></div>累计 <span id="count" class="blue">0</span> 条
            </div>
        </div>
    </div>
    <div class="clear"></div>
</div>
<iframe name="hframe" style="display: none;"></iframe>
<%@ include file="../common/footer.jsp"%>
<script type="text/javascript" src="${staticPath}webupload/webuploader.min.js"></script>
<script type="text/javascript" src="${staticPath}webupload/upload.js"></script>
<script type="text/javascript" src="${staticPath}js/adspecial/adspecial.js"></script>
<script type="text/javascript" src="${staticPath}js/common/jquery.datetimepicker.js"></script>
<script type="text/javascript">
var update_flag = "${type}" == 0 ? "${funcMap['special_advertise_update']}" : "${funcMap['special_platform_update']}", 
delete_flag = "${type}" == 0 ? "${funcMap['special_advertise_delete']}" : "${funcMap['special_platform_update']}";
$(function(){
    $.resetText();
    $(".text").input();
    $(".select").uiSelect();
    $("#showDateStart, #showDateEnd").datetimepicker();
    $("#showTimeStart, #showTimeEnd").datetimepicker({format: 'H:i', timepicker: true, datepicker: false, step:1 });
    // 获取数据
    getList(1);    
})
</script>