<? 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 $vis_language['TXTADMINACCESS'];?></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'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTSETTINGS'];?>',{'vis_module':'setting','vis_operation':'setting_menu'});"><? echo $vis_language['TXTSETTINGS']; ?></a></li>
         <li><a href="#/setting/view_adminaccess/<? echo $vis_language['TXTADMINACCESS'];?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTADMINACCESS'];?>',{'vis_module':'setting','vis_operation':'view_adminaccess'});" class="link"><? echo $vis_language['TXTADMINACCESS']; ?></a> </li>
         <li class="active"><?echo $vis_language['TXTUPDATEADMINACCESS'];?></li>
      </ul>
   </div>
</section>
<section class="padder">
   <section class="panel panel-default">
      <header class="panel-heading sub_header"><? echo $vis_language['TXTUPDATEADMINACCESS']; ?></header>
      <div class="panel-body">
         <form class="form-horizontal" id="vis_adminaccess_form1" name="vis_adminaccess_form1" method="post" >
            <input type="hidden" name="vis_staff_id" id="vis_staff_id" value="<? echo $staff['staff_id']; ?>" />
            <div class="form-group">
               <label class="col-sm-2 text-muted text-right"><? echo $vis_language['TXTADMINTYPE']; ?></label>
               <div class="col-sm-10">
                  <select class="form-control input-sm selectpicker" onchange="return change_admintype(this.value)"  name="vis_admintype" id="vis_admintype">
                     <?
                        $level=($admin_access['level']==1)?'selected="selected"':''; $leveld=($admin_access['level']==0)?'selected="selected"':''; ?>
                     
                     <option value="0" <? echo $leveld;?>><? echo $vis_language['TXTDOMAINADMIN']; ?></option>
                     <option value="1" <? echo $level;?> ><? echo $vis_language['TXTSUPERADMIN']; ?></option>
                     <option value="2"><? echo $vis_language['TXTNONE']; ?></option>
                  </select>
               </div>
               <? $domain_admin_settings=($admin_access['level']==1)?'style="display:none"':'';
                  if($admin_access==-1 || $admin_access['level']==1) include_once(VIS_PATH_TEMPLATE.'admin_setting_new.php');
                              else include_once(VIS_PATH_TEMPLATE.'admin_setting_edit.php'); ?>
            </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_adminaccess', 'vis_form':'vis_adminaccess_form1'})"><? echo $vis_language['TXTUPDATE']; ?></button>
               </div>
            </div>
      </div>
      </form>
      </div>
   </section>
</section>
<script type="text/javascript">
   if ($('#vis_admintype').val()==1)
   {
     $('#vis_domain_admin').hide();
      }
   $(".selectpicker").selectpicker();
   function change_admintype(val){
		if(val==0){
			$('#vis_domain_admin').show();
		}else{
				$('#vis_domain_admin').hide();
		}
	}
</script>