<?php
/**
 * Template to display a Holiday Form.
 *
 * @package voidempo
 */
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

if ( ! is_user_logged_in() ) {
	wp_safe_redirect( wp_login_url() );
	exit;
}
?>

<div class="container mt-5">
	<h3>Calendar View</h3>
	<div class="legend-grid">
        <label><span class="event-filter" data-color="#660413" checked> <span class="legend-color" style="background-color: #660413;"></span> Holidays</label>
        <label><span class="event-filter" data-color="green" checked> <span class="legend-color" style="background-color: green;"></span> Accepted Leave</label>
        <label><span class="event-filter" data-color="red" checked> <span class="legend-color" style="background-color: red;"></span> Rejected Leave</label>
        <label><span class="event-filter" data-color="#2A52E0" checked> <span class="legend-color" style="background-color: #2A52E0;"></span> Employee's Birthday</label>
        <label><span class="event-filter" data-color="#8521E1" checked> <span class="legend-color" style="background-color: #8521E1;"></span> Joining Date</label>
        <label><span class="event-filter" data-color="black" checked> <span class="legend-color" style="background-color: black;"></span> Half-day Accepted</label>
        <label><span class="event-filter" data-color="orange" checked> <span class="legend-color" style="background-color: orange;"></span> Company Half Day</label>
    </div>

<div id="voidempo-calendar" style="background-color:white; padding: 10px;">
</div>
<div class="modal fade" id="holidayModal" tabindex="-1" aria-labelledby="holidayModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content" style="width : 75% !important;">
      <form id="holiday-form">
		  <input type="hidden" id="holiday-start" name="holiday_start">
		  <input type="hidden" id="holiday-end" name="holiday_end">
        <div class="modal-header">
          <h5  class="modal-title" id="holidayModalLabel">Add Holiday/Half Day</h5>
          <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
        </div>
        <div class="modal-body">
          <div class="mb-3">
            <label for="holiday-title" class="form-label">Holiday Title</label>
            <input type="text" class="form-control" id="holiday-title" name="title" >
          </div>
		   <div class="form-check">
            <input class="form-check-input" type="checkbox" value="1" id="holiday-halfday" name="half_day">
            <label class="form-check-label" for="holiday-halfday" style="margin-left:2%;">
                Half Day
            </label>
        </div>
        <div class="modal-footer">
          <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
          <button type="submit" class="btn btn-primary">Save </button>
        </div>
      </form>
    </div>
  </div>
</div>