<style type="text/css">
body .modal {
	/* new custom width */
	width: 750px;
	/* must be half of the width, minus scrollbar on the left (30px) */
	margin-left: -375px;
}
</style>
<form role="form" class="form-horizontal" id="create_holiday_form" action="#" method="post">
  <input type="hidden" value="A" name="type" id="type"/>
  <input type="hidden" value="<?php //echo $menu_id;?>" name="menu_id" id="menu_id"/>
  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
    <h4 class="modal-title"><?php echo "ADD HOLIDAYS"; ?></h4>
    <font style="color:#333;">Please fill in the information below. The field labels marked with * are required input fields.</font> </div>
  <div class="col-md-12">
    <div class="errorHandler alert alert-danger no-display"> <i class="fa fa-times-sign"></i> You have some form errors. Please check below. </div>
  </div>
  <div class="modal-body">
    <div class="row">
      <div class="col-md-12">
        <div class="col-md-12">
          <div class="form-group">
            <h5>
              <label class="control-label"> Date* </label>
            </h5>
            <input id="holiday_date" type="text" autocomplete="off" data-date-format="yyyy-mm-dd" data-date-viewmode="years" class="form-control date-picker" name="holiday_date" value="<?php echo date('Y-m-d'); ?>">
          </div>
          <div class="form-group">
            <h5>
              <label class="control-label"> Remarks* </label>
            </h5>
            <input type="text"  class="form-control" name="remarks" id="remarks">
          </div>
         
         
        </div>
      </div>
    </div>
    <div class="modal-footer">
      <input type="submit" id="remarks" name="add_holiday" value="ADD" class="btn btn-primary">
    </div>
  </div>
  <!--/.col-md-12-->
</form>

<!-- start: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY VALIDATION--> 
<!--<strong><script src="<?php //echo asset_url(); ?>js/form-validation-create_menu.js"></script></strong> -->
<!-- end: JAVASCRIPTS REQUIRED FOR THIS PAGE ONLY  VALIDATION--> 

<script>
        jQuery(document).ready(function() {
           // FormValidator.init();
        });

$('.date-picker').datepicker({
            		autoclose: true
        		});
				
$("#create_holiday_form").submit(function(){
  var holiday_date=$('#holiday_date').val();
  var remarks=$('#remarks').val();
  var type=$('#type').val();
  $.post( "<?php echo base_url("holiday_management/save_holiday"); ?>", {type:type,holiday_date:holiday_date, remarks:remarks })
	.done(function( data ) {		
	  var obj = jQuery.parseJSON(data);
	   // alert(obj.type); //last id
	  $('div#ajax-modal').modal('hide');
	  //loadGrid();// load location data	  
	  if(obj.type=='E'){		  
		   displayNotice('page','Menu has been updated successfully!');
		   loadGrid();
	  }
	  if(obj.type=='A'){
		  displayNotice('page','Menu has been added successfully!') ;
		  loadGrid();			
	  }	  
	  })
	    .fail(function() {
    //alert( "error" );
  })
  .always(function() {
    //alert( "finished" );
});	  
  return false;
});
				
				
				
				
    </script>