<? global $vis_language;?>
<form class="form-horizontal" role="form" id="vis_client_form" name="vis_client_form" method="post">
	<div class="row">
	<div class="col-md-12">	
		 <div class="form-group">
               <div class="col-sm-12"><h5><? echo $vis_language['TXTPERSNDET']; ?></h5></div>
            </div>
            <div class="line b-b line-lg pull-in"></div>
            <br/> 
	<div class="col-md-6"><div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTINITIALS']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" name="vis_initials" id="vis_initials" type="text" value="<? echo $client_details['initials']; ?>">
			</div>	
		</div>	
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTFIRSTNAME']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_firstname" id="vis_firstname" value="<? echo $client_details['first_name']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTLASTNAME']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_lastname" id="vis_lastname" value="<? echo $client_details['last_name']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTGENDER']; ?></label>
			<div class="col-sm-10">
				<select class="form-control input-sm selectpicker" name="vis_gender" id="vis_gender" >
					<option value="0"><? echo $vis_language['TXTMALE']; ?></option>
					<option value="1"<? echo ($client_details['gender']==1)?' selected="selected"':''; ?>><? echo $vis_language['TXTFEMALE']; ?></option>
				</select>
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCLIENTTYPE']; ?></label>
			<div class="col-sm-10">
				 <div class="radio i-checks m-r-lg pull-left"><label>
                  <input type="radio" name="vis_client_type" <?php echo ($client_details['client_type']==0)?'checked="checked"':''?> id="vis_client_type" value="0"><i></i>
                  <?= $vis_language['TXTEMAILCLIENT']; ?></label>  </div>
                  <div class="radio i-checks m-r-lg pull-left"><label>
                  <input type="radio"  name="vis_client_type" <?php echo ($client_details['client_type']==1)?'checked="checked"':''?> id="vis_client_type" value="1"><i></i>
                   <?= $vis_language['TXTCALLCLIENT']; ?></label>  </div>
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTEMAIL']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_email" id="vis_email" value="<? echo $client_details['email']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTUSERNAME']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_username" id="vis_username" value="<? echo $client_details['user_name']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCONTACTNUMBER']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_contact_number" id="vis_contact_number" value="<? echo $client_details['contact_number']; ?>"  placeholder="<? echo $vis_language['TXTPHONEEG']; ?>">
			</div>	
		</div>
		 <div class="form-group">
			<label class="col-sm-2 control-label"><? echo $vis_language['TXTLANGUAGE']; ?></label>
			<div class="col-sm-10">
				<select class="form-control input-sm selectpicker" name="vis_language" <? if(count($language_list)>10) echo 'data-live-search="true"';?>> <?
				for($i=0;$i<count($language_list);$i++) { ?>
					<option value="<? echo $language_list[$i]['language_id']; ?>"<? if($client_details['language']==$language_list[$i]['language_id']) echo ' selected="selected"'?>><? echo $language_list[$i]['language_name']; ?></option><?
				} ?> </select>
			</div>
		</div> 
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTFAX']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_fax" id="vis_fax" value="<? echo $client_details['fax']; ?>">
			</div>	
		</div>
	</div>
	<div class="col-md-6">
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTWEBSITE']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_website" id="vis_website" value="<? echo $client_details['website']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCURRENTADDRESS']; ?></label>
			<div class="col-sm-10">
				<textarea type="text" class="form-control input-sm" name="vis_caddress" id="vis_caddress"><? echo $client_details['temporary_address']; ?></textarea>
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTPERMANETADDRESS']; ?></label>
			<div class="col-sm-10">
				<textarea type="text" class="form-control input-sm" name="vis_paddress" id="vis_paddress"><? echo $client_details['permanent_address']; ?></textarea>
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCITY']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_city" id="vis_city" value="<? echo $client_details['city']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTSTATE']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_state" id="vis_state" value="<? echo $client_details['state']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCOUNTRY']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_country" id="vis_country" value="<? echo $client_details['country']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTZIPCODE']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_zipcode" id="vis_zipcode" value="<? echo $client_details['zip_code']; ?>">
			</div>	
		</div>
        <? if($client_details['parent_id']==0) { ?>
        <div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTORGANIZATION']; ?></label>
			<div class="col-sm-10">
				<select class="form-control input-sm selectpicker" name="vis_group" id="vis_group"><?
                    for($i=0;$i<count($client_group);$i++)
                    {
                       if($client_details['parent_id']!=0) { if($client_details['group_id'] == $client_group[$i]['group_id']) $client_group_selected =''; 
                         else $client_group_selected ='disabled="disabled"'; 
                       }
                       else $client_group_selected =''; 

                       echo '<option value="'.$client_group[$i]['group_id'].'" '.$client_group_selected.' '.(($client_group[$i]['group_id']==$client_details['group_id'])?' selected="selected"':'').'>'.$client_group[$i]['group_name'].'</option>'; 

                    }?>
                </select>
			</div>	
        </div><? }else { echo "<input type='hidden' name='vis_group' value='".$client_details['group_id']."'>"; } ?>
        <div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTISMANAGER']; ?></label>
			<div class="col-sm-10">
				
                  <div class="radio i-checks m-r-lg pull-left"><label>
                  <input type="radio"  name="vis_is_manager" <?php echo ($client_details['is_manager']==1)?'checked="checked"':''?> id="vis_is_manager" value="1"><i></i>
                   <?= $vis_language['TXTYES']; ?></label>  </div>
                   
                    <div class="radio i-checks m-r-lg pull-left"><label>
				
                  <input type="radio" name="vis_is_manager" <?php echo ($client_details['is_manager']==0)?'checked="checked"':''?> id="vis_is_manager" value="0"><i></i>
                  <?= $vis_language['TXTNO']; ?></label>  </div>
			</div>	
		</div>
	</div>
	</div>
	</div>
	<div class="row" id="vis_comp_details">
	<div class="col-md-12">	
	<div class="form-group">
       <div class="col-sm-12"><h5><? echo $vis_language['TXTCOMPDETAIL']; ?></h5></div>
    </div>
    <div class="line b-b line-lg pull-in"></div>
    <br/> 	
	<div class="col-md-6">
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCOMPANYNAME']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_office_name" id="vis_office_name" value="<? echo $client_details['office_name']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCOMPANYEMAIL']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_office_email" id="vis_office_email" value="<? echo $client_details['office_email']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTOTHERFAX']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_office_fax" id="vis_office_fax" value="<? echo $client_details['office_fax']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTCOMPANYWEBSITE']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_office_website" id="vis_office_website" value="<? echo $client_details['office_website']; ?>">
			</div>	
		</div>
	</div>
	<div class="col-md-6">
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTNETMEETINGID']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_netmeeting" id="vis_netmeeting" value="<? echo $client_details['netmeetingid']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTOTHERIM']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_otherim" id="vis_otherim" value="<? echo $client_details['otherim']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTJOBTITLE']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_job_title" id="vis_job_title" value="<? echo $client_details['job_title']; ?>">
			</div>	
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label p-d-sm"><?= $vis_language['TXTDEPARTMENT']; ?></label>
			<div class="col-sm-10">
				<input class="form-control input-sm" type="text" name="vis_department" id="vis_department" value="<? echo $client_details['department']; ?>">
			</div>	
		</div>
	</div>
	</div>		
	</div>	
     <? if($client_details['parent_id']!=0){?>
    <div class="b-t m-b-md"></div>
    <div class="row">
	<div class="col-md-12">	
        <div class="col-md-6">
            <div class="form-group">
              <div class="col-sm-2">
                 <label class="checkbox-inline i-checks pull-right">
                    <input type="checkbox" name="vis_openticket" id="vis_openticket" value="1"<? if($client_setting[3]!=0) echo ' checked="checked"'; ?>><i></i>
                 </label>
              </div>
              <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTVIEWREPLYSELFTICKET']; ?></label></div>
           </div>
           <div class="form-group">
				<div class="col-sm-2">
				   <label class="checkbox-inline i-checks pull-right">
						<input type="checkbox" name="vis_replyticket" id="vis_replyticket" value="1"<? if($client_setting[4]!=0) echo ' checked="checked"'; ?>><i></i>
				   </label>
				</div>
				 <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTRTKTPSTGRM']; ?></label></div>
			 </div> 
        </div>
     <div class="col-md-6">
		 <div class="form-group">
        <div class="col-sm-2">
           <label class="checkbox-inline i-checks pull-right">
                <input type="checkbox" name="vis_view_tickets" id="vis_view_tickets" value="1"<? if($client_setting[2]!=0) echo ' checked="checked"'; ?>><i></i>
           </label>
        </div>
        <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTTKTPSTGRM']; ?></label></div>
     </div>
      <?if(VIS_MODULE_ACCESS_BILLING==1){?>
            <div class="form-group">
              <div class="col-sm-2">
                 <label class="checkbox-inline i-checks pull-right">
                    <input type="checkbox" name="vis_billingacess" id="vis_billingacess" value="1"<? if($client_setting[5]!=0) echo ' checked="checked"'; ?>><i></i>
                 </label>
              </div>
              <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTBILLINGACCESS']; ?></label></div>
           </div><? } ?>
      </div>
     </div></div><? } ?>
	<div class="line b-b line-lg pull-in"></div>
    
    <? if($custom_field_var!='' && $custom_field_var!=$vis_language['MSGRECORDMISS']){ ?>
    <div class="form-group m-t">
       <div class="col-sm-12"><h5><? echo $vis_language['TXTADDITIONALFIELDS']; ?></h5></div>
    </div>
    <div class="line b-b line-lg pull-in"></div>
    <br/>
    <div class="row m-l">
        <?= $custom_field_var; ?>
    </div>
    <input type="hidden" name="vis_customfields" id="vis_customfields" value="1"/>
    <div class="line b-b line-lg pull-in"></div>
    <? } ?>
    
   <br/>
	<div class="col-lg-offset-1 col-lg-10">
		<input type="hidden" name="vis_client_id" value="<? echo $client_details['client_id']; ?>" />
		<input type="hidden" name="vis_domain" value="<? echo $client_details['domain_id']; ?>" />
		  <button type="button" class="btn btn-primary" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'client', 'vis_operation':'update_client', 'vis_form':'vis_client_form','vis_client_id':<? echo $client_details['client_id']; ?>});"><? echo $vis_language['TXTUPDATE']; ?></button>
	</div>
</form>
<script>
$(".selectpicker").selectpicker();
if($('#vis_group').val()!=1) $("#vis_comp_details").hide();
$('#vis_group').on('change', function() {
	if(this.value==1)
	$("#vis_comp_details").show();
	else
	$("#vis_comp_details").hide();
});
</script>
