<div class="section">
    <div class="row">
        <div class="small-12 columns">
            <h2><i class="fa fa-plus"></i> Admin Time Insert</h2>
        </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['account'] ?>
                    </div>
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['date'] ?>
                    </div>
                    <div class="small-6 medium-4 columns end">
                        <?php echo $this->fields['inTime'] ?>
                    </div>
                </div>
                <div class="row">
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['outTime'] ?>
                    </div>
                    <div class="small-6 medium-4 columns">
                        <?php echo $this->fields['lessTime'] ?>
                    </div>
                    <div class="small-6 medium-4 columns end">
                        <?php echo $this->fields['code'] ?>
                    </div>
                </div>
                <div class="row">
                    <div class="small-6 medium-8 columns">
                        <?php echo $this->fields['note'] ?>
                    </div>
                    <div class="small-6 medium-4 columns end">
                        <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('+1 month');
    }
    $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,
                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>