<? 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 $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_sla/<? echo $vis_language['TXTSLA']; ?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTSLA']; ?>',{'vis_module':'setting','vis_operation':'view_sla'});" class="link"><? echo $operation['view_title']; ?></a></li>
         <li class="active"> <?php echo $vis_language['TXTUPDATESLA']; ?></li>
      </ul>
      <div>
      </div>
   </div>
</section>
<section class="padder">
   <section class="panel panel-default">
      <header class="panel-heading sub_header"><?php echo $vis_language['TXTUPDATESLA']; ?></header>
      <div class="panel-body">
         <?
            //     $status=($sla_details['is_enabled']==1)?'<input type="radio" name="vis_status" checked="checked" id="vis_status_yes" value="1" /><label for="vis_status_yes" >'.$vis_language['TXTENABLE'].'</label> <input type="radio" name="vis_status" id="vis_status_no" value="0" /><label for="vis_status_no" >'.$vis_language['TXTDISABLE'].'</label>':'<input type="radio" name="vis_status" id="vis_status_yes" value="1" /><label for="vis_status_yes" >'.$vis_language['TXTENABLE'].'</label> <input type="radio" name="vis_status" checked="checked" id="vis_status_no" value="0" /><label for="vis_status_no" >'.$vis_language['TXTDISABLE'].'</label>';
                 $overdue_day=floor($sla_details['overdue_time']/1440);
                 $remaining_minutes=$sla_details['overdue_time']%1440;
                 $overdue_hr = floor($remaining_minutes/60);
                 $overdue_min = $remaining_minutes%60;

                 $resolution_day = floor($sla_details['resolution_time']/1440);
                 $remaining_minutes=$sla_details['resolution_time']%1440;
                 $resolution_hr = floor($remaining_minutes/60);
                 $resolution_min = $remaining_minutes%60; ?>
         <form  class="form-horizontal" id="vis_sla_form" name="vis_sla_form" method="post">
            <input type="hidden" name="vis_sla_id" value="<? echo $sla_details['sla_id']; ?>" />
            <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_slaname" id="vis_slaname" value="<? echo htmlentities($sla_details['sla_name'], ENT_COMPAT, 'UTF-8'); ?>" >
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTSCHEDULE']; ?></label>
               <div class="col-sm-10">
                  <select  name="vis_schedule" class="form-control input-sm selectpicker" <? if(count($schedule_details)>10) echo 'data-live-search="true"';?>><?
                     for($i=0;$i<count($schedule_details); $i++) echo '<option value="'.$schedule_details[$i]['schedule_id'].'"'.(($schedule_details[$i]['schedule_id']==$sla_details['schedule_id'])?' selected="selected"':'').'>'.$schedule_details[$i]['schedule_name'].'</option>'; ?>
                  </select>
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTDUETIME']; ?></label>
               <div class="col-md-1">
                  <input class="form-control input-sm" type="text" name="vis_overdueday" id="vis_overdueday" value="<? echo $overdue_day; ?>" >
               </div>
               <div class="col-md-1">
                  <? echo $vis_language['TXTDAYS']; ?>
               </div>
               <div class="col-md-1">
                  <input class="form-control input-sm" type="text" name="vis_overduehr" id="vis_overduehr" value="<? echo $overdue_hr; ?>" >
               </div>
               <div class="col-md-1">
                  <? echo $vis_language['TXTHOURS']; ?>
               </div>
               <div class="col-md-1">
                  <input class="form-control input-sm" type="text" name="vis_overduemin" id="vis_overduemin"  value="<? echo $overdue_min; ?>" >
               </div>
               <div class="col-md-1">
                  <? echo $vis_language['TXTMINUTES']; ?>
               </div>
               <div class="col-md-4"></div>
            </div>
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTRESOLUTIONTIME']; ?></label>
               <div class="col-md-1">
                  <input class="form-control input-sm" type="text" name="vis_resolutionday" id="vis_resolutionday" value="<? echo $resolution_day; ?>" >
               </div>
               <div class="col-md-1">
                  <? echo $vis_language['TXTDAYS']; ?>
               </div>
               <div class="col-md-1">
                  <input class="form-control input-sm" type="text" name="vis_resolutionhr" id="vis_resolutionhr" value="<? echo $resolution_hr; ?>" >
               </div>
               <div class="col-md-1">
                  <? echo $vis_language['TXTHOURS']; ?>
               </div>
               <div class="col-md-1">
                  <input class="form-control input-sm" type="text" name="vis_resolutionmin" id="vis_ressolutionmin" value="<? echo $resolution_min; ?>" >
               </div>
               <div class="col-md-1">
                  <? echo $vis_language['TXTMINUTES']; ?>
               </div>
               <div class="col-md-4"></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($sla_details['is_enabled']==0) echo 'radio-no-uncheck'; ?>">
                  <input type="checkbox" name="vis_status"  id="vis_status" <? if($sla_details['is_enabled']==1) 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_sla', 'vis_form':'vis_sla_form'})"><? echo $vis_language['TXTUPDATE']; ?></button>
               </div>
            </div>
      </div>
      </form>
      </div>
   </section>
</section>
<script>
   $(".selectpicker").selectpicker();
</script>