<?php
///////////////////////////////////////////////
///  PilotAwardsSystem v2.0 by php-mods.eu  ///
///            Author php-mods.eu           ///
///            Packed at 8/12/2019          ///
///     Copyright (c) 2019, php-mods.eu     ///
///////////////////////////////////////////////

?>
<h3><?php echo SITE_NAME; ?> Awards</h3>
<?php
if(!$category) {echo 'Currently, there are not any award categories';}
else { foreach($category as $cat) { ?>
<h3><?php echo $cat->name; ?></h3>
<center>
<table id="tabledlist" class="tablesorter">
    <thead>
        <tr>
            <th>Title</th>
            <th>Description</th>
            <th>Image</th>
        </tr>
    </thead>
<tbody>
<?php $allawards = AwardData::category_awards($cat->id); 
if(!$allawards) {?> <tr><td colspan="3" align="center">There are not any <?php echo $cat->name; ?> Awards.</td></tr> <?php }
else { 
foreach($allawards as $awa) { ?>
<tr>
    <td width="20%" align="center"><?php echo $awa->name; ?></td>
    <td width="60%" align="center"><?php echo $awa->descrip; ?></td>
    <td width="20%" align="center"><img src="<?php echo $awa->image; ?>" style="max-height: 100px;" alt="<?php echo $awa->name; ?>" /></td>
</tr>
<?php } } ?>
</tbody>
</table>
<?php } } ?>
</center>