<? global $vis_language; ?>
<link href="<?= VIS_PATH_SCRIPT; ?>colorpicker/css/bootstrap-colorpicker.min.css" rel="stylesheet">
<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 $operation['view_title'];?></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_labels/<? echo $vis_language['TXTLABELS']; ?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTLABELS']; ?>',{'vis_module':'setting','vis_operation':'view_labels'});" class="link"><? echo $operation['view_title']; ?></a></li>
         <li class="active"> <? echo $vis_language['TXTADDLABEL'];?></li>
      </ul>
      <div> </div>
   </div>
</section>
<section class="padder">
   <section class="panel panel-default">
      <header class="panel-heading sub_header"><? echo $vis_language['TXTADDLABEL']; ?></header>
      <div class="panel-body">
         <form  class="form-horizontal" id="vis_label_form" name="vis_label_form" method="post">
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTTITLE']; ?></label>
               <div class="col-sm-10">
                  <input class="form-control input-sm" type="text" name="vis_newlabel" id="vis_newlabel">
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTLABELCOLOR']; ?></label>
               <div class="col-sm-10">
                  <input class="form-control input-sm demo-auto" type="text"  name="vis_color" id="vis_color" value="#000000" >
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTDISPLAYORDER']; ?></label>
               <div class="col-sm-10">
                  <input class="form-control input-sm" type="text" name="vis_displayorder" id="vis_displayorder" value="0">
               </div>
            </div>
            <div id="department_access">
                <div class="form-group">
                   <label class="col-sm-2 control-label"><? echo $vis_language['TXTDEPARTMENTACCESS']; ?></label>
                   <div class="col-sm-10">
                      <label class="checkbox-inline i-checks">
                      <input type="checkbox" value="1" id="vis_department_all" name="vis_department_all"  checked="checked" onchange="toggle_dept_list();" <? if($department_details['department_access']==0) echo ' checked="checked"'; ?>><i></i>
                      <? echo $vis_language['TXTALLDEPARTMENTS']; ?>
                      </label>
                   </div>
                </div>
                <div id="vis_dept_list_section" class="form-group" style="<?= ($department_details['department_access']==0)?'display:none':'';?>">
                   <label class="col-sm-2 control-label"></label>
                   <div class="col-sm-10">
                       <div class=" dept_access_list">
                      <?
                          for($i=0;$i<count($department_details);$i++) {?>
                      <label class="checkbox-inline i-checks">
                      <input type="checkbox"  name="vis_department[]" value="<? echo $department_details[$i]['department_id']; ?>" /> <i></i><? echo $department_details[$i]['domain_name'].' :: '.$department_details[$i]['department_name']; ?></label><br/>  <? } ?>
                      </div>
                   </div>
                </div>
              </div>
			  <div class="form-group">
                   <label class="col-sm-2 control-label"><? echo $vis_language['TXTVISIBLRTOLEFTPANEL'];  ?></label>
                   <div class="col-sm-10">
                      <label class="checkbox-inline i-checks">
                      <input type="checkbox" value="1" id="vis_visible" name="vis_visible"  checked="checked" ><i></i>
                      <? echo $vis_language['TXTENABLED']; ?>
                      </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':'add_label', 'vis_form':'vis_label_form'})"><? echo $vis_language['TXTADD']; ?></button>
               </div>
            </div>
      </div>
      </form>
      </div>
   </section>
</section>
<script src="<?= VIS_PATH_SCRIPT; ?>colorpicker/js/bootstrap-colorpicker.js"></script>
<script>
   $(function() {
   	function createColorpickers() {
   		$('.demo-auto').colorpicker();
   	}
   	createColorpickers();
   });
      $(".selectpicker").selectpicker();
   function toggle_dept_list(){
       if($('#vis_department_all').is(":checked")){ $('#vis_dept_list_section').hide();
							}else{ $('#vis_dept_list_section').show();
							$('.dept_access_list').each(function(index) {
        $(this).find('input[type="checkbox"]').removeAttr('checked');
       });
							}
   }
</script>
