<? global $vis_language; ?>
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
  <div class="col-sm-6">
    <h3 class="m-b-xs text-black"><? echo $vis_language['TXTCHATTRANSCRIPT'];?></h3>
    <ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
      <li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><? echo $vis_language['TXTHOME'];?></a></li>
      <li><a class="link" href="#/chat/zopim_chat/<? echo $vis_language['TXTZOPIM'];?>"><? echo $vis_language['TXTZOPIM'];?></a></li>
      <li><? echo $vis_language['TXTCHATTRANSCRIPT'];?></li>
    </ul>
  </div>
</section>
<section class="padder">
  <section class="panel panel-default">
    <div class="wrapper-sm"> 
        <? $visitor_name = str_replace(" ","-",$chat_data->visitor->name);?>
    <a href="javascript:void(0);" class="link pull-right m-t-sm" data-toggle="ajaxModal" data-modal-arguments="vis_module=ticket&vis_operation=new_ticket_step_one&vis_static_area=vis_open_new_dialog&vis_chat_type=zopim&vis_chat_id=<? echo $chat_data->id; ?>&vis_email_id=<? echo $chat_data->visitor->email;?>&vis_visitor_name=<? echo $visitor_name;?>&vis_client=1&vis_domain_id=<? echo $vis_domain; ?>" onclick="" type="button"><? echo $vis_language['TXTCONVERTTOTICKET']; ?></a>
      <div class="btn-group">
        <div class="form-group">
          <h5><? echo $vis_language['TXTCHATTRANSCRIPT'];?></h5>
        </div>
      </div>
    <div class="line b-b line-lg pull-in"></div>
    </div>
    <div class="row m-t">
      <div class="col-md-6">
      <?php $start_time = format_datetime(strtotime($chat_data->session->start_date)); 
            $end_time = format_datetime(strtotime($chat_data->session->end_date)); ?>
        <div class="row m-b-sm"> <span class="col-xs-3 text-right"><? echo $vis_language['TXTDATE'];?> :</span>
          <div class=" col-xs-9 text-lt text-muted"><? echo $start_time; ?></div>
        </div>
        <div class="row m-b-sm"> <span class="col-xs-3 text-right"><? echo $vis_language['TXTIPADDRESS'];?> :</span>
          <div class=" col-xs-9 text-lt text-muted"><? echo $chat_data->session->ip ?></div>
        </div>
        <div class="row m-b-sm"> <span class="col-xs-3 text-right "><? echo $vis_language['TXTVISITORNAME'];?> :</span>
          <div class=" col-xs-9 text-lt text-muted"><? echo ucfirst($chat_data->visitor->name); ?></div>
        </div>
        <div class="row m-b-sm"> <span class="col-xs-3 text-right"><? echo $vis_language['TXTVISITOREMAIL'];?> :</span>
          <div class=" col-xs-9 text-lt text-muted"><? echo $chat_data->visitor->email; ?></div>
        </div>
      </div>
      <div class="col-md-6">
        <div class="row m-b-sm"> <span class="col-xs-3 text-right"><? echo $vis_language['TXTCOUNTRY'];?> :</span>
          <div class=" col-xs-9 text-lt text-muted"><? echo $chat_data->session->country_name; ?></div>
        </div>       
        <div class="row m-b-sm"> <span class="col-xs-3 text-right"><? echo 'End time';?> :</span>
          <div class=" col-xs-9 text-lt text-muted"><? echo $end_time; ?></div>
        </div>         
      </div>
    </div> 
      <div class="wrapper m-b-sm">
        <div class="clear">
          <form name="vis_selfhelp_article_form" id="vis_selfhelp_article_form" class="form-horizontal" method="post">
            <br/>
            <h5><? echo $vis_language['TXTCONVERSATIONS'];?></h5>
            <div class="line b-b line-lg pull-in"></div>
            <br/>
            <?php		
				 
                                  if($chat_data->count->total > 0)
                                      for($i=0;$i<count($chat_data->history);$i++) {
                                                    if($chat_data->history[$i]->msg !='') {
                                                    echo '<div class="col-xs-2 text-right">['.format_datetime(strtotime($chat_data->history[$i]->timestamp)).']</div>';
                                                     echo '<div class=" col-xs-10 text-lt text-muted">'.$chat_data->history[$i]->msg.'</div>';                                                     
                                                    }
                                      }
                                    
                                  else {
                                       echo '<div class="col-xs-2 text-right">['.$start_time.']</div>';
                                       echo '<div class=" col-xs-10 text-lt text-muted">'.$chat_data->message.'</div>';                                   
                                  }
            ?>
          </form>
        </div>
    </div>
  </section>
</section>