<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">  
<title>{$language.lblBusiness} : {$language.lblCustomerMessages}</title>
{include file='CommonStyles.tpl'}
<link rel="stylesheet" type="text/css" href="{$view_styles}/message.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/colorbox.css" />
<link rel="stylesheet" type="text/css" href="{$view_styles}/cutomer-messages.css" />
{include file='CommonJavaScript.tpl'}
</head>
<body class="{$languageDirection}">
	<!-- Outer container starts-->
	<div class="outer" > {include file='CommonHeader.tpl'} 
        <div class="content-wrapper">
            <div class="container-fluid">
    <div class="head-strip-outer">
<div class="head-strip clearfix">
  <h2 class="pull-left">{$language.lblMessages}</h2>
  
  <div class="tabsection pull-right order_tab margin-bottom">
      <ul>
<li>{html->anchor href="user/customermsgs/"  class="selected tab" content="{$language.lblCustomerMessages}"}</li>
   <li>{html->anchor href="user/messages/" class="tab" content="{$language.lblMerchantMessages}"}</li>
          </ul>
    </div>
   {if $sort=='DESC'}{assign var="sortorder" value="ASC"}{else}{assign var="sortorder" value="DESC"}{/if}
    {*{html->anchor class="sortby fixing_left {$sortorder|strtolower}" href=$link|cat :"sort/$sortorder/" content="{$language.lblDate} <span class='arw'></span>"}*}
   </div>
</div>
	<!-- Content Container starts-->
		
    <div id="common_message" ></div> {if empty($resMessages)}  <div class="msg-container pos-relative clearfix norecode " >

	<div class="message_info" >{$language.msgNoRecords}</div>
    </div>
{else}
 <div class="msg-container pos-relative row">
  <span class="line"></span>
      <div class="msg-sec-left col-sm-4 col-xs-12 pos-relative rmv-padding-right-large"> 
          {form->hidden value=$resMessages.0.messageID id="AjaxMsgID" name="AjaxMsgID"}
        {form->hidden value=$resMessages.0.originID id="AjaxOrgnID" name="AjaxOrgnID"}
        {form->hidden value='customer' id="AjaxMsgType" name="AjaxMsgType"}
        <div class="container-section msg-details">
        <ul class="clearfix">
          {foreach from=$resMessages item="message" key="key1"}
          <li class="pos-relative list-main" id="Ajax_{$key1}"> {assign var="replyID" value=$message.messageID}{if ($message.status=='Verified' || $message.status=='New') && $message.sentBy=='User'}<span class="new-icon">&nbsp;</span>{/if} 
            {html->anchor class="link-all  msg-label" onclick="showCustomerMessageDetails({$replyID},{$message.originID},'Ajax_{$key1}')" 
            content="<span class='line2'></span>
            <p>{$message.createdDate|date_format:$date_format} {$message.createdDate|date_format:$time_format}</p>
            <p><span>{if $message.type=='Warranty'}
                {$language.lblWarranty}
             {elseif $message.type=='Others'}
                 {$language.lblOthers}
              {else}
                  {$language.lblAboutProduct}
                  {/if}  {$message.subject}</span></p>
            <strong>{$message.user}</strong>"} </li>
          {/foreach}
        </ul>
            </div>
         </div>
      <!--End:From Listing--> 
      <!--Start:Ajax Listing-->
      <div class="msg-sec-right col-sm-8 pos-relative col-xs-12 pull-left clearfix"  id="AjaxMessageDetails"> </div>
    </div>
   {/if}
            </div>
  </div>
  <!-- Content Container ends--> 
  <!-- Footer starts--> 
  {include file='CommonFooter.tpl'} 
  <!-- Footer ends--> 
</div>
<!-- Outer container ends--> 
{form->basepath_script}
{html->messages_script id="common_message"} 

  <script type="text/javascript" src="{$common_js}/validate.plugin.js"></script>
  <script type="text/javascript" src="{$common_js}/jquery.perfect-scrollbar.js"></script>
<script type="text/javascript">
    $(".msg-scrol").perfectScrollbar();
    $(".msg-scrol-ajax").perfectScrollbar();
</script> 
  <script type="text/javascript"  src="{$view_javascript}/message.page.js"></script>
  <script>
            $(document).ready(function(){
                $(".msg-label").click(function(){
                    $(".msg-label").not(this).parent().removeClass('active').addClass('inactive');
                    $(this).parent().addClass('active').removeClass('inactive');
                    $(".msg-sec-right").addClass('msg-show');
                    $(".msg-sec-left").addClass('msg-list-show');
                });
                $(".reply-back").click(function(){
                    $(this).hide();
                    $(".message-text").slideDown();
                });
                $(".cancelButton").click(function(){
                    $(".reply-back").show();
                    $(".message-text").slideUp();
                });
                $('.msg-label').click(function(){
                    $('body').animate({ scrollTop: "0px" }, '500');
                });   
                

                
            });  
      </script>  
</body>
</html>
