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

?>
<h3>Edit Award</h3>
<form id="form" action="<?php echo adminaction('/awards/award_edit_db/');?>" method="post">
<table width="50%" border="0">
<tr>
<td width="10%"><b>Award Title:</b></td>    
    <td width="60%">
    <input name="name" id="name" value="<?php if($error) echo $name; else echo $form->name; ?>" />
    <input name="awardid" id="awardid" value="<?php echo $form->awardid; ?>" type="hidden" /></td>
</tr>
<tr>
<td><b>Description:</b></td>
<td><textarea cols="40" id="descrip" name="descrip" rows="5"><?php if($error) echo $descrip; else echo $form->descrip; ?></textarea>
</td>
</tr>
<tr>
<td><b>Image:</b></td>
<td><input name="image" id="image" value="<?php if($error) echo $image; else echo $form->image; ?>" /></td>
</tr>
<tr>
<td><b>Category:</b></td>
<td><select name="category">
<?php foreach($categories as $cate) { ?>
    <option value="<?php echo $cate->id; ?>"  <?php if (($error && $category == $cate->id) || (!$error && $form->category == $cate->id)) echo 'selected="selected"' ; ?>><?php echo $cate->name; ?></option>
<?php } ?>
</select></td>
  </tr>
<tr>
<td colspan="2"><input type="submit" name="submit" value="Edit Award" /></td>
</tr>
</table>
</form>