<div>
   <section class="row m-b m-l-none m-r-none ">
      <div class="col-md-4">
         <div class="wrapper text-center">
         <? if($client_details[0]['image_path']=='' || $client_details[0]['image_path']=='default.jpg'){?>
<div class="l-avatar padder-v m-t-lg m-b-sm">
<? if($client_details[0]['first_name']!=''){
	$firstname=preg_split('//u', $client_details[0]['first_name'], -1, PREG_SPLIT_NO_EMPTY);
$lastname=preg_split('//u', $client_details[0]['last_name'], -1, PREG_SPLIT_NO_EMPTY);
	?>
<div class="lg"><? echo ucfirst($firstname[0]).ucfirst($lastname[0]);?></div>
    <? }else{ ?>
    <img class="lg bg-white img-responsive" src="<?= VIS_PATH_PROFILE.'default.jpg';?>">
    <? }?>

</div>
<? }else{ ?>
<div class="l-avatar padder-v m-t-lg m-b-sm">
<img src="<? echo $client_details[0]['domain_url'].'awatar/'.VIS_PATH_PROFILE;  echo $client_details[0]['image_path']; ?>" class="lg bg-white img-responsive">
</div>
<? }?>
            <!--<div class="thumb-lg padder-v m-t-lg avatar m-b-sm">
               <img src="<? //echo $client_details[0]['domain_url'].'awatar/'.VIS_PATH_PROFILE;  echo ($client_details[0]['image_path']=='')?'default.jpg':$client_details[0]['image_path']; ?>" class="bg-white img-responsive ">
            </div>-->
            <div>
               <?  if($client_details[0]['is_banned']==1 ) {?>
               <span id="ban_label" class="label vh-danger-bg inline"><? echo $vis_language['TXTBANNED']; ?></span>
               <? }if($client_details[0]['is_banned']!=1 && $client_details[0]['is_spam']!=1 ){?>
               <span id="approve_label" class="<?if($client_details[0]['is_approved']==1){ echo "label vh-green-bg inline"; }else{ echo "label label-default inline";}?> "><?if($client_details[0]['is_approved']==1){ echo $vis_language['TXTAPPROVED']; }else {echo $vis_language['TXTPENDING'];}?></span>
               <? }if($client_details[0]['is_banned']!=1 && $client_details[0]['is_spam']==1 ) {?>
               <span id="spam_label" class="label vh-grey-bg inline"><? echo $vis_language['TXTSPAM']; ?></span>
               <? }?>
            </div>
         </div>
      </div>
      <div class="col-md-8" id="short_summary">
         <div class="wrapper">
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold "><? echo $vis_language['TXTCLIENTNAME']?>:</span>
               <div class=" col-xs-8 text-lt text-muted h4"><? echo $client_details[0]['initials'].' '.$client_details[0]['first_name'].' '.$client_details[0]['last_name']; 
                  ?><? $verified = ' <span class="text-md text-muted">('.$vis_language['TXTVERIFIED'].')</span>';
                  $notVerified = ' <span class="text-md text-muted"> ('.$vis_language['TXTNOTVERIFIED'].')</span>';
                  echo ($twoFactorAuth == 1)?(($client_details[0]['is_verified']==1)?$verified:$notVerified):''; ?></div>
            </div>
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold "><? echo $vis_language['TXTEMAILADDRESS']?>:</span>
               <div class=" col-xs-8 text-lt text-muted"><? echo $client_details[0]['email']; ?></div>
            </div>
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold "><? echo $vis_language['TXTDOMAIN']?>:</span>
               <div class=" col-xs-8 text-lt text-muted"><? echo $client_details[0]['domain_name']; ?></div>
            </div>
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold "><? echo $vis_language['TXTORGANIZATION']?>:</span>
               <div class=" col-xs-8 text-lt text-muted"><? echo $client_details[0]['group_name'];?></div>
            </div>
            <? if($client_details[0]['parent_id']!=0){?>
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold ">Parent: </span>
               <div class=" col-xs-8 text-lt text-muted"><? echo $client_parent_details[0]['initials'].' '.$client_parent_details[0]['email']; ?></div>
            </div>
            <? } ?>
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold "><? echo $vis_language['TXTCOMPANY']?>:</span>
               <div class=" col-xs-8 text-lt text-muted"><? echo $client_details[0]['office_name'];?></div>
            </div>
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold "><? echo $vis_language['TXTCONTACTNUMBER']?>:</span>
               <div class=" col-xs-8 text-lt text-muted"><? echo $client_details[0]['contact_number'];?>
                  <?php if($twilio_details!=-1 && $client_details[0]['contact_number']!=''){?>
                  <a href="javascript:void(0);" data-toggle="ajaxModal" data-modal-arguments="vis_module=voip&vis_operation=twilio_new_call&vis_to_number=<? echo $client_details[0]['contact_number'];?>"><i class="vh vh-call vh-green vh-lg"></i><?=$vis_language['TXTCALL']?></a>
                  <?php }?>
               </div>
            </div>
            <div class="row m-b-sm">
               <span class="col-xs-4 text-right font-bold "><? echo $vis_language['TXTADDRESS']?>:</span>
               <div class=" col-xs-8 text-lt text-muted">
                  <? echo $client_details[0]['temporary_address'];
                     if($client_details[0]['city']!='') echo ', <br/>'.$client_details[0]['city'];
                     if($client_details[0]['state']!='') echo ', '.$client_details[0]['state'];
                     if($client_details[0]['country']!='') echo ', '.$client_details[0]['country'];
                      ?>
               </div>
            </div>
         </div>
      </div>
      <!-- /.wrapper -->
 
        <!-- /.wrapper -->
    
</section>
</div>
<div class="line b-b line-lg pull-in"></div>
<br/>

<br/>   
<div class="form-horizontal">
   <div class="col-sm-1"></div>
   <div class="col-sm-11">
      <div class="radio i-checks pull-left m-r-lg">
         <label>
         <input type="radio" name="vis_password_btn" id="vis_updatepassword" value="1" checked="checked"><i></i>
         <? echo $vis_language['TXTUPDATECONTACT']; ?>
         </label>
      </div>
      <div class="radio i-checks pull-left">
         <label>
         <input type="radio" id="vis_resetpassword" name="vis_password_btn" value="0" ><i></i>
         <? echo $vis_language['TXTSENDRESETPASSWORDEMAIL']; ?>
         </label>
      </div>
   </div>
</div>
<div>
<div class="line b-b line-lg pull-in"></div><br/>  
<br/>
<br/>        
<form class="form-horizontal" role="form" id="vis_update_client_form" name="vis_update_client_form" method="post">
   <input type="hidden" name="vis_client_id" id="vis_client_id" value="<? echo $operation['vis_client_id']; ?>" />
   <input type="hidden" name="vis_domain" id="vis_domain" value="<? echo $operation['vis_domain_id']; ?>" />
   <?if($operation['vis_static_area']!='vis_client_update_modal'){?>
   <div class="form-group">
      <label for="vis_domain" class="col-sm-2 control-label"><? echo $vis_language['TXTDOMAIN']; ?></label>
      <div class="col-sm-10">
         <select class="form-control selectpicker" name="vis_domain" id="vis_domain"<? if(count($domain_details)>10) echo ' data-live-search="true"';?>>							
         <?
            for($i=0;$i<count($domain_details);$i++){
            	echo '<option value="'.$domain_details[$i]['domain_id'].'"'.(($domain_details[$i]['domain_id']==$client_details[0]['domain_id'])?' selected="selected"':'').'>'.$domain_details[$i]['domain_name'].'</option>';
            } ?>
         </select>
      </div>
   </div>
   <? } ?>                        
   <div class="form-group">
      <label for="vis_firstname" class="col-sm-2 control-label"><? echo $vis_language['TXTFIRSTNAME']; ?></label>
      <div class="col-sm-10">
         <input type="text" class="form-control input-sm" data-type="text" data-required="true" name="vis_firstname" id="vis_firstname" value="<? echo $client_details[0]['first_name']; ?>">
      </div>
   </div>
   <div class="form-group">
      <label for="vis_lastname" class="col-sm-2 control-label"><? echo $vis_language['TXTLASTNAME']; ?></label>
      <div class="col-sm-10">
         <input type="text" class="form-control input-sm" data-type="text" data-required="true" name="vis_lastname" id="vis_lastname" value="<? echo $client_details[0]['last_name']; ?>">
      </div>
   </div>
   <div class="form-group">
      <label for="vis_email" class="col-sm-2 control-label"><? echo $vis_language['TXTEMAIL']; ?></label>
      <div class="col-sm-10">
         <input type="email" class="form-control input-sm" data-type="email" data-required="true" name="vis_email" id="vis_email" value="<? echo $client_details[0]['email']; ?>">
      </div>
   </div>
   <div class="form-group">
      <label for="vis_username" class="col-sm-2 control-label"><? echo $vis_language['TXTUSERNAME']; ?></label>
      <div class="col-sm-10">
         <input type="text" class="form-control input-sm" name="vis_username" id="vis_username" value="<? echo $client_details[0]['user_name']; ?>">
      </div>
   </div>
   <div class="form-group">
		<label for="PhoneNumber" class="col-sm-2 control-label"><? echo $vis_language['TXTCONTACTNUMBER']; ?></label>
		<div class="col-sm-10">
			<input type="tel" class="form-control input-sm" name="vis_contact_number" id="vis_contact_number" data-type="phone" value="<? echo $client_details[0]['contact_number']; ?>"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                >
			</div>
	</div>
   <?
      if(isset($operation['vis_client_id']) && $operation['vis_client_id'] !=0){ ?>
   <div class="b-2x b-t m-b-md"></div>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTACCESS']; ?></label>
      <div class="col-sm-10">
         <div>
            <label class="checkbox-inline i-checks">
            <input type="checkbox" name="vis_openticket" id="vis_openticket" value="1"<? if($client_setting[3]!=0) echo ' checked="checked"'; ?>><i></i>
            </label>
            <label class="control-label"><? echo $vis_language['TXTVIEWREPLYSELFTICKET']; ?></label>
         </div>
         <div>
            <label class="checkbox-inline i-checks">
            <input type="checkbox" name="vis_view_tickets" id="vis_view_tickets" value="1"<? if($client_setting[2]!=0) echo ' checked="checked"'; ?>><i></i>
            </label>
            <label class="control-label"><? echo $vis_language['TXTTKTPSTGRM']; ?></label>
         </div>
         <div>                                
            <label class="checkbox-inline i-checks">
            <input type="checkbox" name="vis_replyticket" id="vis_replyticket" value="1"<? if($client_setting[4]!=0) echo ' checked="checked"'; ?>><i></i>
            </label>
            <label class="control-label"><? echo $vis_language['TXTRTKTPSTGRM']; ?></label>
         </div>
		  <div>                                
            <label class="checkbox-inline i-checks">
            <input type="checkbox" name="vis_rcv_cont_mail" id="vis_rcv_cont_mail" value="1"<? if($client_setting[6]!=0) echo ' checked="checked"'; ?>><i></i>
            </label>
            <label class="control-label"><? echo $vis_language['TXTRECEIVECONTACTMAIL']; ?></label>
         </div>
		 <div>                                
            <label class="checkbox-inline i-checks">
            <input type="checkbox" name="vis_rcv_pc_cont_mail" id="vis_rcv_pc_cont_mail" value="1"<? if($client_setting[7]!=0) echo ' checked="checked"'; ?>><i></i>
            </label>
            <label class="control-label"><? echo $vis_language['TXTRECIEVEPCLIENTANDCONTACTSMAIL']; ?></label>
         </div>
		 <? if( VIS_MODULE_ACCESS_BILLING==1){ ?> <div>
            <label class="checkbox-inline i-checks">
            <input type="checkbox" name="vis_billingacess" id="vis_billingacess" value="1"<? if($client_setting[5]!=0) echo ' checked="checked"'; ?>><i></i>
            </label>
            <label class="control-label"><? echo $vis_language['TXTBILLINGACCESS']; ?></label>
         </div>
         <? } ?>
		 
      </div>
   </div>
   <div class="line b-b line-lg pull-in"></div>
     <div class="form-group">
            <div class="col-xs-6">
                <div class="form-group  m-t-xl" id="ban_status1">
                    <label class="col-xs-10 col-md-6 m-l-n control-label"><? echo $vis_language['TXTBAN']; ?></label>
                    <div class="col-sm-2">
                        <label class="switch">
                        <input type="checkbox" name='is_ban' <?if($client_details[0]['is_banned']==1) echo 'checked="checked"';?>>
                        <span></span>
                        </label>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="form-group" id="spam_status1">
                    <label class="col-xs-10 col-md-6 m-l-n control-label"><? echo $vis_language['TXTSPAM'];?></label>
                    <div class="col-sm-2">
                        <label class="switch">
                        <input type="checkbox" name='is_spam' <? if($client_details[0]['is_spam']==1) echo 'checked="checked"';?>>
                        <span></span>
                        </label>
                    </div>
                </div>
                <div class="clearfix"></div>
                <div class="form-group" id="approve_status1">
                    <label class="col-xs-10 col-md-6 m-l-n control-label"><? echo $vis_language['TXTAPPROVE']; ?></label>
                    <div class="col-sm-2">
                        <label class="switch">
                        <input type="checkbox" name='is_approved' <? if($client_details[0]['is_approved']==1) echo 'checked="checked"';?>>
                        <span></span>
                        </label>
                    </div>
                </div>
               </div> 
            </div>
   <? }?>
   <? if(!isset($operation['vis_static_area']) && $operation['vis_static_area']!='vis_client_add_modal'){?>
   <div class="b-2x b-t m-b-md"></div>
   <div class="col-sm col-sm-offset-2">
      <button type="button" class="btn btn-primary" onclick="$(this).visExecution('submit_form',{'vis_module':'client', 'vis_operation':'update_client', 'vis_form':'vis_update_client_form','vis_client_id':'<? echo $client_details[0]['client_id']; ?>','vis_parent_client_id':'<? echo $client_details[0]['parent_id']; ?>'})"><? echo $vis_language['TXTUPDATE']; ?></button>
   </div>
   <? } ?>
</form>
<form class="form-horizontal" data-validate="parsley" id="vis_reset_email_form" name="vis_reset_email_form" style="display:none;">
   <div class="form-group">
      <div class="col-sm-3 col-sm-offset-3">
         <button onclick="$('#vis_global_msg_div').visExecution('load_operations', {'vis_module':'client', 'vis_operation':'reset_send_password', 'vis_client_id': '<?= $client_details[0]['client_id']; ?>'})" class="btn btn-primary" type="button"><? echo $vis_language['TXTSEND']; ?></button>
      </div>
   </div>
</form>
<script>
   $(".selectpicker").selectpicker();
   enter_pass();
   function enter_pass()
   {
     if ($('#vis_reset_pass').is(":checked"))
      {
        $('#vis_pass').show();
      }
      else
      {
        $('#vis_pass').hide();
      }
   }
   function toggleType() {
       var obj = document.getElementById('vis_password');
       if (obj.type == 'text') {
           obj.type = 'password';
       } else {
           obj.type = 'text';
       }
   }
   	$("#vis_updatepassword").change( function(){ $("#vis_reset_email_form").hide();$("#vis_update_client_form").show(); $(".modal-footer").show(); });
   	$("#vis_resetpassword").change( function(){ $("#vis_reset_email_form").show();$("#vis_update_client_form").hide(); $(".modal-footer").hide(); });
</script>

