<div id="ulp_drip_content_meta_box" >

<div class="ulp-instructor-edit-row">
  	<div class="ulp-inst-col-12">
    <div class="ulp-form-section">
   <h3><?php _e('Lesson Drip Content', 'ulp');?></h3>
    <p><?php _e("Release content at regular intervals, by creating a release schedule for your content.", 'ulp')?></p>
	<div style="margin-top:15px;">
		<!--label for="tag-showup" style="font-weight:bold; margin:15px 0; "><?php _e('Enable:', 'ulp');?></label-->
		<label class="ulp_label_shiwtch">
			<?php $checked = ($data['metas']['ulp_drip_content'] == 1) ? 'checked' : '';?>
			<input type="checkbox" class="checkbox-big" onClick="ulpCheckAndH(this, '#ulp_drip_content_field_hidden');" <?php echo $checked;?> />
			<span><strong><?php _e("Activate Drip workflow", 'ulp')?></strong></span>
		</label>
		<input type="hidden" value="<?php echo $data['metas']['ulp_drip_content'];?>" name="ulp_drip_content" id="ulp_drip_content_field_hidden" />
	</div>
  </div>
  </div>
</div>
<div class="ulp-instructor-edit-row">
  	<div class="ulp-inst-col-6">
    <h4><?php _e("Release Time", 'ulp')?></h4>
            <div class="ulp-form-section">
            <label><?php _e('Type:', 'ulp');?></label>
            <select name="ulp_drip_start_type"  class="ulp-form-control" onchange="ulpShowSelectorIf('#after_x_time', this.value, 1);ulpShowSelectorIf('#specific_date', this.value, 2);">
                    <?php foreach ([1=>__('After Enroll X time', 'ulp'), 2 => __('On specific date', 'ulp')] as $k=>$v):?>
                            <option value="<?php echo $k;?>" <?php if ($k==$data['metas']['ulp_drip_start_type']) echo 'selected';?> ><?php echo $v;?></option>
                    <?php endforeach;?>
            </select>
        </div>
  </div>
</div>
<div class="ulp-instructor-edit-row">
  	<div class="ulp-inst-col-6">
        <div class="ulp_drip_pickperiod" id="after_x_time" style="margin-bottom:10px;">
          <label><?php _e('After Enroll:', 'ulp');?></label>
           <div class="ulp-form-section">
          		     <input type="number" min="0"  class="ulp-form-control" value="<?php echo $data['metas']['ulp_drip_start_numeric_value'];?>" name="ulp_drip_start_numeric_value"  />
               </div>
             <div class="ulp-form-section">
            		<select name="ulp_drip_start_numeric_type"  class="ulp-form-control" style="vertical-align: top !important;"><?php
  				          foreach (array('days'=>'Days', 'weeks'=>'Weeks', 'months'=>'Months') as $k=>$v){
  					        ?>
  					              <option value="<?php echo $k;?>" <?php if ($data['metas']['ulp_drip_start_numeric_type']==$k) echo 'selected';?> ><?php echo $v;?></option>
  					        <?php }
  				      ?></select>
             </div>
          </div>
        </div>
  </div>
<div class="ulp-instructor-edit-row">
  	<div class="ulp-inst-col-6">
        <div class="ulp_drip_pickdate" id="specific_date" style="margin-bottom:10px;">
        	<div class="ulp-form-section">
            <div class="ulp-input-group">
               <span class="ulp-input-group-addon"> <?php _e('On Specific Date:', 'ulp');?></span>
              <input type="text" class="ulp-form-control" value="<?php echo $data['metas']['ulp_drip_start_certain_date'];?>" name="ulp_drip_start_certain_date" id="ulp_drip_start_certain_date"/>
            </div>
            </div>
           <div style="font-size:11px; color:#999; font-style:italic"><?php _e('Pick the desired date when the Page will be available', 'ulp');?></div>
          </div>
      <div class="ulp-clear"></div>
    </div>
  </div>
 </div>

<div class="ulp-clear"></div>

<script>
jQuery(document).ready(function() {
	jQuery('#ulp_drip_start_certain_date').datepicker({
		dateFormat : 'dd-mm-yy',
		onClose: function( selectedDate ){
			jQuery( "#ihc_drip_end_certain_date" ).datepicker( "option", "minDate", selectedDate );
			}
	});
  ulpShowSelectorIf('#after_x_time', <?php echo $data['metas']['ulp_drip_start_type'];?>, 1);
  ulpShowSelectorIf('#specific_date', <?php echo $data['metas']['ulp_drip_start_type'];?>, 2);
});
</script>
