<?php if(!defined('IN_SDCMS')) exit;?>{include file="top.php"}
<title>在线留言_{sdcms[web_name]}</title>
<meta name="keywords" content="{sdcms[seo_key]}">
<meta name="description" content="{sdcms[seo_desc]}">
</head>

<body>

    {include file="head.php"}
    
    <div class="banner_inner" style="background:url({WEB_ROOT}theme/20170105/images/b00.jpg) no-repeat center;">      
    </div>

    <div class="width container">
    	<div class="lefter">
        	<div class="left_title mts">
            	<h3>{get_catename(2)}</h3>
                <p>{get_cate_self($mycateename,2,'mycateename','')}</p>
            </div>
            <div class="left_border">
                <ul>
                    {sdcms:rp top="0" table="sd_category" where="followid=2" order="catenum,cateid"}
                    {rp:eof}<li class="hover"><a href="{cateurl($topid)}">{get_catename($topid)}</a></li>{/rp:eof}
                    {php $sub_sonid=$rp[cateid]}
                    <li{is_active($rp[cateid],$parentid)}><a href="{cateurl($rp[cateid])}" title="{$rp[catename]}"><span class="am-icon-angle-right"></span>{$rp[catename]}</a></li>
                    {sdcms:rs top="0" table="sd_category" where="followid=$sub_sonid" order="catenum,cateid"}
                    <li class="small{is_active($rs[cateid],$parentid,' active')}"><a href="{cateurl($rs[cateid])}" title="{$rs[catename]}"{if $rs[isblank]==1} target="_blank"{/if}><span class="am-icon-angle-right"></span>{$rs[catename]}</a></li>
                    {/sdcms:rs}
                    {/sdcms:rp}
                </ul>
            </div>
            
            <div class="left_title mt20">
            	<h3>联系我们</h3>
                <p>Contact Us</p>
            </div>
            <div class="left_contact">
                {block("page_contact")}
            </div>
            
        </div>
        <div class="righter">
        	<div class="subject">
            	<div class="fl">在线留言<span>Message</span></div>
                <div class="fr">您的当前位置：<a href="{$webroot}">首页</a> > 在线留言</div>
            </div>
        	<!---->
            <div class="h2"><span>留言列表</span></div>
            {sdcms:rs pagesize="10" table="sd_book" where="islock=1" order="ontop desc,id desc"}
            <div class="ui-card ui-card-book ui-mt-20">
                <div class="ui-card-header"><div class="ui-card-header-title">{$rs[truename]}</div><div class="ui-card-header-more ui-text-gray">{date('Y-m-d H:i',$rs[createdate])}</div></div>
                <div class="ui-card-body">
                    <div>{$rs[remark]}</div>
                </div>
                {if strlen($rs[reply])>0}
                <div class="ui-card-footer">
                    <strong>回复：</strong>{$rs[reply]} 
                </div>
                {/if}
            </div>
            {/sdcms:rs}
            <div class="ui-page ui-page-center ui-page-mid ui-mt-20 ui-mb"><ul>{$showpage}</ul></div>
            
            <div class="ui-menu ui-menu-blue">
                <div class="ui-menu-name">我要留言</div>
            </div>
            <form class="ui-form ui-mt-30" method="post">
                <div class="ui-form-group ui-row">
                    <label class="ui-col-2 ui-col-form-label ui-text-right">姓名：</label>
                    <div class="ui-col-10">
                        <input type="text" name="truename" class="ui-form-ip" placeholder="请输入姓名" data-rule="姓名:required;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-2 ui-col-form-label ui-text-right">手机：</label>
                    <div class="ui-col-10">
                        <input type="text" name="mobile" maxlength="11" class="ui-form-ip" placeholder="请输入手机号码" data-rule="手机号码:required;mobile;">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-2 ui-col-form-label ui-text-right">座机：</label>
                    <div class="ui-col-10">
                        <input type="text" name="tel" class="ui-form-ip" placeholder="请输入座机号码（可选）">
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-2 ui-col-form-label ui-text-right">留言：</label>
                    <div class="ui-col-10">
                        <textarea name="remark" class="ui-form-ip ui-form-limit" data-max="255" rows="4" placeholder="请输入留言内容" data-rule="留言内容:required;"></textarea>
                        <div class="ui-form-limit-text"><span>0</span>/255</div>
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <label class="ui-col-2 ui-col-form-label ui-text-right">验证码：</label>
                    <div class="ui-col-10">
                        <div class="ui-input-group">
                            <input type="text" name="code" id="code" class="ui-form-ip ui-radius-right-none" placeholder="请输入验证码" data-rule="验证码:required;">
                            <div class="code"><img src="{U('code')}" height="40" id="verify" title="点击更换验证码"></div>
                        </div>
                    </div>
                </div>
                <div class="ui-form-group ui-row">
                    <div class="ui-col-10 ui-offset-2">
                        <input type="hidden" name="token" value="{$token}"><input type="submit" class="ui-btn ui-btn-blue" value="提交">
                    </div>
                </div>
            </form>
            <!---->
        </div>
        <div class="clear"></div>
    </div>
    
    {include file="foot.php"}
    <script>
	$(function()
	{
		$("#verify").click(function()
		{
			$(this).attr("src",$(this).attr("src")+"{iif(sdcms[url_mode]==1,"&","?")}rnd="+Math.round());
			$("#code").val("");
		});
		$(".ui-form").form(
		{
			type:2,
			align:'center',
			result:function(form)
			{
				$.ajax(
				{
					type:'post',
					cache:false,
					dataType:'json',
					url:'{N("book")}',
					data:$(form).serialize(),
					error:function(e){alert(e.responseText);},
					success:function(d)
					{
						if(d.state=='success')
						{
							sdcms.success(d.msg);
							setTimeout(function(){location.href='{THIS_LOCAL}';},1500);
						}
						else
						{
							$("#verify").click();
							sdcms.error(d.msg);
						}  
					}
				});
			}
		});
	})
	</script>
    
</body>
</html>
