<? 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['TXTPROFILE']; ?></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 class="active"><? echo $vis_language['TXTPROFILE'];?></li>
        </ul>
    </div>
</section>
<section class="row m-b m-l-none m-r-none b-t b-light">
    <div class="col-md-2">
        <div class="wrapper text-center">
            <div class="thumb-lg padder-v m-t-lg">
				<a >
    <? if($staff['image_name'] != '' && $staff['image_name']!='default.jpg'){?>
    <div class="l-avatar" id="vis_profile_img">
    <img src="<?= VIS_PATH_PROFILE; echo $staff['image_name']; ?>" class="lg">
    </div>
<? }else{ ?>
<div class="l-avatar" id="vis_profile_img">
<? if($staff['first_name']!=''){
	$firstname=preg_split('//u', $staff['first_name'], -1, PREG_SPLIT_NO_EMPTY);
$lastname=preg_split('//u', $staff['last_name'], -1, PREG_SPLIT_NO_EMPTY);
	?>
 <div class="lg"><? echo ucfirst($firstname[0]).ucfirst($lastname[0]);?></div>
    <? }else{ ?>
    <img class="lg" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>

</div>
<? }?>
                <!--<img src="<? //= VIS_PATH_PROFILE; echo ($staff['image_name'] != '') ? $staff['image_name'] : 'default.jpg'; ?>" class="bg-white img-responsive ">-->
                
                </a>
				<? if($operation['vis_online_status'] == 1) {?>
                <div class="label vh-success-bg"><?php echo $vis_language['TXTONLINE']; ?></div>
				 <?php } else {?>  <div class="label label-default"><?php echo $vis_language['TXTOFFLINE']; ?></div> <? } ?>
            </div>
        </div>
         </div>
    <div class="col-md-6" id="short_summary"><? include(VIS_PATH_TEMPLATE.'profile_short_summary.php');?></div>
    <? if($mod_gamification==1){ ?>
    <div class="col-md-4 col-sm-8">
        <div class="wrapper m-r-xl">
            <div class="panel b-a  m-b-none">
                <?php $staff_point = ($staff['staff_point'] != '')?$staff['staff_point']:0; ?>
                <header class="panel-heading text-center font-bold b-b b-light"><?= $vis_language['TXTPOINTS'].':'; ?> <span class="label bg-primary"><?= $staff_point; ?></span></header>
                <div class="wrapper-md rnd">
                    <ul class="xs no-padder text-center">
                        <li class="<?php echo ($staff['level_id'] == 1)? 'active': '';?>">
                            <i class="vh vh-pawn"></i>
                        </li>
                        <li class="<?php echo ($staff['level_id'] == 2)? 'active': '';?>">
                            <i class="vh vh-knight"></i>
                        </li>
                        <li class="<?php echo ($staff['level_id'] == 3)? 'active': '';?>">
                            <i class="vh vh-bishop"></i>
                        </li>
                        <li class="<?php echo ($staff['level_id'] == 4)? 'active': '';?>">
                            <i class="vh vh-rook"></i>
                        </li>
                        <li class="<?php echo ($staff['level_id'] == 5)? 'active': '';?>">
                            <i class="vh vh-queen"></i>
                        </li>
                        <li class="<?php echo ($staff['level_id'] == 6)? 'active': '';?>">
                            <i class="vh vh-king"></i>
                        </li>
                    </ul>
                </div>
           </div>
        </div>
    </div><? } ?>
    <div class="col-md-4 col-sm-8">
		<div class="wrapper m-r-xl">
        <div class="panel b-a">
			<header class="panel-heading text-center font-bold b-b b-light"><? echo $vis_language['TXTLASTTICKETACTIVITY'];?></header>
			<div class="padder-v text-center clearfix">
				<div class="col-xs-4 b-r">
                    <div class="h3 font-bold" id="replied_cnt">0</div>
					<small class="text-muted"><? echo $vis_language['TXTREPLIED'];?></small>
				</div>
				<div class="col-xs-4 b-r">
					<div class="h3 font-bold" id="awaiting_cnt">0</div>
					<small class="text-muted"><? echo $vis_language['TXTAWAITING'];?></small>
				</div>
				<div class="col-xs-4">
					<div class="h3 font-bold" id="closed_cnt">0</div>
					<small class="text-muted"><? echo $vis_language['TXTCLOSED'];?></small>
				</div>
			</div>
		</div>
		</div>
		<div class="clear"></div>
    </div>
</section>
<div id="vis_staff_status_details"></div>
 <? if($staff['staff_id'] == VIS_STAFF_ID){ ?>
 <section class="padder">
    <section class="panel panel-default">
        <header class="panel-heading text-right bg-light clearfix">
            <ul class="nav nav-tabs pull-left">
                <li class="active"><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations',{'vis_module':'staff','vis_operation':'recent_activity'})"><? echo $vis_language['TXTTICKETACTIVITY']; ?></a></li>
                <li><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations',{'vis_module':'staff', 'vis_operation':'view_profile'})"><? echo $vis_language['TXTEDITPROFILE']; ?></a></li>
                <li><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations',{'vis_module':'home', 'vis_operation':'change_password'})"><? echo$vis_language['TXTCHNGPASS']; ?></a></li>
                <li id="pref"><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations',{'vis_module':'staff', 'vis_operation':'view_prefrences'})"><? echo $vis_language['TXTPREFERENCES']; ?></a></li>
                <li><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations', {'vis_module':'staff', 'vis_operation':'staff_signature','vis_staff_id': '<? echo $staff['staff_id']; ?>'});"><? echo $vis_language['TXTSIGNATURE']; ?></a></li>             
                <li><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations',{'vis_module':'staff','vis_operation':'time_tracking'})"><? echo$vis_language['TXTTIMETRACK']; ?></a></li>
                <?if($mod_blab==1 && VIS_MODULE_ACCESS_BLABBER==1){?><li><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations', {'vis_module':'blabber', 'vis_operation':'recent_blabs'});"><? echo $vis_language['TXTRECENTBLABS']; ?></a></li><? } ?>
                <li><a data-toggle="tab" oncontextmenu="return false;" href="#vis_details_list" onclick="$('#vis_details_list').visExecution('load_operations', {'vis_module':'staff', 'vis_operation':'integration'});"><? echo $vis_language['TXTINTEGRATIONS']; ?></a></li>
            </ul>
            <span class="hidden-sm dropdown">
            <i class="fa"></i>
            </span>
        </header>
        <div class="panel-body">
			<div class="tab-content">
				<div id="vis_details_list" class="tab-pane active">
				</div>
			</div>
		</div>
    </section>
</section>
<script>
$(".selectpicker").selectpicker();
$(document).ready(function()
{
	$('#vis_details_list').visExecution('load_operations',{'vis_module':'staff','vis_operation':'recent_activity'});
})
function enter_pass()
{
  if ($('#vis_auto_pass').is(":checked"))
   {
    $('#vis_pass').hide();
   }
   else
   {
     $('#vis_pass').show();
   }
}
function active_preference_tab()
    {
		$("li#pref").css('display','block');
		var active = $("#tabs .active").attr( "id");
		$("#"+active).removeClass("active");
		$("#pref").addClass("active");
		$('#vis_details_list').visExecution('load_operations',{'vis_module':'staff', 'vis_operation':'view_prefrences'});
	}
</script>

<? }?>
<script> $('#vis_staff_status_details').visExecution('load_operations',{'vis_module':'staff','vis_operation':'get_staff_ticket_count','vis_staff_id':<?= $staff['staff_id']; ?>}); </script>
 <? if($staff['staff_id'] != VIS_STAFF_ID && ($mod_blab==1 && VIS_MODULE_ACCESS_BLABBER==1)){ ?>
<section class="padder">
    <section class="panel panel-default">
        <div class="panel-body">

			<h4 class="b-b b-2x m-t-n-sm padder padder-v"><? echo $vis_language['TXTRECENTBLABS'];?></h4>
			<div id="recent_blabs"><?echo "<script>$('#recent_blabs').visExecution('load_operations', {'vis_module':'blabber', 'vis_operation':'recent_blabs','vis_staff_id':".$staff['staff_id']."});</script>";?></div>
		</div>
    </section>
</section>
<? } ?>
