<?  global $vis_language;
    $header_title=$vis_language['TXTCONTACTS']; 
	$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(isset($request_data['incorrect']) && $request_data['incorrect']=='email') { ?>
        <script> $("#vis_submit_msg_div").show(); $("#vis_submit_msg_div").html('<? echo $vis_language['MSGCLTEMAILEXIST']; ?>'); </script><? } 
        if(isset($operation['reg_message']) && $operation['reg_message']!='') { ?><script> $("#vis_submit_msg_div").show(); $("#vis_submit_msg_div").html('<? echo $operation['reg_message']; ?>'); </script><? } ?>
  <section class="container">
   <div class="row">
      <div class="col-md-12">
         <section class="panel shadow-none">
           
            <form class="vis_contacts_form" method="post">
            <div class="row padder clr" <? if($subaccount_details==-1) echo 'style="display:none;"'; ?>>
				<div class="col-sm-9 m-t-xs">
					 <div class="panel-heading m-t-lg">
					   <p class="pull-right m-t-n-lg">
					   <a class="btn btn-link btn-sm vis_link_button link pull-right text-xm m-t-xs" href="index.php?/client/add-contact"><? echo $vis_language['TXTADDCONTACT']; ?></a></p>             
                  </div>
				</div>
				<div class="col-sm-3 text-right text-center-xs tkt_right_menu">
                        <ul class="pagination-sm pagination" id="task_pagination"></ul>
               </div>
			</div>
            <div class="list-unstyled padder m-b-none table-responsive scroll-x" id="vis_subaccount_list" <? if($subaccount_details==-1) echo 'style="display:none;"'; ?>>
			  <? include_once(VIS_PATH_TEMPLATE.'subaccount_list.php'); ?>
            </div>
              <div class="row padder clr m-b" <? if($subaccount_details==-1) echo 'style="display:none;"'; ?>>
				<div class="col-sm-9"></div>
				<div class="col-sm-3 text-right text-center-xs tkt_right_menu">
                        <ul class="pagination-sm pagination" id="task_pagination1"></ul>
           </div>
			</div>
			<input type="hidden" name="vis_page" id="vis_page" value="">
			<input type="hidden" name="vis_module" value="client">
			<input type="hidden" name="vis_operation" value="get_subaccounts">
			</form>
            <section class="wrapper fullFrame" id="no_record_found" <? if($subaccount_details!=-1) echo 'style="display:none;"'; ?>>
			<div class="col-sm-12 m-t-xs">
					 <div class="panel-heading m-t-lg">
					   <p class="pull-right m-t-n-lg">
					   <a class="btn btn-link btn-sm vis_link_button link pull-right text-xm m-t-xs" href="index.php?/client/add-contact"><? echo $vis_language['TXTADDCONTACT']; ?></a></p>             
                  </div>
				</div>
                <div class="fullMiddle m-xl text-center h4"><?= $vis_language['TXTNOTHINGTODISPLAY']; ?></div>
            </section>
          </section>
      </div>
   </div>
</section>
<script>
<? if($view_info['page_count']>0) {?>
    $('.pagination-sm').twbsPagination({
		totalPages:<?php echo $view_info['page_count']; ?>,
		visiblePages:3,
		first:false,
		last:false,
		onPageClick: function (event, page) {     
		$.ajax({
		url: 'index.php',
		data: {'vis_module':"client", 'vis_operation':"get_subaccounts", 'vis_page':page-1, 'vis_form':'vis_task_form1', 'vis_change':1},
		type: "POST",
		success: function(data) {            
			$("#vis_subaccount_list").html(data);
		}
		});
          }
      });
<? }?>
function load_page(page) {
	$('#vis_page').val(page);
	$(".vis_contacts_form").submit();
}
</script>
