<? global $vis_language; ?>
<? 
    for($i=0;$i<count($response);$i++){
        if($operation['email'] == $response[$i]['email'] && $operation['name'] == $response[$i]['name'] && $operation['user_message'] == $response[$i]['user_message'] && $operation['chat_length'] == $response[$i]['chat_length']) {
                    $position = $i;
        }
    }
    $visitor_info = json_decode($response[$position]['visitor_info'], true);  
?>
<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/clickdesk_chat/<? echo $vis_language['TXTCLICKDESK'];?>"><? echo $vis_language['TXTCLICKDESK'];?></a></li>
      <li><? echo $vis_language['TXTCHATTRANSCRIPT'];?></li>
    </ul>
  </div>
</section>
<section class="padder">
  <section class="panel panel-default">
    <div class="wrapper-sm">
    <!--<button type="button" class="btn btn-default btn-sm btn-block" data-toggle="ajaxModal" data-modal-arguments="vis_module=ticket&vis_operation=new_ticket_step_one&vis_static_area=vis_open_new_dialog&vis_email_id='<? echo $chat_object->visitor->email; ?>'&vis_client=1&vis_domain_id=<? echo $vis_domain; ?>"><? echo $vis_language['TXTADDTICKET']; ?></button>-->
   <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=clickdesk&vis_email_id=<? echo $response[$position]['email']; ?>&vis_position=<? echo $position; ?>&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($response[$position]['start_time']/1000); 
            $end_time = format_datetime($response[$position]['end_time']/1000); ?>
        <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 $visitor_info['ip_address']; ?></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($response[$position]['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 $response[$position]['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 $visitor_info['country']; ?></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="line b-b line-lg pull-in"></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		
				  echo '<div class="col-xs-2 text-right">['.$start_time.']</div>';	
				  echo '<div class=" col-xs-10 text-lt text-muted">'.$response[$position]['user_message'].'</div>';
                                  echo '<div class="col-xs-2 text-right">['.$vis_language['TXTMORECONVERSATION'].']</div>';
                                  echo '<div class=" col-xs-10 text-lt text-muted"><a target="_blank"  href='.$response[$position]['chat_history_url'].'>'.$response[$position]['chat_history_url'].'</a></div>';
            ?>
          </form>
        </div>
    </div>
  </section>
</section>