<? 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_schedule/<? echo $vis_language['TXTSCHEDULE']; ?>" onclick="$('#vis_workpanel_div').visExecution('load_module','<? echo $vis_language['TXTSCHEDULE']; ?>',{'vis_module':'setting','vis_operation':'view_schedule'});" class="link"><? echo $operation['view_title']; ?></a></li>
         <li class="active"> <? echo $vis_language['TXTUPDATESCHEDULE']; ?></li>
      </ul>
      <div>
      </div>
   </div>
</section>
<section class="padder">
   <section class="panel panel-default">
      <header class="panel-heading sub_header"><? echo $vis_language['TXTUPDATESCHEDULE']; ?></header>
      <div class="panel-body">
         <form  class="form-horizontal" id="vis_schedule_form" name="vis_schedule_form" method="post">
            <input type="hidden" name="vis_module" value="setting" />
            <input type="hidden" name="vis_schedule_id" value="<? echo $schedule_details['schedule_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_schedulename" id="vis_schedulename" value="<? echo htmlentities($schedule_details['schedule_name'], ENT_COMPAT, 'UTF-8'); ?>" >
               </div>
            </div>
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTSUNDAY']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_sunday_time" id="vis_sunday_time_24" value="0" onchange="toggle_timer(this, '#sunday_custom_time')" <? echo ($schedule_details['sunday_time']=='0, 1440')?' checked="checked"':''; ?>><i></i>
                  <?  echo $vis_language['TXTOPEN24HOURS']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_sunday_time" id="vis_sunday_time_close" value="1" onchange="toggle_timer(this, '#sunday_custom_time')" <? echo ($schedule_details['sunday_time']==='0')?' checked="checked"':''; ?> ><i></i>
                  <?  echo $vis_language['TXTCLOSE']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio"name="vis_sunday_time" id="vis_sunday_time_cust" value="2" <? echo ($schedule_details['sunday_time']!=='0' && $schedule_details['sunday_time']!='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#sunday_custom_time')" ><i></i>
                  <?  echo $vis_language['TXTCUSTOMTIME']; ?>
                  </label></div>
               </div>
            </div>
            <div class="form-group" id="sunday_custom_time1" style="display:<? echo ($schedule_details['sunday_time']!=='0' && $schedule_details['sunday_time']!='0, 1440')?'block':'none'; ?>;" >
               <label class="col-sm-2 control-label"></label>
               <div id="sunday_custom_time" class="col-sm-10" ></div>
            </div>
            <!--------------End of Sunday--------------------------------------------------------------------------------------------->
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTMONDAY']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_monday_time" id="vis_monday_time_24" value="0" <? echo ($schedule_details['monday_time']=='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#monday_custom_time')" /><i></i>
                  <?  echo $vis_language['TXTOPEN24HOURS']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_monday_time" id="vis_monday_time_close" value="1" <? echo ($schedule_details['monday_time']==='0')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#monday_custom_time')" ><i></i>
                  <?  echo $vis_language['TXTCLOSE']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_monday_time" id="vis_monday_time_cust" <? echo ($schedule_details['monday_time']!=='0' && $schedule_details['monday_time']!='0, 1440')?' checked="checked"':''; ?> value="2" onchange="toggle_timer(this, '#monday_custom_time')" ><i></i>
                  <?  echo $vis_language['TXTCUSTOMTIME']; ?>
                  </label></div>
               </div>
            </div>
            <div class="form-group" id="monday_custom_time1" style="display:<? echo ($schedule_details['monday_time']!=='0' && $schedule_details['monday_time']!='0, 1440')?'block':'none'; ?>" >
               <label class="col-sm-2 control-label"></label>
               <div id="monday_custom_time" class="col-sm-10" ></div>
            </div>
            <!-----------------------------------------End of Monday--------------------------------------------------------->
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTTUESDAY']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_tuesday_time" id="vis_tuesday_time_24" value="0" <? echo ($schedule_details['tuesday_time']=='0, 1440')?' checked="checked"':''; ?>  onchange="toggle_timer(this, '#tuesday_custom_time')"/><i></i>
                  <?  echo $vis_language['TXTOPEN24HOURS']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_tuesday_time" id="vis_tuesday_time_close" value="1" <? echo ($schedule_details['tuesday_time']=='0')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#tuesday_custom_time')" ><i></i>
                  <?  echo $vis_language['TXTCLOSE']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_tuesday_time" id="vis_tuesday_time_cust" value="2" <? echo ($schedule_details['tuesday_time']!=='0' && $schedule_details['tuesday_time']!='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#tuesday_custom_time')"  ><i></i>
                  <?  echo $vis_language['TXTCUSTOMTIME']; ?>
                  </label></div>
               </div>
            </div>
            <div class="form-group" id="tuesday_custom_time1" style="display:<? echo ($schedule_details['tuesday_time']!=='0' && $schedule_details['tuesday_time']!='0, 1440')?'block':'none'; ?>" >
               <label class="col-sm-2 control-label"></label>
               <div id="tuesday_custom_time" class="col-sm-10" ></div>
            </div>
            <!-----------------------------------------End of Tuesday--------------------------------------------------------->
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTWEDNESDAY']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_wednesday_time" id="vis_wednesday_time_24" value="0" <? echo ($schedule_details['wednesday_time']=='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#wednesday_custom_time')"/><i></i>
                  <?  echo $vis_language['TXTOPEN24HOURS']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_wednesday_time" id="vis_wednesday_time_close" value="1" <? echo ($schedule_details['wednesday_time']=='0')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#wednesday_custom_time')" ><i></i>
                  <?  echo $vis_language['TXTCLOSE']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_wednesday_time" id="vis_wednesday_time_cust" value="2" <? echo ($schedule_details['wednesday_time']!=='0' && $schedule_details['wednesday_time']!='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#wednesday_custom_time')"  ><i></i>
                  <?  echo $vis_language['TXTCUSTOMTIME']; ?>
                  </label></div>
               </div>
            </div>
            <div class="form-group" id="wednesday_custom_time1" style="display:<? echo ($schedule_details['wednesday_time']!=='0' && $schedule_details['wednesday_time']!='0, 1440')?'block':'none'; ?>" >
               <label class="col-sm-2 control-label"></label>
               <div id="wednesday_custom_time" class="col-sm-10" ></div>
            </div>
            <!-----------------------------------------End of wednesday--------------------------------------------------------->
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTTHURSDAY']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_thursday_time" id="vis_thursday_time_24" value="0" <? echo ($schedule_details['thursday_time']=='0, 1440')?' checked="checked"':''; ?>  onchange="toggle_timer(this, '#thursday_custom_time')" /><i></i>
                  <?  echo $vis_language['TXTOPEN24HOURS']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio"name="vis_thursday_time" id="vis_thursday_time_close" value="1" <? echo ($schedule_details['thursday_time']=='0')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#thursday_custom_time')" ><i></i>
                  <?  echo $vis_language['TXTCLOSE']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_thursday_time" id="vis_thursday_time_cust" value="2" <? echo ($schedule_details['thursday_time']!=='0' && $schedule_details['thursday_time']!='0, 1440')?' checked="checked"':''; ?>  onchange="toggle_timer(this, '#thursday_custom_time')"  ><i></i>
                  <?  echo $vis_language['TXTCUSTOMTIME']; ?>
                  </label></div>
               </div>
            </div>
            <div class="form-group" id="thursday_custom_time1" style="display:<? echo ($schedule_details['thursday_time']!=='0' && $schedule_details['thursday_time']!='0, 1440')?'block':'none'; ?>" >
               <label class="col-sm-2 control-label"></label>
               <div id="thursday_custom_time" class="col-sm-10" ></div>
            </div>
            <!-----------------------------------------End of Thursday--------------------------------------------------------->
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTFRIDAY']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio"  name="vis_friday_time" id="vis_friday_time_24" value="0" <? echo ($schedule_details['friday_time']=='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#friday_custom_time')" /><i></i>
                  <?  echo $vis_language['TXTOPEN24HOURS']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio"  name="vis_friday_time" id="vis_friday_time_close" value="1" <? echo ($schedule_details['friday_time']=='0')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#friday_custom_time')"><i></i>
                  <?  echo $vis_language['TXTCLOSE']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_friday_time" id="vis_friday_time_cust" value="2" <? echo ($schedule_details['friday_time']!=='0' && $schedule_details['friday_time']!='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#friday_custom_time')"  ><i></i>
                  <?  echo $vis_language['TXTCUSTOMTIME']; ?>
                  </label></div>
               </div>
            </div>
            <div class="form-group" id="friday_custom_time1" style="display:<? echo ($schedule_details['friday_time']!=='0' && $schedule_details['friday_time']!='0, 1440')?'block':'none'; ?>" >
               <label class="col-sm-2 control-label"></label>
               <div id="friday_custom_time" class="col-sm-10" ></div>
            </div>
            <!-----------------------------------------End of Friday--------------------------------------------------------->
            <div class="form-group">
               <label class="col-sm-2 control-label"><? echo $vis_language['TXTSATURDAY']; ?></label>
               <div class="col-sm-10">
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio" name="vis_saturday_time" id="vis_saturday_time_24" value="0" onchange="toggle_timer(this, '#saturday_custom_time')" <? echo ($schedule_details['saturday_time']=='0, 1440')?' checked="checked"':''; ?> /><i></i>
                  <?  echo $vis_language['TXTOPEN24HOURS']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio"  name="vis_saturday_time" id="vis_saturday_time_close" value="1" <? echo ($schedule_details['saturday_time']=='0')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#saturday_custom_time')"/><i></i>
                  <?  echo $vis_language['TXTCLOSE']; ?>
                  </label></div>
                  <div class="radio i-checks m-r-lg pull-left">
				  <label>
                  <input type="radio"  name="vis_saturday_time" id="vis_saturday_time_cust" value="2" <? echo ($schedule_details['saturday_time']!=='0' && $schedule_details['saturday_time']!='0, 1440')?' checked="checked"':''; ?> onchange="toggle_timer(this, '#saturday_custom_time')" / ><i></i>
                  <?  echo $vis_language['TXTCUSTOMTIME']; ?>
                  </label></div>
               </div>
            </div>
            <div class="form-group" id="saturday_custom_time1" style="display:<? echo ($schedule_details['saturday_time']!=='0' && $schedule_details['saturday_time']!='0, 1440')?'block':'none'; ?>" >
               <label class="col-sm-2 control-label"></label>
               <div id="saturday_custom_time" class="col-sm-10" ></div>
            </div>
            <!-----------------------------------------End of Saturday--------------------------------------------------------->
            <? if($schedule_details['schedule_id']!=1){ ?>
            <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($schedule_details['is_enabled']!=1) echo 'radio-no-uncheck'; ?>">
                  <input type="checkbox" <? if($schedule_details['is_enabled']==1) echo ' checked="checked"'; ?> name="vis_status"  id="vis_status"  >
                  <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_schedule', 'vis_form':'vis_schedule_form'})"><? echo $vis_language['TXTUPDATE']; ?></button>
               </div>
            </div>
      </div>
      </form>
      </div>
   </section>
</section>
<script>
   $(".selectpicker").selectpicker();
   function select_picker()
   {
   $(".selectpicker").selectpicker();
   }
</script>
<script>
   function toggle_timer(e, divid) {
       if(e.value==2) {
   		divid1=divid+'1';
   		$(divid1).show();
       }
       else {
   		divid1=divid+'1';
   		$(divid1).hide();
       }
   }
   function add_timer(divid, loc, timer, pos) {
       i=vis_timmer_count[loc];
       if(typeof timer!="undefined") {
           hrso=Math.floor(timer[pos]/60);
           mino=timer[pos]%60;
   	    hrsc=Math.floor(timer[pos+1]/60);
		minc=timer[pos+1]%60;
   		if(isNaN(hrsc) || hrsc==24 || isNaN(minc))
		{
           hrso=09;
           mino=00;
           hrsc=17;
           minc=00;
		}
       }
       else {
           hrso=09;
           mino=00;
           hrsc=17;
           minc=00;
       }
       $(divid).append('<div id="vis_cust_timer_div_'+loc+'_'+i+'" class="schedule_custom"><div class="row"><div class="col-sm-10"><div class="col-md-4"><? echo $vis_language['TXTOPEN']; ?><label class="m-r-sm">:</label> <select name="vis_custom_timer_open_hr_'+loc+'_'+i+'" id="vis_custom_timer_open_hr_'+loc+'_'+i+'" class="input-sm m-r-sm selectpicker p-d-sm" data-live-search="true"><option value="0">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select><label class="m-r-sm">:</label><select name="vis_custom_timer_open_min_'+loc+'_'+i+'" id="vis_custom_timer_open_min_'+loc+'_'+i+'" class="input-sm selectpicker  p-d-sm" data-live-search="true"><option value="0">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option><option value="51">51</option><option value="52">52</option><option value="53">53</option><option value="54">54</option><option value="55">55</option><option value="56">56</option><option value="57">57</option><option value="58">58</option><option value="59">59</option></select></div><div class="col-md-4"> <? echo $vis_language['TXTCLOSE']; ?><label class="m-r-sm">:</label> <select name="vis_custom_timer_close_hr_'+loc+'_'+i+'" id="vis_custom_timer_close_hr_'+loc+'_'+i+'" class="input-sm m-r-sm selectpicker  p-d-sm" data-live-search="true"><option value="0">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option></select><label class="m-r-sm">:</label><select name="vis_custom_timer_close_min_'+loc+'_'+i+'" id="vis_custom_timer_close_min_'+loc+'_'+i+'" class="input-sm selectpicker p-d-sm" data-live-search="true"><option value="0">00</option><option value="1">01</option><option value="2">02</option><option value="3">03</option><option value="4">04</option><option value="5">05</option><option value="6">06</option><option value="7">07</option><option value="8">08</option><option value="9">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option><option value="13">13</option><option value="14">14</option><option value="15">15</option><option value="16">16</option><option value="17">17</option><option value="18">18</option><option value="19">19</option><option value="20">20</option><option value="21">21</option><option value="22">22</option><option value="23">23</option><option value="24">24</option><option value="25">25</option><option value="26">26</option><option value="27">27</option><option value="28">28</option><option value="29">29</option><option value="30">30</option><option value="31">31</option><option value="32">32</option><option value="33">33</option><option value="34">34</option><option value="35">35</option><option value="36">36</option><option value="37">37</option><option value="38">38</option><option value="39">39</option><option value="40">40</option><option value="41">41</option><option value="42">42</option><option value="43">43</option><option value="44">44</option><option value="45">45</option><option value="46">46</option><option value="47">47</option><option value="48">48</option><option value="49">49</option><option value="50">50</option><option value="51">51</option><option value="52">52</option><option value="53">53</option><option value="54">54</option><option value="55">55</option><option value="56">56</option><option value="57">57</option><option value="58">58</option><option value="59">59</option></select></div><label class="col-md-1" '+(i==0?'style="display:none"':'')+'><i class="vh vh-cross" style="cursor:pointer" title="<? echo $vis_language['TXTCLOSE']; ?>" onclick="javascript:remove_timershedule(\''+divid+'\', \''+loc+'\', '+i+')"></i></label><a href="javascript:void(0)" class="col-md-1 link m-xs" onclick="javascript:add_timer(\''+divid+'\',\''+loc+'\')" '+(i!=0?'style="display:none"':'')+'><? echo $vis_language['TXTADD']; ?></a></div></div></div>');
       $(divid).find('#vis_cust_timer_div_'+loc+'_'+i+' #vis_custom_timer_open_hr_'+loc+'_'+i).val(hrso);
       $(divid).find('#vis_cust_timer_div_'+loc+'_'+i+' #vis_custom_timer_open_min_'+loc+'_'+i).val(mino);
       $(divid).find('#vis_cust_timer_div_'+loc+'_'+i+' #vis_custom_timer_close_hr_'+loc+'_'+i).val(hrsc);
       $(divid).find('#vis_cust_timer_div_'+loc+'_'+i+' #vis_custom_timer_close_min_'+loc+'_'+i).val(minc);

   	if(i==0)
   	{
   	  $("#vis_cust_timer_div_"+loc+'_'+i).addClass("b-t b-r b-l b-b");
       }
   	else if(i>0)
   	{
   	  for(j=0;j<i;j++)
   	  $("#vis_cust_timer_div_"+loc+'_'+j).removeClass("b-b");
   	  $("#vis_cust_timer_div_"+loc+'_'+i).addClass("b-l b-r b-b");
   	}

   vis_timmer_count[loc]++;
   select_picker();
   }
   function remove_timershedule(divid, loc, i) {
   	var ar=[];
       if(i!=0)
   	{
   	  for(j=0;j<vis_timmer_count[loc];j++)
   	  {
   	     $("#vis_cust_timer_div_"+loc+'_'+j).removeClass("b-b");
   		 if($('#vis_cust_timer_div_'+loc+'_'+j).length!=0)
   		 {
   		   if(j!=i)
   		   ar.push(j);
   		   var cnt=j;
            }
   	  }
   	  if(cnt==i)
   	    $("#vis_cust_timer_div_"+loc+'_'+ar.pop()).addClass("b-b");

   	   $("#vis_cust_timer_div_"+loc+'_'+cnt).addClass("b-b");
   	   $('#vis_cust_timer_div_'+loc+'_'+i).remove();
   	}
   }
    <?
      $sunday=explode(',', $schedule_details['sunday_time']);
      $sunday_cnt=(count($sunday)<2)?1:(count($sunday)/2);
      $monday=explode(',', $schedule_details['monday_time']);
      $monday_cnt=(count($monday)<2)?1:(count($monday)/2);
      $tuesday=explode(',', $schedule_details['tuesday_time']);
      $tuesday_cnt=(count($tuesday)<2)?1:(count($tuesday)/2);
      $wednesday=explode(',', $schedule_details['wednesday_time']);
      $wednesday_cnt=(count($wednesday)<2)?1:(count($wednesday)/2);
      $thursday=explode(',', $schedule_details['thursday_time']);
      $thursday_cnt=(count($thursday)<2)?1:(count($thursday)/2);
      $friday=explode(',', $schedule_details['friday_time']);
      $friday_cnt=(count($friday)<2)?1:(count($friday)/2);
      $saturday=explode(',', $schedule_details['saturday_time']);
      $saturday_cnt=(count($saturday)<2)?1:(count($saturday)/2);
      echo 'var vis_timmer_count=Array(0,0,0,0,0,0,0);';
      for($i=0;$i<$sunday_cnt;$i++) echo 'add_timer("#sunday_custom_time", 0, ['.$schedule_details['sunday_time'].'], '.($i*2).');';
      for($i=0;$i<$monday_cnt;$i++) echo 'add_timer("#monday_custom_time", 1, ['.$schedule_details['monday_time'].'], '.($i*2).');';
      for($i=0;$i<$tuesday_cnt;$i++) echo 'add_timer("#tuesday_custom_time", 2, ['.$schedule_details['tuesday_time'].'], '.($i*2).');';
      for($i=0;$i<$wednesday_cnt;$i++) echo 'add_timer("#wednesday_custom_time", 3, ['.$schedule_details['wednesday_time'].'], '.($i*2).');';
      for($i=0;$i<$thursday_cnt;$i++) echo 'add_timer("#thursday_custom_time", 4, ['.$schedule_details['thursday_time'].'], '.($i*2).');';
      for($i=0;$i<$friday_cnt;$i++) echo 'add_timer("#friday_custom_time", 5, ['.$schedule_details['friday_time'].'], '.($i*2).');';
      for($i=0;$i<$saturday_cnt;$i++) echo 'add_timer("#saturday_custom_time", 6, ['.$schedule_details['saturday_time'].'], '.($i*2).');';?>
</script>
<style>
   .schedule_custom{
   background-color: #f9fafc;
   border-color: #cbd5dd;
   padding: 10px 15px;
   }
</style>
