<?php $__env->startSection('page_title'); ?>
    OSAA - Solo Music Entries &amp; Schedule
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_sub_title'); ?>    
    
    OSAA Solo Music Championships Entries &amp; Schedule

<?php $__env->stopSection(); ?>

<?php $__env->startSection('scripts'); ?>
    @parent

    <script src="//cdn.datatables.net/1.10.5/js/jquery.dataTables.min.js" type="text/javascript"></script>

    <style type="text/css">
      	

        h3 {
      		color: #990000 !important;
      	}    	
      	
        table {
            width: 100%;
            border-collapse: collapse;
        }

        table thead th {
            text-align: left;
            cursor: pointer;
        }

        table tbody tr {
            line-height: 1.5em;
        }

        .odd {
            background-color: #dfdfdf;
        } 
        
        .dataTables_filter {
            margin-bottom: 1em;
        }

        #entries_filter label {
            font-weight: bold;            
        }

        .dataTables_info {
            margin-top: 1em;
            font-size: 9pt;
        }

        .updated_at {
            position: absolute;
            right: 0;
            font-size: 12pt;
            font-weight: bold;
        }


    </style>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('jquery_init'); ?>    

    <?php /*  // Table row highlighter
    function colorRows ()
    {       
        $('table').each(function ()
        {
            var i = 0;

            $('tbody tr:visible', $(this)).each(function ()
            {
                if (i % 2 == 1)
                {
                    $(this).addClass('odd');
                }
                else
                {
                    $(this).removeClass('odd');
                }
                i = i + 1;
            });     
        });
    }   
    colorRows();  
  */ ?>
    $('#entries').DataTable({
        'paging' : false,
        'order' : [[3, 'asc'], [2, 'asc']],
        'columnDefs' : [{'target' : 5, 'type' : 'date'}]
    });

    $('.back_button')
        .button({'icons' : {'primary':'ui-icon-arrowthick-1-w'}})  
        .css({'font-size':'9pt'});

    $('.download_button')
        .button({'icons' : {'primary':'ui-icon-document'}})  
        .css({'font-size':'9pt','margin-right':'10px'});

    $('input[type="search"]')
        .css({'margin-left' : '5px'});
    
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page_functions'); ?>

    <?php if (!is_null($info['download_file'])): ?>

        <a href="<?php echo asset($info['download_file']); ?>" class="download_button">Download</a>

    <?php endif; ?>

    <a href="<?php echo url('/activities/sol'); ?>" class="back_button">Solo Music</a>
    
<?php $__env->stopSection(); ?>


<?php $__env->startSection('main_content'); ?>    		  

    <?php if (!is_null($info['file_stats'])): ?>
        <div class="updated_at" data-show="<?php echo (time() >= strtotime('2017-03-23 18:00:00')) ? 'YES' : 'NO'; ?>">Updated <?php echo date('n/j/Y g:ia', $info['file_stats']['mtime']); ?></div>
    <?php endif; ?>

    <br />

    <table id="entries" class="hover">
        <thead>
            <tr>
                <th>ID #</th>
                <th>Participant</th>
                <th>School</th>
                <th>Category</th>
                <th>Room</th>
                <th>Time</th>
                <th>Accompanist</th>
            </tr>
        </thead>

        <tbody>
            <?php if (count($info['entries']) > 0): ?>
                <?php foreach ($info['entries'] as $entry): ?>
                    <tr>
                        <td><?php echo $entry['id']; ?></td>
                        <td><?php echo $entry['student_first']; ?> <?php echo $entry['student_last']; ?></td>
                        <td><?php echo $entry['school']; ?></td>
                        <td><?php echo $entry['category']; ?></td>
                        <td><?php echo $entry['room']; ?></td>
                        <td><?php echo $entry['time']; ?></td>
                        <td><?php echo $entry['accompanist']; ?></td>
                    </tr>
                <?php endforeach; ?>
            <?php endif; ?>
        </tbody>

    </table>   	
    

    <br class="clear" />
<?php $__env->stopSection(); ?>
