<? global $vis_language;?>
<style>
.not-active {
 pointer-events: none;
 cursor: default;
}
</style>
<div class="wrapper">
	 <div class="row m-b-sm">
		 <span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTCLIENTNAME']?>:</span>
		<div class=" col-xs-9 text-lt text-muted h4"><? echo $client_details['initials'].' '.$client_details['first_name'].' '.$client_details['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['is_verified']==1)?$verified:$notVerified):''; ?></div>
		
		  </div>
      <div class="row m-b-sm">
		  <span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTEMAILADDRESS']?>:</span>
		<div class=" col-xs-9 text-lt text-muted"><? echo $client_details['email']; ?></div>
		  </div>
	<?php if($client_details['group_id']!=1){?>
	<div class="row m-b-sm">
		<?$vis_domain =  (VIS_SATELLITE_HELPDESK == 2 || VIS_SATELLITE_HELPDESK == 3) ? $client_details['option_domain_name']:$client_details['domain_name'];
		?>
		<span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTDOMAIN']?>:</span>
		<div class=" col-xs-9 text-lt text-muted"><? echo $vis_domain; ?></div>
	</div>	
	<?php }?>
	<div class="row m-b-sm">
		<span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTORGANIZATION']?>:</span>
		<div class=" col-xs-9 text-lt text-muted"><? echo $client_details['group_name'];?></div>
	</div>
	<? if($client_details['parent_id']!=0){?>
	<div class="row m-b-sm">
		<span class="col-xs-3 text-right font-bold ">Parent: </span>
		<div class=" col-xs-9 text-lt text-muted"><a href="#/client/client_details/<?= $parent_details['first_name'].' '.$parent_details['last_name'] ?>/<?= $client_details['parent_id']; ?>" class="link"><? echo $parent_details['initials'].' '.$parent_details['first_name'].' '.$parent_details['last_name']; ?></a></div>
	</div><? } if($client_details['group_id']==1){?>
	<div class="row m-b-sm">
		<span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTCOMPANY']?>:</span>
		<div class=" col-xs-9 text-lt text-muted"><? echo $client_details['office_name'];?></div>
	</div><? } ?>
	<div class="row m-b-sm">
		<span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTCONTACTNUMBER']?>:</span>
		<div class=" col-xs-9 text-lt text-muted"><? echo $client_details['contact_number'];?>
			<?php if($twilio_details!=-1 && $client_details['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['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-3 text-right font-bold "><? echo $vis_language['TXTADDRESS']?>:</span>
		<div class=" col-xs-9 text-lt text-muted">
			 <? echo $client_details['temporary_address'];
			if($client_details['city']!='') echo ', <br/>'.$client_details['city'];
			if($client_details['state']!='') echo ', '.$client_details['state'];
			if($client_details['country']!='') echo ', '.$client_details['country'];
		  ?>
		</div>
	</div>
<?  if($setting_details!=-1 && $setting_details[0]['content']==1) { ?>
	<div class="row m-b-sm" id="home">
		  <span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTADDITIONALEMAILS']?>:</span>
		  <div class=" col-xs-9 text-lt text-muted" id="emailaddress">
		   <? foreach($email as $i){
			    $title='';$class='';$style='';
				if($i['is_verified']!=1){
				  $title=$vis_language['TXTRESEND'];
				  $style="color: #428bca;";
						$style1="text-decoration:line-through;";
			    }else{
				  $title="";
				  $style="color: #428bca;"; 
				  $class="not-active";
						$style1="";
			  }?>
		  <p><span style=" <? echo $style1;?>"><? echo $i['additional_email'];?></span>&nbsp;&nbsp;<input type="hidden" id="vis_client_id" name="vis_client_id" value="<? echo $client_details['client_id'];?>"><a href="javascript:void(0)" title="<? echo $vis_language['TXTDELETE']; ?>" value="<? echo $i['email_id'];?>" onClick="removedata(<? echo $i['email_id'];?>);"> <i class="vh vh-cross-slim"></i> </a>&nbsp;<a href="javascript:void(0)" value="" onClick="emailVerify(<? echo $i['email_id'];?>);" style="<? echo $style;?>" class="<? echo $class;?>"> <? echo $title; ?> </a></p> <?}?>
		  <input type="hidden" id="vis_client_id" name="vis_client_id" value="<? echo $client_details['client_id'];?>">
		  </div>
	</div><?}?>
    <? if($client_details['parent_id']==0 && VIS_MODULE_ACCESS_BILLING==1){ ?>
	<div class="row m-b-sm">
		<span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTCASHBAL']?>:</span>
		<div class=" col-xs-9 text-lt text-muted"><? echo $client_details['credit'].' ('.$domain['currency'].')'; if($amountCredit  != -1) {?>  <a data-modal-arguments="vis_module=billing&vis_operation=manage_credit&vis_static_area=vis_add_balance_dialog&vis_client_id=<? echo $client_details['client_id'];?>&credit_type=0" data-toggle="ajaxModal" href="javascript:void(0);" class="link"><?php echo $vis_language['TXTMANAGECREDIT']; ?></a><?php } ?></div>
	</div>
	<div class="row m-b-sm">
		<span class="col-xs-3 text-right font-bold "><? echo $vis_language['TXTTKTBAl']?>:</span>
		<div class=" col-xs-9 text-lt text-muted"><? echo ($client_details['balance']<0)?$vis_language['TXTUNLIMITED']:$client_details['balance'];  if($ticketCredit != -1) {?> <a data-modal-arguments="vis_module=billing&vis_operation=manage_credit&vis_static_area=vis_add_balance_dialog&vis_client_id=<? echo $client_details['client_id'];?>&credit_type=1" data-toggle="ajaxModal" href="javascript:void(0);" class="link"><?php echo $vis_language['TXTMANAGECREDIT']; ?></a><?php } ?></div>
	</div>
    <? } ?>
</div>

<script>
function removedata(val){ 
	var client = $('#vis_client_id').val();
	$.ajax({
           url: 'index.php',
           data: {'vis_module':"client", 'vis_operation':"remove_email", 'vis_remove_email':val, 'vis_client_id':client},
           success: function(data) {  
		        $("div#emailaddress").html(data); 
				$("#vis_global_msg_div").visInterface("load_global_message", "<?=$vis_language['MSGSUCCOPRT'];?>");
		   },
		    error: function() {
            alert('ERROR!!!');
         }
       });
}
function emailVerify(emailID){ 
var client = $('#vis_client_id').val();
	$.ajax({
           url: 'index.php',
           data: {'vis_module':"client", 'vis_operation':"check_verify_email", 'vis_static_area':1,'vis_verify_email':emailID, 'vis_client_id':client,'domain_id':'<? echo $client_details['domain_id'];?>'},
           success: function(data) {  
		    $("#vis_global_msg_div").visInterface("load_global_message", "<?=$vis_language['MSGSUCCOPRT'];?>");
		   },
		    error: function() {
            alert('ERROR!!!');
         }
    });
}
</script>
