<div class="content-header">
	<div class="header-section">
		<h1>
			<i class="fa fa-image"></i><strong>Screenshot</strong> Center<br><small>Showcase your best, we'll do the rest!</small>
		</h1>
	</div>
</div>
<?php
if (!$screenshots)
{ ?>
    <div class="alert alert-info alert-dismissable animation fadeIn">
      There are no screenshots which are awaiting approval
    </div>
    <a href="<?php echo SITE_URL?>/index.php/screenshots" class="btn btn-default btn-md">Back to Gallery</a>
   <?php }
else
{ ?>

<div class="row">
  <div class="col-md-12">
    <div class="block">
      <div class="block-title">
        <h3>Pending List</h3>
        <?php

foreach($screenshots as $screenshot)
    {
        $pilot = PilotData::getpilotdata($screenshot->pilot_id);
        
        echo '<form action="'.SITE_URL.'/index.php/Screenshots" method="post" enctype="multipart/form-data">';
       echo '<table class="table table-responsive">';
       echo '<tr>
                <td>
                    <img src="'.SITE_URL.'/pics/'.$screenshot->file_name.'" width="400px" height="300px" alt="screenshot" /><br /><br />
                </td>
                <td>
                    File Name: '.$screenshot->file_name.'<br /><br />
                    Submited By: '.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::getpilotcode($pilot->code, $pilot->pilotid).'<br /><br />
                    Date: '.date('m/d/Y', date(strtotime($screenshot->date_uploaded))).'<br /><br />
                    Description: '.$screenshot->file_description.'<br /><br />
                    <input type="hidden" name="file" value="'.$screenshot->file_name.'" />
                    <input type="hidden" name="id" value="'.$screenshot->id.'" />
                    <input type="hidden" name="pid" value="'.$pilot->pilotid.'" />
                    <input type="hidden" name="action" value="approve_screenshot" />
                    <input class="mail btn btn-success" type="submit" value="Approve Screenshot!">
                    </form>
                    <br /><br />
                    <form action="'.SITE_URL.'/index.php/Screenshots" method="post" enctype="multipart/form-data">
                    <input type="hidden" name="file" value="'.$screenshot->file_name.'" />
                    <input type="hidden" name="id" value="'.$screenshot->id.'" />
                    <input type="hidden" name="pid" value="'.$pilot->pilotid.'" />
                    <input type="hidden" name="action" value="reject_screenshot" />
                    <input class="mail btn btn-danger" type="submit" value="Reject Screenshot">
                </td>';
          echo '</tr>';
          echo '</table></form>';

    }
}
?>
        
      </div>
    </div>
  </div>
</div>
