<?= view('layout/header')->send(); ?>
<!--container start-->
<form method="post" id="cv_form_model_1">
    <div class="cv-fixed-global">
        <div class="easyui-layout" style="width: 100%;height: 100%;">
            <!--top start-->
            <div id="cv_archive_north_header">
                <div class="panel-title">
                    <a class="cv-tool easyui-linkbutton" href="javascript:saveForm();"> 提交审核</a>
                    <a class="easyui-linkbutton" href="javascript:closeSelf();"> 关闭</a>
                </div>
            </div>
            <!--center start-->
            <div border="false" header="#cv_archive_north_header" data-options="region:'center'" style="padding-top: 15px;overflow-x: hidden;background-color: #fefefe;">
                <div class="cv-archive-new-center" style="width: 800px;">
                    <div class="cv-input-box">
                        <label for="cv_title" required>项目名称</label>
                        <div class="controls">
                            <input class="cv-input-xlarge cv-input-rule" type="text" name="cv[title]" id="cv_title" />
                        </div>
                    </div>
                    <div class="cv-input-box">
                        <label for="cv_keywords" >关键词</label>
                        <div class="controls">
                            <input  type="text" name="cv[keywords]" id="cv_keywords" class="cv-input-large" />
                        </div>
                    </div>
                    <div class="cv-input-box">
                        <label for="cv_description" >项目介绍</label>
                        <div class="controls">
                            <textarea  rows="8" name="cv[description]" id="cv_description" class="cv-input-xlarge"></textarea>
                        </div>
                    </div>
                    <div class="cv-input-box">
                        <label for="cv_description" >项目背景</label>
                        <div class="controls">
                            <textarea  rows="8" name="cv[background]" id="cv_description" class="cv-input-xlarge"></textarea>
                        </div>
                    </div>
                    <div class="cv-input-box">
                        <label for="cv_description" >服务项目</label>
                        <div class="controls">
                            <textarea  rows="6" name="cv[items]" id="cv_description" class="cv-input-xlarge"></textarea>
                        </div>
                    </div>
                    <div class="cv-input-box">
                        <label for="cv_keywords" >项目地址</label>
                        <div class="controls">
                            <input  type="text" name="cv[online]" id="cv_keywords" class="cv-input-xlarge" />
                        </div>
                    </div>
                    <div class="cv-input-box">
                        <label for="cv_cover" >封面大图</label>
                        <div class="controls">
                            <input type="hidden" name="cv[cover]" id="cv_cover" />
                            <img onclick="upload_cv_cover()" id="cv_cover_preview" src="/cover/public/res/dash/img/addpicture.png" style="width: 80px;height: 60px;" class="cv-cursor" /><div style="text-align: center;position: relative;top: -42px;right: -75px;" class="cv-cursor"><img onclick="delete_cv_cover();" src="/cover/public/res/dash/img/icon_delete15.gif">
                            </div>
                        </div>
                    </div>
                    <script type="text/javascript">
                        function delete_cv_cover() {
                            $('#cv_cover').val('');
                            $('#cv_cover_preview').attr('src', '/cover/public/res/dash/img/addpicture.png');
                        }
                        function upload_cv_cover() {
                            openDialog("媒体上传","/cover/public/media/dash.default/new?crop=1&cl=crop('cv_cover',response.f_url,200,200);",'750px','520px');
                        }
                    </script>

                    <script type="text/javascript" src="/cover/public/res/common/ckeditor/ckeditor.js"></script>
                    <div class="cv-input-box">
                        <div class="cv-single-title">服务内容</div>
                        <textarea id="cv_full_text" name="cv[full_text]"></textarea>
                    </div>
                    <script type='text/javascript'>
                        CKEDITOR.replace("cv_full_text")
                    </script>
                </div>
            </div>
            <!--center end-->
        </div>
    </div>
</form><!--container end-->

<?= view('layout/footer')->send(); ?>
<!--js start-->
<script type="text/javascript">
    var mediaEntry = '/cover/public/media/dash.default/new';
    var siteHost = 'http://localhost/cover/public/';
    var videoProvider = '/cover/public/media/index/provider';
    var uploadedImages = [];
    var uploadedVideo = null;
    var username='admin1';
    function saveForm(){
        $("#cv_form_model_1").form('submit',{
            onSubmit: function(){
                return $(this).form('validate');
            },
            success: function(result){
                var response = JSON.parse(result);
                parent.message(response.message);
                if (response.success){
                    parent.reloadArchiveListData();
                    closeSelf();
                }
            }
        });
    }

    function openDialog(title, url, width, height, full) {
        var dialog = layer.open({
            type: 2,
            title: title,
            content: url,
            area: [width, height],
            anim: 5,
            shade: [0.1, '#666']
        });
        if (full) {
            layer.full(dialog);
        }
    }

    function closeSelf() {
        var index = parent.layer.getFrameIndex(window.name);
        parent.layer.close(index);
    }
</script>
<!--js end-->
