<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/images/metinfo.css" />
<script type="text/javascript" src="__PUBLIC__/admin/images/jQuery1.7.2.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/common.css" />
<script type="text/javascript" src="__PUBLIC__/admin/js/common.js" /></script>
<script>
$(document).ready(function(){
    $('#web_setting').submit(function(){
        var domain = $("input[name='domain']").val();
        var bname = $("input[name='bname']").val();
        var seo_title = $("input[name='seo_title']").val();
        var seo_keyword = $("input[name='seo_keyword']").val();
        var seo_description = $("#seo_description").val();
        var is_close = $("input[name='is_close']:checked").val();
        var close_reason = $("#close_reason").val();
        var is_store_url = $("input[name='is_store_url']:checked").val();
        if(strlen(domain) < 1){
            //域名网址不正确
            alert('网址填写不正确');
            return false;
        }
        if(strlen(bname) < 2) {
            //站点名过短
            alert('站点名过短');
            return false;
        }
        if(is_close == '1' && strlen(close_reason) < 10) {
            //关闭网站状态下 关闭说明必须大于10位字符或5位汉字
            alert('关闭网站必须关闭说明大于10位字符');
            return false;
        }
        $("#dosubmit").html("正在提交。。。");
        $.post("<?php echo U('Index/ajax_websetting');?>",{domain:domain,bname:bname,seo_title:seo_title,seo_keyword:seo_keyword,seo_description:seo_description,is_close:is_close,close_reason:close_reason,is_store_url:is_store_url},function(result){
            if(result.status=='1'){
                alert(result.info);
                window.location.reload();
            }else{
                alert(result.info);
            }
        });
        return false;
});
});
</script>
</head>
<body>
    <div class="metinfotop">
    <div class="position">简体中文：网站设置 > <a href="<?php echo U('Index/web_setting');?>">基本设置</a></div>
    </div>
    <div class="clear"></div>
<div class="stat_list">
    <ul>
        <li class="now"><a href="<?php echo U('Index/web_setting');?>" title="基本信息">基本设置</a></li>
        <li><a href="<?php echo U('Index/sms_setting');?>" title="参数配置">参数配置</a></li>
    </ul>
</div>
<div class="fm_form">
<form class="stdform" action="" id="web_setting" method="post">
                        <p>
                            <label class="lb_left"><span class="bi_tian">*</span>网站域名：</label>
                            <span class="field"><input type="text" name="domain" value="<?php echo ($data["domain"]); ?>" class="smallinput" tips="请填写网站网址" />
                            <img src="__PUBLIC__/admin/images/helps.gif" class="tips_img" title="">
                            </span>
                        </p>
                        <p>
                            <label class="lb_left"><span class="bi_tian">*</span>站点名称：</label>
                            <span class="field"><input type="text" name="bname" value="<?php echo ($data["bname"]); ?>" class="smallinput" tips="请填写站点名称" />
                            <img src="__PUBLIC__/admin/images/helps.gif" class="tips_img" title="">
                            </span>
                        </p>
                        <p>
                            <label class="lb_left">SEO标题：</label>
                            <span class="field"><input type="text" name="seo_title" value="<?php echo ($data["seo_title"]); ?>" class="smallinput" tips="请输入SEO标题" />
                            <img src="__PUBLIC__/admin/images/helps.gif" class="tips_img" title="">
                            </span>
                        </p>
                        <p>
                            <label class="lb_left">SEO关键词：</label>
                            <span class="field"><input type="text" name="seo_keyword" value="<?php echo ($data["seo_keyword"]); ?>" class="smallinput" tips="请输入SEO关键词" />
                            <img src="__PUBLIC__/admin/images/helps.gif" class="tips_img" title=""></span>
                        </p>
                        <p>
                            <label class="lb_left">SEO描述：</label>
                            <span class="field"><textarea name="seo_description" id="seo_description" class="smalltext" tips="请填写SEO描述"><?php echo ($data["seo_description"]); ?></textarea>
                            <img src="__PUBLIC__/admin/images/helps.gif" class="tips_img" title="">
                            </span>
                        </p>
                        <p>
                            <label class="lb_left">是否关站：</label>
                            <span class="field">
                                    <span class="checked"><input type="radio" name="is_close"<?php if($data["is_close"] == '1'): ?>checked="checked"<?php endif; ?> value="1"></span>
                                是
                                    <span class=""><input type="radio" name="is_close"<?php if($data["is_close"] == '0'): ?>checked="checked"<?php endif; ?> value="0"></span>
                                否
                            </span>
                        </p>
                        <p>
                            <label class="lb_left">关站理由：</label>
                            <span class="field"><textarea name="close_reason" id="close_reason" class="smalltext" tips="关站理由：如果选择关站，理由必须在5字以上"><?php echo ($data["close_reason"]); ?></textarea>
                            <img src="__PUBLIC__/admin/images/helps.gif" class="tips_img" title="">
                            </span>
                        </p>
                        <p class="stdformbutton">
                            <button class="submit radius2 fm_btn" id="dosubmit">提交</button>
                        </p>
                    </form>
                    </div>
                    <div class="fm_cl"></div>

</body>
</html>