<? global $vis_language; ?>
<section class="bg-white aside-lg m-n vbox">
	<section class="scrollable">
    <aside id="sidebar" class="aside-lg">
	<section class="scrollable">
        <section class="panel no-borders no-gutter no-radius">
            <header class="panel-heading bg-light">
                <ul class="nav nav-tabs nav-justified">
				<?php if(VIS_SHOWONLINESTAFF_ACCESS ==1){ ?>
				<li class="active"><a data-toggle="tab" href="#online-staff"><strong><? echo $vis_language['TXTONLINESTAFF'];?></strong><span style="display: inline-block;" class="badge badge-sm vh-success-bg m-l-xs"><?= count($online_staff);?></span></a></li> <?php } ?>
                    <li <?php if(VIS_SHOWONLINESTAFF_ACCESS !=1){ echo ' class="active" '; } ?>><a data-toggle="tab" href="#pinned-items"><strong><? echo $vis_language['TXTPINNEDITEM'];?></strong><span id="pinned_items" style="display: inline-block;" class="badge badge-sm vh-gray-bg m-l-xs"><?= ($pin_data!=-1)?count($pin_data):0;?></span></a></li>
                </ul>
            </header>
                <div class="tab-content padder m-t-sm">
				<?php if(VIS_SHOWONLINESTAFF_ACCESS ==1){ ?>
                    <div id="online-staff" class="tab-pane active">
                        <? if($online_staff!=-1) { ?>
                        <ul class="list-group row m-b-n m-t-n list-group-lg no-radius">
                            <? for($i=0; $i<count($online_staff); $i++){ ?>
                            <li class="list-group-item onlineuserLI" onmouseover="displayblab(<? echo $i; ?>)">
                                <a class="pull-right m-t-sm onlineuserCls" href="javascript:void(0)" data-toggle="ajaxModal" data-modal-arguments="vis_module=blabber&vis_operation=add_new_blab&cache=true&vis_home=1&vis_staff_id=<? echo $online_staff[$i]['staff_id']; ?>&vis_first_name=<?echo $online_staff[$i]['first_name'];?>&vis_last_name=<?echo $online_staff[$i]['last_name'];?>" style="display:none" id="online_<? echo $i; ?>">
                               <!-- <i class="vh vh-blab vh-blue vh-lg"></i> -->
                                </a>
								<a href="#/home/profile_view/<? echo $vis_language['TXTPROFILE'];?>/<? echo $online_staff[$i]['staff_id']; ?>">
                                <div class="l-avatar pull-left m-r-sm vis-pointer" onclick="">
                                <? if($online_staff[$i]['image_name']!='' && is_file(VIS_PATH_PROFILE.$online_staff[$i]['image_name']) && $online_staff[$i]['image_name']!='default.jpg'){?>
                                <img src="<?= VIS_PATH_PROFILE.$online_staff[$i]['image_name'];?>" class="sm">
                                <? }else{ ?>
                                <? if($online_staff[$i]['first_name']!=''){
																																	$firstname=preg_split('//u', $online_staff[$i]['first_name'], -1, PREG_SPLIT_NO_EMPTY);
$lastname=preg_split('//u', $online_staff[$i]['last_name'], -1, PREG_SPLIT_NO_EMPTY);
																																	?>
    <div class="sm"><? echo ucfirst($firstname[0]).ucfirst($lastname[0]);?></div>
    <? }else{ ?>
    <img class="sm" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>
                                
                                <? }?>
</div></a>
                               <!-- <span class="pull-left thumb-sm avatar m-r-sm vis-pointer" onclick="$('#vis_workpanel_div').visExecution('load_module', 'home', {'vis_module':'home', 'vis_operation':'profile_view','vis_staff_id':'<?php //echo $online_staff[$i]['staff_id']; ?>'});">
                                <img src="<? //= VIS_PATH_PROFILE.($online_staff[$i]['image_name']!='' && is_file(VIS_PATH_PROFILE.$online_staff[$i]['image_name']) ? $online_staff[$i]['image_name'] : 'default.jpg');?>" class="img-circle"> 
                                </span> -->
                                <a class="clear text-ellipsis">
                                <strong class="block"><a href="#/home/profile_view/<? echo $vis_language['TXTPROFILE'];?>/<? echo $online_staff[$i]['staff_id']; ?>"><? echo $online_staff[$i]['first_name'].' '.$online_staff[$i]['last_name']; ?></a></strong>
                                <small>
                                <? $diff=time()-$online_staff[$i]['logintime']; 
                                    echo count_remain_time($diff);?>  
                                </small><small class="pull-right">IP address&nbsp; <? echo $online_staff[$i]['ip']; ?></small>
                                </a>
                            </li>
                            <? }?>
                        </ul>
                        <? } else { echo $vis_language['TXTNOTHINGTODISPLAY']; } ?>
                    </div>
					<?php } ?>
                    <!-- tab pinned-items -->
                    <div id="pinned-items" class="<?php echo (VIS_SHOWONLINESTAFF_ACCESS !=1)?'tab-pane active':'tab-pane'; ?>">
                        <? if($pin_data!=-1) {  ?>
                        <ul class="list-group row m-b-n m-t-n list-group-lg">
                            <? for($i=0;$i<count($pin_data);$i++) {
                                $image=($pin_data[$i]['pin_image']=='')?'default.jpg':$pin_data[$i]['pin_image']; ?>							
                            <li class="list-group-item pinItemLI" onmouseover="displayDel(<? echo $pin_data[$i]['pin_id'] ?>)">
                                <button data-dismiss="modal" type="button" title="<? echo $vis_language['TXTDELPIN']; ?>" onclick="$('#pinned-items').visExecution('load_area', {'vis_module':'home', 'vis_operation':'remove_pin', 'vis_pin_id':'<? echo $pin_data[$i]['pin_id'] ?>'})" class="close pull-right pinItemCls" style="display:none" id="pin_<? echo $pin_data[$i]['pin_id'] ?>">×</button>										
                                <? if(strpos($image,'vh ')!==false): ?>
                                <span class="vh-stack pull-left m-r-sm vis-pointer">
                                <i class="<? echo "vh-2x ".$image ?>"></i>
                                </span>
                                <span class="clear">
                                <span ><? echo $pin_data[$i]['pin_title']?></span>
                                <small class="text-ellipsis"><? echo $pin_data[$i]['content']; ?></small>
                                </span>
                                <? else: ?>
                                <span class="vh-stack pull-left m-r-sm">
                                <a href="javascript:void(0);" class="thumb-sm pull-left m-r-sm">
                                <img src="<? echo VIS_PATH_PROFILE.$image; ?>" class="img-circle" />
                                </a></span>
                                <span class="clear">
                                <span><? echo $pin_data[$i]['pin_title']; ?></span>
                                <small class="text-ellipsis"><? echo $pin_data[$i]['content']; ?></small>
                                </span>
                                <? endif; ?>							  
                            </li>
                            <? } ?>
                        </ul>
                        <? } else { echo $vis_language['TXTNOTHINGTODISPLAY']; } ?>
                    </div>
                    <!-- tab recent-activities -->
                </div>
        </section>
	</section>
	</aside>
</section>
</section>