<? global $vis_language; ?>
<section id="breadcrumb" class="row m-b m-l-none m-r-none">
   <div class="col-sm-6">
      <h3 class="m-b-xs text-black"><? echo $currentPage;?></h3>
      <ul class="breadcrumb bg-empty no-border m-b-xxs no-padder">
         <li><a class="link" href="#/home/quick_view/<? echo $vis_language['TXTHOME']; ?>"><? echo $vis_language['TXTHOME']; ?></a></li>
         <li><a class="link" href="#/setting/setting_menu/<? echo $vis_language['TXTSETTINGS']; ?>"><? echo $vis_language['TXTSETTINGS']; ?></a></li>
         <li><a class="link" href="#/setting/active_directory/<? echo $vis_language['TXTACTIVEDIRECTORY']; ?>" class="link"><? echo $vis_language['TXTACTIVEDIRECTORY']; ?></a> </li>
         <li class="active"><? echo $currentPage;?></li>
      </ul>
   </div>
</section>
<section class="padder">
   <section class="panel panel-default">
      <header class="panel-heading sub_header"><? echo $currentPage; ?></header>
      <div class="panel-body">
         <form class="form-horizontal" id="vis_single_form" name="vis_single_form" method="post" >
            <div class="form-group">
				<label class="col-sm-2 control-label"><?= $vis_language['TXTDOMAIN']; ?></label>
				<div class='col-sm-10'>
					<select class='form-control input-sm selectpicker' name="vis_department" id="vis_department" <? if(count($domain_list) > 10) echo 'data-live-search="true"' ?>>
						<option value="0">-- <? echo $vis_language['TXTSELECTDOMAIN']; ?> --</option>
						<? for($i=0;$i<count($domain_list);$i++) {
								$selected = ($domain_list[$i]['domain_id'] == $active_dir_details['domain_id'])? 'selected="selected"' :'';
								echo '<option value="'.$domain_list[$i]['domain_id'].'" '.$selected.'>'.$domain_list[$i]['domain_name'].'</option>';
						} ?>
					</select>
				</div>
			</div>

            <div class="form-group">
				<label class="col-sm-2 control-label" ><? echo $vis_language['TXTHOSTNAME']; ?></label>
				<div class="col-sm-10">
					<input class="form-control input-sm" type="text" name="vis_host" id="vis_host" value="<? echo $active_dir_details['host_name']; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" ><? echo $vis_language['TXTPORT']; ?></label>
				<div class="col-sm-10">
					<input class="form-control input-sm" type="text" name="vis_prefix" id="vis_prefix" value="<?  if(!isset($active_dir_details['db_prefix'])) echo '389'; else echo $active_dir_details['db_prefix']; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" ><? echo $vis_language['TXTBASEDN']; ?></label>
				<div class="col-sm-10">
					<input class="form-control input-sm" type="text" name="vis_username" id="vis_username" value="<? echo $active_dir_details['user_name']; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" ><? echo $vis_language['TXTRDN']; ?></label>
				<div class="col-sm-10">
					<input class="form-control input-sm" type="text" name="vis_dbname" id="vis_dbname" value="<? echo $active_dir_details['db_name']; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label" ><? echo $vis_language['TXTPASSWORD']; ?></label>
				<div class="col-sm-10">
					<input class="form-control input-sm" type="password" name="vis_password" id="vis_password" value="<? echo $active_dir_details['db_password']; ?>">
				</div>
			</div>
			<div class="form-group">
				<label class="col-sm-2 control-label"><? echo $vis_language['TXTSTATUS']; ?></label>
				<div class="col-sm-1">
					<label class="switch <? if($active_dir_details['is_enabled']==0) echo 'radio-no-uncheck'; ?>">
					  <input type="checkbox" name="vis_status"  id="vis_status" <? if($active_dir_details['is_enabled']==1 || !isset($active_dir_details['is_enabled'])) echo ' checked="checked"'; ?>> 
					  <span ></span>
					</label>
				</div>
			</div>
            <div class="line b-b line-lg pull-in"></div>
            <br/>
            <div class="form-group">
               <div class="col-sm-4 col-sm-offset-2">
                  <button type="button" class="btn btn-primary" onclick="$('#vis_workpanel_div').visExecution('submit_form', {'vis_module':'setting', 'vis_operation':'update_active_directory', 'vis_form':'vis_single_form', 'single_login_id':'<?=$single_login_id;?>'})"><? echo $vis_language['TXTSAVE']; ?></button>
               </div>
            </div>
      </form>
      </div>
   </section>
</section>
<script type="text/javascript">
  $('.selectpicker').selectpicker();
</script>
