<%--
  Created by IntelliJ IDEA.
  User: admin
  Date: 2019/11/2
  Time: 11:24
  To change this template use File | Settings | File Templates.
--%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<% String base = pageContext.getServletContext().getContextPath(); %>
<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <script type="text/javascript">
        window.UEDITOR_SERVER_URL = '<%=base%>';
    </script>
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="Bookmark" href="/favicon.ico" >
    <link rel="Shortcut Icon" href="/favicon.ico" />
    <!--[if lt IE 9]-->
    <script type="text/javascript" src="${pageContext.request.contextPath}/lib/html5shiv.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/lib/respond.min.js"></script>
    <!--[endif]-->
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/css/style.css" />
    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/h-ui.admin/css/page.css" />
    <link href="${pageContext.request.contextPath}/static/admin/css/page.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/h-ui.admin/js/H-ui.admin.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/laydate/laydate.js"></script>
    <script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/index/layer/layer.js"></script>
    <!--[if IE 6]-->
    <script type="text/javascript" src="${pageContext.request.contextPath}/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
    <script>DD_belatedPNG.fix('*');</script>
    <title>后台管理</title>
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i>首页<span class="c-gray en">&gt;</span>手机Banner管理<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
    <form action="${pageContext.request.contextPath}/admin/submit_upBanners_en.html" method="post" class="form form-horizontal" id="form-article-add" enctype="multipart/form-data">
        <input type="hidden" value="${banners.id}" name="id">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="name" value="${banners.name}">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>外链路径：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="text" class="input-text" name="hrefs" value="${banners.hrefs}" <c:if test="${banners.identity==1}">readonly</c:if> >
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">轮播图：</label>
            <div class="formControls col-xs-8 col-sm-4">
                <input type="file" class="input-text" name="filename" accept="image/*" id="geiBa" value="${banners.img}">
            </div>
            <div class="formControls col-xs-8 col-sm-2">
                <img alt="" src="${banners.img}" width="60" height="60" id="showIpt">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>排序值：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input type="number" class="input-text" name="sort" value="${banners.sort}">&nbsp;&nbsp;&nbsp;&nbsp;<span class="c-red">*排序值越大,越先展示</span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>添加时间：</label>
            <div class="formControls col-xs-8 col-sm-4">
                <input id="test1" class="input-text" name="time" style="width:160px;" value="${banners.time}">
            </div>
        </div>


        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button class="btn btn-primary radius" type="submit" > <i class="Hui-iconfont">&#xe632;</i>提交</button>
                <button  id="removeIframe" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
            </div>
        </div>
    </form>
</div>
</div>
<script type="text/javascript" src="${pageContext.request.contextPath}/static/admin/js/ajaxfileupload.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/lib/jquery.validation/1.14.0/messages_zh.js"></script>

<script type="text/javascript">

    $("#removeIframe").click(function () {
        window.location.href='banners_list_en.html';
    })

    //更改图片后显示
    $("#geiBa").change(function () {
        var num = URL.createObjectURL(this.files[0]);
        $("#showIpt").attr("src", num).show();
    });

    //验证表单不能为空
    $(function() {
        $("#form-article-add").validate({
            rules: {
                name: {
                    required: true,
                },
                hrefs: {
                    required: true,
                },
                sort: {
                    required: true,
                },
                time: {
                    required: true,
                },
            },
            onkeyup: false,
            focusCleanup: true,
            success: "valid"
        });
    });

    laydate.render({
        elem: '#test1'
        ,type: 'datetime'
    });


</script>

</body>
</html>
