
<ul> {assign var="loopexit" value=0  scope="global"}
 {function name=messages level=0}
  {foreach from=$data item="message" key="key1"}
    {assign var="id" value=$message.messageID}
      {if in_array($message.messageID,$resParents)} 
    {assign var="msgStatus" value=$message.status}
    {assign var="msglastsentBy" value=$message.sentBy}                      
    <li >
   
       {if $message.parentID==0}
            <h4>{$message.subject}  </h4>
            <p>{$language.lblType}: 
             {if $message.type=='Warranty'}
                {$language.lblWarranty}
             {elseif $message.type=='Others'}
                 {$language.lblOthers}
              {else}
                  {$language.lblAboutProduct}
                  {/if}
            </p>
            <p>{$language.lblFrom}: {$message.user}</p>
            <p>{$language.lblTo}:{$message.businessName}</p>
        {/if}
         {if $msgStatus!='New'} <span class="fixing_right {if $msgStatus =='Replied'}r-bg{else} v-bg{/if}">{$msgStatus}</span>{/if} 
        <p> {if $message.parentID==0}{$language.lblDate}:
            {else}<strong>
                {if $msglastsentBy=='Merchant'} {$message.businessName}
                {else if $msglastsentBy=='User'} {$message.user}
                {else}{$language.lblAdmin}{/if}</strong> {/if}
            {$message.createdDate|date_format:$settingsDateFormat} {$message.createdDate|date_format:$time_format}
        </p>
           
        <div class="cmt">{$message.message}</div>
        {if $msgStatus=='New'} 
            {form->start name="formReplySubmit" method="post"}
             {form->hidden id="messageID"  name="messageID" value=$id}
                  {form->hidden value='Verified' name="status"}     
                  <div class="clearfix"> 
                    
                 {form->button name="submitVerify" onClick="verifyAjax('$id')" class="curve-3 button03 fixing_right" value="{$language.lblVerify}" tabindex="2"}
                 </div> 
                 {form->close}  
            {/if}
     
        {if !empty($message['replyMsg']) && is_array($message['replyMsg'])}                                          
          
            {call name=messages data=$message['replyMsg'] level=$level+1} 
              <!--menu function calling-->
        {/if}
               
   </li>
   {/if}
    {/foreach}
 {/function}
{call messages data=$resMessages} 
    	</ul>