View information of the offer with id
// ?toggle_accept= Toggle the accepted status of the offer with id
// ?toggle_payment_eligibility= Toggle the payment eligibility of the offer with id
// ?generate_invoice= Generate an invoice for the offer with id
// ?trash_invoice= Trash the invoice file
// ?delete= Delete the offer with id
//------------------------------------------------------------------------------
// The header of the page
$header = 'Offers';
// Whether or not to show an individual offer in the end (false if not, or the id if yes)
$show_individual = false;
// View offer
if (isset($_GET['id'])) {
$id = (int) $_GET['id'];
try {
$offer = new Offer($_pdo, $id);
$header = "Offers / #{$offer->id}";
$show_individual = $id;
} catch (PDOException $e) {
$alert = "
The offer with id $id could not be found.
";
} catch (Exception $e) {
$alert = "
The offer with id $id could not be found.
";
}
}
// Show the header
echo "
$header
";
if (isset($alert)) echo "
$alert
";
// Accept offer
if (isset($_GET['toggle_accept'])) {
echo "