<? global $vis_language; 
$count=count($etemplates); ?>
<div >
	 <form class="form-horizontal" id="vis_etemplate_setting" name="vis_etemplate_setting" method="post" >
			 <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTDOMAIN']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_domain" id="vis_domain" onchange="$('#vis_etemplate_setting_div').visExecution('load_area',{'vis_module':'setting', 'vis_operation':'etemplates_view', 'vis_domain_id':$(this).val()})" <? if(count($domain)>10) echo 'data-live-search="true"';?>><?
             for($i=0;$i<count($domain);$i++) echo '<option value="'.$domain[$i]['domain_id'].'"'.($domain[$i]['domain_id']==$operation['vis_domain_id']?' selected="selected"':'').'>'.$domain[$i]['domain_name'].'</option>'; ?></select>
      </div>
   </div>
 <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTADDCLIENT']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_1" id="vis_etemp_map_1" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[0]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTREPLYTICKET']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_3" id="vis_etemp_map_3" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[2]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTREGISTRATIONREQUIRED']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_4" id="vis_etemp_map_4" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[3]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
    <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTFORGOTPASSWORD']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_5" id="vis_etemp_map_5" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[4]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['MSGAPPROVEPENDING']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_6" id="vis_etemp_map_6" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
           for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[5]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <?if(VIS_MODULE_ACCESS_BILLING==1){?>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTINVOICE']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_7" id="vis_etemp_map_7" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[6]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div><?}?>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTSENDEMAIL']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_8" id="vis_etemp_map_8" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[7]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTFORWARD']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_9" id="vis_etemp_map_9" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[8]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <?if(VIS_MODULE_ACCESS_BILLING==1){?>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTBALANCEREQUIRED']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_10" id="vis_etemp_map_10" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[9]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <?php } if(VIS_ITIL==1 && (isset($module['itil']) && $module['itil']==1)){?>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTCONTRACTAPPROVAL']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_11" id="vis_etemp_map_11" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[10]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTCHANGEAPPROVAL']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_12" id="vis_etemp_map_12" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[11]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <div class="form-group">
      <label class="col-sm-2 control-label"><? echo $vis_language['TXTRELEASEAPPROVAL']; ?></label>
      <div class="col-sm-10">
         <select class="form-control input-sm selectpicker" name="vis_etemp_map_13" id="vis_etemp_map_13" <? if(count($etemplates)>10) echo 'data-live-search="true"';?>><option value="0"><?= $vis_language['TXTNONE'] ?></option><?
            for($i=0;$i<$count;$i++) echo '<option value="'.$etemplates[$i]['etemplate_id'].'"'.($template_map[12]==$etemplates[$i]['etemplate_id']?' selected="selected"':'').'>'.$etemplates[$i]['etemplate_name'].'</option>'; ?></select>
      </div>
   </div>
   <?php }?>
    <div class="line b-b line-lg pull-in"></div>
            <br/>
            <div class="form-group">
               <div class="col-sm-4 col-sm-offset-2">
				   <input type="hidden" name="vis_etemp_map_2" value="0" />
                  <button type="button" class="btn btn-primary" onclick="$('#vis_workpanel_div').visExecution('submit_form',{'vis_module':'setting', 'vis_operation':'update_template_map', 'vis_form':'vis_etemplate_setting'})"><? echo $vis_language['TXTUPDATE']; ?></button>
               </div>
            </div>
     </form>
</div>
<script>
 $(".selectpicker").selectpicker();
</script>
