<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/common.jsp"%>
<title>品牌植入详情</title>
</head>
<body>
<%@ include file="../common/head.jsp"%>
<div class="screen main">
    <%@ include file="../common/left.jsp" %>
    <div class="main-content">
        <div class="btn-radius">品牌植入详情</div>
        <form id="dataForm" method="post">
        <ul class="ulFrm mTop10">
            <li>
                <span class="label"><em>*</em>&nbsp;品牌</span>
                <div class="select selectW200 {width:200,onchange:onchangeByBrand}">
                    <select name="brand">
                        <option value="">请选择品牌</option>
	                    <c:forEach items="${brandList}" var="item">
                            <option value="${item.brand}" <c:if test="${map.brand == item.brand}"> selected="selected"</c:if> >${item.brand}</option>
	                    </c:forEach>
                    </select>
                </div>
            </li>
            <li>
                <span class="label"><em>*</em>&nbsp;型号</span>
                <div class="select selectW200 {width:200}">
                    <select name="model">
                        <option value="">请选择型号</option>
                        <c:forEach items="${modelList}" var="item">
                            <option value="${item.model}" <c:if test="${map.model == item.model}"> selected="selected"</c:if> >${item.model}</option>
                        </c:forEach>
                    </select>
                </div>
            </li>
            <li>
                <span class="label"><em>*</em>&nbsp;节目类型</span>
                <input type="radio" name="type" class="radio {click:brandType}" value="1" <c:if test="${empty map.type || map.type == 1}">checked="checked"</c:if> /><label>综艺</label>&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="type" class="radio {click:brandType}" value="2" <c:if test="${map.type == 2}">checked="checked"</c:if> /><label>栏目</label>&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="type" class="radio {click:brandType}" value="3" <c:if test="${map.type == 3}">checked="checked"</c:if> /><label>电视剧</label>&nbsp;&nbsp;&nbsp;&nbsp;
                <input type="radio" name="type" class="radio {click:brandType}" value="4" <c:if test="${map.type == 4}">checked="checked"</c:if> /><label>电影</label>
            </li>
            <li>
                <span class="label"><em>*</em>&nbsp;节目名称</span>
                <div class="select selectW200 {width:200,onchange:onchangeByProgramName}">
                    <select name="programName" id="programName">
                        <option value="">请选择节目</option>
                        <c:forEach items="${programNameList}" var="item">
                            <option value="${item.programName}" <c:if test="${map.programName == item.programName}"> selected="selected"</c:if> >${item.programName}</option>
                        </c:forEach>
                    </select>
                </div>
            </li>
            <li class="tv<c:if test="${map.type != 3}"> contentTxt</c:if>">
                <span class="label"><em>*</em>&nbsp;集数</span>
                <div class="select selectW200">
                    <select name="episode" id="episode">
                        <option value="">请选择集数</option>
                    </select>
                </div>
            </li>
            <li class="column<c:if test="${not empty map.type && map.type != 1}"> contentTxt</c:if>">
                <span class="label"><em>*</em>&nbsp;年份/季</span>
                <div class="select {onchange:onchangeByShowYear}">
                    <select name="showYear" id="showYear">
                        <option value="">年份/季</option>
                    </select>
                </div>
                <span class="label">&nbsp;&nbsp;<em>*</em>&nbsp;期数</span>
                <div class="select">
                    <select name="showPhase" id="showPhase">
                        <option value="">期数</option>
                    </select>
                </div>
            </li>
            <li class="column<c:if test="${not empty map.type && map.type != 1}"> contentTxt</c:if>">
                <span class="label"><em>*</em>&nbsp;广告形式</span>
                <c:forEach items="${formList}" var="item">
                    <input type="checkbox" name="form" class="checkbox" value="${item.id}" <c:if test="${fn:contains(map.form,item.id)}">checked="checked"</c:if> /><label>${item.val}</label>
                </c:forEach>
            </li>
            <li>
                <span class="label">预计金额</span>
                <input type="text" name="price" class="text {text:'请输入金额'}" value="${map.price}" /> 万
            </li>
            <li>
                <div class="clear-table-float">
                    <a href="javascript:placementModfiy('add','植入方式');" class="btn rFloat">+添加</a>
                    <span class="label"><em>*</em>&nbsp;植入方式</span>
                </div>
                <table class="table mTop10" cellpadding="0" cellspacing="0">
                    <thead>
                        <tr>
                            <th>广告属性/植入方式</th>
                            <th class="nop">创意图</th>
                            <%--<th class="nop">创意视频</th>--%>
                            <th<c:if test="${map.type == 3 || map.type == 4}"> style="display:none;"</c:if>>广告语</th>
                            <th>频次(次)</th>
                            <th>时长(秒)</th>
                            <th width="98">操作</th>
                        </tr>
                    </thead>
                    <tbody>
                    <c:if test="${!empty sonList}">
                        <c:forEach items="${sonList}" var="item" varStatus="status">
                        <tr data-id="${item.id}" data-mode="${item.mode}" data-img="${item.imgUrls}" data-slogan="${item.slogan}" data-frequency="${item.frequency}" data-length="${item.length}">
                            <td>${item.modeName}</td>
                            <td class="nop" width="98">
                                <c:if test="${empty item.imgUrls}"><img src="" width="98" height="58" valign="middle" /></c:if>
                                <c:if test="${!empty item.imgUrls}">
                                    <c:set value="${ fn:split(item.imgUrls, ';') }" var="imgArr" />
                                    <img src="${imgArr[0]}" width="98" height="58" valign="middle" onerror="javascript:this.src='static/img/noimg.jpg';" />
                                </c:if>
                            </td>
                            <%--<td class="nop" width="98">
                                <c:if test="${empty item.videoUrls}"></c:if>
                                <c:if test="${!empty item.videoUrls}">
                                    <c:set value="${ fn:split(item.videoUrls, ';') }" var="videoArr" />
                                    <video src="${videoArr[0]}" controls="controls"/>
                                    &lt;%&ndash;<video controls>
                                        <source src="${videoArr[0]}"  type="video/mp4">
                                        <source src="${videoArr[0]}"  type="video/ogg">
                                        <source src="${videoArr[0]}"  type="video/webm">
                                    </video>&ndash;%&gt;
                                </c:if>
                            </td>--%>
                            <td<c:if test="${map.type == 3 || map.type == 4}"> style="display:none;"</c:if>>${item.slogan}</td>
                            <td>${item.frequency}</td>
                            <td>${item.length}</td>
                            <td class="edit">
                                <a href="javascript:placementModfiy('edit','植入方式', ${item.id}, ${status.index});">编辑</a>&nbsp;&nbsp;
                                <a class="del">删除</a>
                            </td>
                        </tr>
                        </c:forEach>
                    </c:if>
                    </tbody>
                </table>
            </li>
            <li class="center mTop20">
				<input type="button" name="" value="提交" onclick="save()" class="btn-radius max-btn" />
            </li>
        </ul>
        </form>
    </div>
    <div class="clear"></div>
</div>
<%@ include file="../common/footer.jsp"%>
<script type="text/javascript" src="${staticPath}js/advertise/brand_placement.js"></script>
<script type="text/javascript">
$(function(){
    $.resetText();
    $(".text").input();
    $(".select").uiSelect();
    $.radio();
    $.checkbox();
    onchangeByProgramName('${map.showYear}','${map.episode}');
    onchangeByShowYear('${map.showPhase}');
    $('a.del').on('click',function(){
		$(this).parent().parent().remove();
	})
})
</script>
</body>
</html>