 <form class="form-horizontal" role="form" id="vis_new_client_form" name="vis_new_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']; ?>" />
				<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">
					</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">
					</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_type1" 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_type2" value="1"><i></i>
                           <?= $vis_language['TXTCALLCLIENT']; ?></label>  </div>
                    </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">
					</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">
					</div>
				</div>
				 <input type="hidden" name="vis_auto_pass" value="1" id="vis_auto_pass" value="1">
				<? if(isset($operation['vis_client_id']) && $operation['vis_client_id'] !=0){ ?>
					<input type="hidden" name="vis_group" id="vis_group" value="<? echo $client_details['group_id'];?>">
					<? } else {?>
					<div class="form-group">
					<label class="col-sm-2 control-label"><? echo $vis_language['TXTORGANIZATION']; ?></label>
					<div class="col-sm-10">
					    <input type="text" class="form-control input-sm" name="vis_organization" id="vis_organization">
						<input type="hidden" name="vis_group" id="vis_group">
					</div>
					<script type="text/javascript">
						$(document).ready(function() { 
							$("#vis_organization").tokenInput(
								"index.php?vis_module=client&vis_operation=get_groupname",
								{
									theme: "facebook",
									searchDelay: 300,
									minChars: 2,
									queryParam: "vis_data",
									propertyToSearch: "group_name",
									tokenValue: "group_name",
									tokenLimit: 3,
									noResultsText: "<? echo $vis_language['TXTNOMATCHFOUND']; ?>",
									preventDuplicates: true,
									resultsFormatter: function(item) {
										return "<li>" + "<div style='display: inline-block; padding-left: 10px;'><div class='full_name'><i class='vh vh-organisation'></i> " + item.group_name + "</div></div></li>";
									},
									tokenFormatter: function(item) {
										return "<li><p>" + item.group_name + "</p></li>";
									},
									onAdd: function(item)
									{
										$('#vis_group').val(item.id);
									}
								}
							);
							$("div.token-input-dropdown-facebook").css('width', $(".token-input-list-facebook").width() + 2 + 'px');
							$("#token-input-vis_new_ticket_list_client").parent().css('width','100%');
						});
					</script>
				</div>
				<?php }?>
				<div class="form-group" id="vis_contact">
					<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"  placeholder="<? echo $vis_language['TXTPHONEEG']; ?>">
						</div>
				</div>
                <input type="hidden" name="vis_auto_pass" id="vis_auto_pass" value="1">
				<input type="hidden" name="vis_group" id="vis_group" value="<?php echo $client_details[0]['group_id'];?>">
				<div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['MSGSENDREGISTRATIONEMAIL']; ?> </label>
               <div class="col-sm-10">
                  <label class="checkbox-inline i-checks">
                  <input type="checkbox" name="vis_sent_mail" value="1" id="vis_sent_mail" checked="checked"><i></i>
                  </label>
               </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">
                          <div class="col-sm-2">
                             <label class="checkbox-inline i-checks pull-right">
                                <input type="checkbox" name="vis_openticket" id="vis_openticket" value="1" 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_view_tickets" id="vis_view_tickets" value="1" ><i></i>
                               </label>
                            </div>
                            <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTTKTPSTGRM']; ?></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" ><i></i>
                             </label>
                          </div>
                          <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTRTKTPSTGRM']; ?></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_rcv_cont_mail" id="vis_rcv_cont_mail" value="1" ><i></i>
                               </label>
                            </div>
                            <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTRECEIVECONTACTMAIL']; ?></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_rcv_pc_cont_mail" id="vis_rcv_pc_cont_mail" value="1" ><i></i>
                               </label>
                            </div>
                            <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTRECIEVEPCLIENTANDCONTACTSMAIL']; ?></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"><i></i>
                             </label>
                          </div>
                          <div class="col-sm-10"><label class="control-label"><? echo $vis_language['TXTBILLINGACCESS']; ?></label></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-lg-offset-1 col-lg-10">
		  <button type="button" class="btn btn-primary" onclick="$(this).visExecution('submit_form',{'vis_module':'client', 'vis_operation':'add_client', 'vis_form':'vis_new_client_form','vis_parent_client_id':'<? echo $client_details[0]['client_id']; ?>'})"><? echo $vis_language['TXTADD']; ?></button>
	</div>
	<? } ?>
</form>
<script>
$(".selectpicker").selectpicker();
enter_pass();
function enter_pass()
{
  if ($('#vis_auto_pass').is(":checked"))
   {
    $('#vis_pass').hide();
   }
   else
   {
     $('#vis_pass').show();
   }
}
 if ($('#vis_client_type1').is(":checked"))
   {
    $('#vis_contact').hide();
   }
	$(document).ready(function () {
	   $('#vis_client_type1').click(function () {
		  $('#vis_contact').hide();
   });
   $('#vis_client_type2').click(function () {                   
		 $('#vis_contact').show();
	});
  });
function toggleType() {
    var obj = document.getElementById('vis_password');
    var obj1 = document.getElementById('vis_confirm');
    if (obj.type == 'text' && obj1.type == 'text') {
        obj.type = 'password';
        obj1.type = 'password';
    } else {
        obj.type = 'text';
        obj1.type = 'text';
    }
}
</script>
