<div class="info hide-for-print">
    <div class="row" id="entryToggle">
        <div class="small-12 columns text-center">
            <p><br><a class="" href="#"><i id="entryToggleIcon" class="fa fa-chevron-circle-up"></i> <span id="entryToggleText">Hide</span></a></p>
        </div>
    </div>
    <div id="entryForm">
        <div class="row">
            <?php
            if(count($this->errorMessage) > 0)
            {

                echo "<div data-alert class=\"alert-box warning\">";
                foreach($this->errorMessage as $message)
                {
                    echo $message;
                }
                echo "<a href=\"#\" class=\"close\">&times;</a></div>";

            }

            if(count($this->successMessage) > 0)
            {

                echo "<div data-alert class=\"alert-box success\">";
                foreach($this->successMessage as $message)
                {
                    echo $message;
                }
                echo "<a href=\"#\" class=\"close\">&times;</a></div>";

            }
            ?>
        </div>
        <div class="row">
            <div class="small-12 columns">
                <div class="row">
                   <?php
                    echo $this->formstart();
                   ?>
                </div>
                <div class="row">
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['date'] ?>
                    </div>
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['inTime'] ?>
                    </div>
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['outTime'] ?>
                    </div>
                </div>
                <div class="row">
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['lessTime'] ?>
                    </div>
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['code'] ?>
                    </div>
                    <div class="small-6 medium-4 columns">
                        <br>
                        <?php echo $this->fields['submit'] ?>
                    </div>
                    <?php echo $this->formend(); ?>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    <?php
    $date = new DateTime();

    if($date->format('d') > 25)
    {
        $date->modify('first day of next month');
        $date->modify('+25 days');
    }
    $maxDate = $date->setDate($date->format('Y'),$date->format('m'),25)->format('m/d/Y');
    $minDate = $date->modify('-1 month +1 day');
    $minDate = $date->format('m/d/Y');
    ?>

    $(document).ready(function() {
        $(function() {
            $( "#date" ).datepicker({
                numberOfMonths:2,
                minDate: "<?php echo $minDate ?>",
                maxDate: "<?php echo $maxDate ?>",
                showWeek: true,
                showButtonPanel: true
            });
        });

        $('#entryToggle').click(function()
        {
            if($('#entryForm').is(":visible"))
            {
                $('#entryToggleIcon').addClass('fa-chevron-circle-down');
                $('#entryToggleIcon').removeClass('fa-chevron-circle-up');
                $('#entryToggleText').html('Show');
            }
            else
            {
                $('#entryToggleIcon').addClass('fa-chevron-circle-up');
                $('#entryToggleIcon').removeClass('fa-chevron-circle-down');
                $('#entryToggleText').html('Hide')
            }
            $('#entryForm').slideToggle(400);
        });


    });
</script>