{include file="public/mall_top" /}
{include file="public/mall_header" /}

<link rel="stylesheet" href="{$Think.config.url_domain_root}static/home/css/member.css">
<div class="dsm-container">
    {include file="public/member_left" /}
    <div class="right-layout">
        <div class="tabmenu">
            {include file="public/member_items" /}
        </div>
  <div class="dsm-default-form">
    {notempty name="message_list"}
    {volist name="message_list" id="v"}
    <dl>
      <dt>
        {if $drop_type == 'msg_seller'}
       {$v.from_member_name}{:lang('home_message_speak')}
        {elseif $drop_type== 'msg_system'}
        {$v.from_member_name}
        {else /}
        {$v.from_member_name}{:lang('home_message_speak')}
        {/if}
        {:lang('ds_colon')}
       </dt>
      <dd>
        <p><?php echo nl2br(parsesmiles($v['message_body'])); ?></p>
        <p class="hint">({:date('Y-m-d H:i',$v.message_time)})</p>
      </dd>
    </dl>
    {/volist}
    {/notempty}
    {if $Request.param.drop_type == 'msg_list'&& $isallowsend}

    <form id="replyform" method="post" action="{:url('membermessage/savereply')}">
      <input type="hidden" name="form_submit" value="ok" />
      <input type="hidden" name="message_id" value="{$message_id}" />
      <dl class="bottom">
        <dt>{:lang('home_message_reply')}{:lang('ds_colon')}</dt>
        <dd>
          <p>
            <textarea name="msg_content" rows="3" class="textarea w500"></textarea>
          </p>
          <p> </p>
        </dd>
      </dl>
      <dl class="bottom">
      <dt>&nbsp;</dt>
      <dd>
        <label class="submit-border">
          <input type="submit" class="submit" value="{:lang('home_message_submit')}" />
        </label>
      </dd>
      </dl>
    </form>
    {/if}

  </div>
    </div>
</div>
 <script type="text/javascript">
    $(function(){
        $('#replyform').validate({
            errorPlacement: function(error, element){
                $(element).parent().next('p').html(error);
            },
            rules : {
                msg_content : {
                    required   : true
                }
            },
            messages : {
                msg_content : {
                    required   : '{:lang('home_message_reply_content_null')}'
                }
            }
        });
    });
    </script>