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

?>
<h3>Awards</h3>
<?php if(!$category) {echo 'Currently, there are not any award categories';}
else { ?>
<table width="30%" border="0">
<?php
foreach($category as $cat) { ?>
<tr><th colspan="3" align="center"><h2><?php echo $cat->name; ?></h2></th></tr>
<?php $awards = AwardData::grantedawards($cat->id, $userinfo->pilotid); 
if(!$awards)
            {?> <tr><td colspan="3" align="center">The pilot does not have any <?php echo $cat->name; ?>.</td></tr><?php }
else {
foreach($awards as $award) { ?>
<tr>
<td width="50%" align="center"><?php echo $award->name; ?></td>
<td width="50%" align="center"><img src="<?php echo $award->image; ?>" alt="" /><a href="<?php echo SITE_URL; ?>/index.php/awards/awardinfo_public/<?php echo $award->awardid; ?>/<?php echo Auth::$userinfo->pilotid; ?>">+</a></td></tr>
<?php } } ?>
<?php } ?>
</table>
<?php } ?>