<div id="cv_site_edit_panel_header">
    <div class="panel-title">
        <a href="javascript:saveSiteEditForm();" class="easyui-linkbutton">保存</a>
    </div>
</div>
<div border="false" header="#cv_site_edit_panel_header" class="easyui-panel" style="width: 100%;height: 100%;overflow-x: hidden;">
    <form id="cv_site_edit_form" method="post" class="cv-mt-15">
        <div class="cv-normal-input-box">
            <input value="<?= $item['title']; ?>" class="easyui-textbox" name="cv[title]" label="网站标题" required style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['domain']; ?>" disabled class="easyui-textbox" name="cv[domain]" label="绑定域名" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['keywords']; ?>" class="easyui-textbox" name="cv[keywords]" label="关键词" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['logo']; ?>" buttonText="选取" id="cv_site_logo" class="easyui-textbox" name="cv[logo]" label="网站Logo" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['mini_logo']; ?>" buttonText="选取" id="cv_mini_logo" class="easyui-textbox" name="cv[mini_logo]" label="迷你Logo" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['mobile_logo']; ?>" buttonText="选取" id="cv_mobile_logo" class="easyui-textbox" name="cv[mobile_logo]" label="手机Logo" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['description']; ?>" class="easyui-textbox" name="cv[description]" multiline="true" label="网站描述" style="width: 100%;height: 50px;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['company_info']['intro']; ?>" class="easyui-textbox"   multiline="true"  name="cv[company_info][intro]"  label="公司简介" style="width: 100%;height: 150px;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['company_info']['tel']; ?>" class="easyui-textbox" name="cv[company_info][tel]"   label="联系电话" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['company_info']['email']; ?>" class="easyui-textbox" name="cv[company_info][email]"  label="服务邮箱" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['company_info']['addr']; ?>" class="easyui-textbox" name="cv[company_info][addr]"  label="公司地址" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['copyright']; ?>" class="easyui-textbox" name="cv[copyright]"  label="网站版权" multiline="true" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <input value="<?= $item['beian']; ?>" class="easyui-textbox" name="cv[beian]"  label="网站备案" style="width: 100%;" />
        </div>
        <div class="cv-normal-input-box">
            <label class="textbox-label textbox-label-before">网站状态</label>
            <span class="easyui-fluid">
                <input name="cv[status][o]" type="radio" value="1" <?php if (intval($item['status']['o'])===1):?>checked<?php endif;?> />&nbsp;开启&nbsp;&nbsp;
                <input name="cv[status][o]" type="radio" value="0" <?php if (intval($item['status']['o'])===0):?>checked<?php endif;?> />&nbsp;关闭
            </span>
        </div>
        <div class="cv-normal-input-box">
            <input name="cv[status][m]" value="<?= $item['status']['m']; ?>" class="easyui-textbox"  multiline="true" label="网站描述" style="width: 100%;height: 80px;" />
        </div>
    </form>
</div>

<script type="text/javascript">
    $(function () {
        $('#cv_site_logo').textbox({
            onClickButton: function () {
                openDialog("媒体上传","<?= url('dash/media/new'); ?>?cl=toSiteLogoReceiver(response.f_url,true,'cv_site_logo');|closeSelf();",'750px','520px');
            }
        })
        ;$('#cv_mini_logo').textbox({
            onClickButton: function () {
                openDialog("媒体上传","<?= url('dash/media/new'); ?>?cl=toSiteLogoReceiver(response.f_url,true,'cv_mini_logo');|closeSelf();",'750px','520px');
            }
        });
        $('#cv_mobile_logo').textbox({
            onClickButton: function () {
                openDialog("媒体上传","<?= url('dash/media/new'); ?>?cl=toSiteLogoReceiver(response.f_url,true,'cv_mobile_logo');|closeSelf();",'750px','520px');
            }
        });
    });

    function siteLogoReceiver(response,pos) {
        $('#'+pos).textbox('setValue',response);
    }

    function saveSiteEditForm(){
        $("#cv_site_edit_form").form('submit',{
            url: '<?= url('index'); ?>',
            onSubmit: function(){
                return $(this).form('validate');
            },
            success: function(result){
                var response = JSON.parse(result);
                message(response.message);
            }
        });
    }
</script>