<?
   global $vis_language;
    $paging_list='';
   for($i=0;$i<$view_info['page_count'];$i++) $paging_list.='<option value="'.$i.'" '.(($subaccount_info['page']==$i)?'selected="selected"':'').'>'.($i+1).'</option>';
?>
<? if($subaccount_details!=-1) {?>
<form class="form-horizontal" role="form" id="vis_child_client_form" name="vis_child_client_form" method="post">
   <div class="row wrapper clr">
      <div class="col-sm-9 tkt_left_menu"></div>
      <div  class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
         <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_details_list').visExecution('load_area',{'vis_module':'client', 'vis_operation':'get_subaccounts', 'vis_page':this.value ,'vis_client_id':'<? echo $subaccount_info['client_id']; ?>'})">
         <? echo $paging_list;?>
         </select>
         <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
      </div>
   </div>
   <div class="table-responsive scroll-x">
      <table class="table table-hover b-t b-light m-b-none" data-ride="datatables">
         <thead class="table_head">
            <tr>
               <th><? echo $vis_language['TXTFIRSTNAME']; ?></th>
               <th class="txt_nowrap"><? echo $vis_language['TXTLASTNAME']; ?></th>
               <th class="txt_nowrap"><? echo $vis_language['TXTEMAIL']; ?></th>
               <th class="txt_nowrap"><? echo $vis_language['TXTCOMPANYNAME']; ?></th>
			   <th class="txt_nowrap"><? echo $vis_language['TXTSTATUS']; ?></th>
               <th></th>
            </tr>
         </thead>
         <tbody>
            <?php for($i=0;$i<count($subaccount_details);$i++) {
               echo '<tr '.(($subaccount_details[$i]['is_banned']==1)?' style="color:#f00">':'>'); ?>
            <td style="cursor:pointer;" data-toggle="ajaxModal" data-modal-arguments="vis_module=client&vis_operation=update_client_details&vis_client_id=<? echo $subaccount_details[$i]['client_id']; ?>&vis_domain_id=<? echo $subaccount_details[$i]['domain_id']; ?>&vis_parent_client_id=<? echo $subaccount_info['client_id']; ?>&vis_static_area=vis_client_update_modal"><? echo $subaccount_details[$i]['first_name'];?></td>
            <td style="cursor:pointer;" data-toggle="ajaxModal" data-modal-arguments="vis_module=client&vis_operation=update_client_details&vis_client_id=<? echo $subaccount_details[$i]['client_id']; ?>&vis_domain_id=<? echo $subaccount_details[$i]['domain_id']; ?>&vis_parent_client_id=<? echo $subaccount_info['client_id']; ?>&vis_static_area=vis_client_update_modal"><? echo $subaccount_details[$i]['last_name'];?></td>
            <td style="cursor:pointer;" data-toggle="ajaxModal" data-modal-arguments="vis_module=client&vis_operation=update_client_details&vis_client_id=<? echo $subaccount_details[$i]['client_id']; ?>&vis_domain_id=<? echo $subaccount_details[$i]['domain_id']; ?>&vis_parent_client_id=<? echo $subaccount_info['client_id']; ?>&vis_static_area=vis_client_update_modal"><? echo $subaccount_details[$i]['email'];?></td>
            <td style="cursor:pointer;" data-toggle="ajaxModal" data-modal-arguments="vis_module=client&vis_operation=update_client_details&vis_client_id=<? echo $subaccount_details[$i]['client_id']; ?>&vis_domain_id=<? echo $subaccount_details[$i]['domain_id']; ?>&vis_parent_client_id=<? echo $subaccount_info['client_id']; ?>&vis_static_area=vis_client_update_modal"><? echo $subaccount_details[$i]['office_name'];?></td>
            
			<td style="cursor:pointer;" data-toggle="ajaxModal" data-modal-arguments="vis_module=client&vis_operation=update_client_details&vis_client_id=<? echo $subaccount_details[$i]['client_id']; ?>&vis_domain_id=<? echo $subaccount_details[$i]['domain_id']; ?>&vis_parent_client_id=<? echo $subaccount_info['client_id']; ?>&vis_static_area=vis_client_update_modal">  <?=($subaccount_details[$i]['is_approved']==1)?'<span class="label vh-green-bg ">'.$vis_language['TXTAPPROVE'].'</span>':'<span class="label label-default">'.$vis_language['TXTPENDING'].'</span>'; ?></td>
            
			<td align="center">
               <a class="text-muted" href="javascript:void(0);"  data-toggle="ajaxModal" data-modal-arguments="vis_module=client&vis_operation=get_client_delete&vis_client_id=<? echo $subaccount_details[$i]['client_id']; ?>&vis_parent_client_id=<? echo $subaccount_info['client_id']; ?>&vis_static_area=vis_client_delete_form&vis_form=vis_child_client_form" title="<? echo $vis_language['TXTDELETE']; ?>"><i class="vh vh-delete-round"></i></a>
            </td>
            </tr>
            <?} ?>
         </tbody>
      </table>
   </div>
   <footer class="wrapper panel-footer bg-white">
      <div class="row">
         <div class="col-sm-9 tkt_left_menu"></div>
         <div class="col-sm-3 text-right text-center-xs tkt_right_menu" id="paging">
            <select name="pageing" class="form-control input-sm selectpicker pull-right paging v-middle" onchange="$(this).parents('#vis_details_list').visExecution('load_area',{'vis_module':'client', 'vis_operation':'get_subaccounts', 'vis_page':this.value ,'vis_client_id':'<? echo $subaccount_info['client_id']; ?>'})">
            <? echo $paging_list;?>
            </select>
            <div class="text-muted pull-right label_page"><? echo $vis_language['TXTPAGE']; ?>:</div>
         </div>
      </div>
   </footer>
   </form>
 <? 
}
else
{
	 include(VIS_PATH_TEMPLATE.'no_record_yet.php');
} ?>
<script type="text/javascript">
	$(".selectpicker").selectpicker(); 
   $(document).ready(function() {	
   $('[data-ride="datatables"]').dataTable({		
           "bPaginate" : false,	
           "aaSorting" : [],
   		"sDom": 't', "bAutoWidth": false,
   		"aoColumns": [
   		  	null,
   		  	null,
   		  	null,
   		  	null,
								null,
   			{ "bSortable": false }
   		]
   	});
   });
</script>
