From 1ec8d12a7b125d41ecb723c5d83f2afef95408e9 Mon Sep 17 00:00:00 2001 From: Camil Staps Date: Sun, 31 Jul 2016 09:40:25 +0200 Subject: 0.5.2 emails --- include/offers.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'include/offers.php') diff --git a/include/offers.php b/include/offers.php index 8be7530..dbe5df0 100644 --- a/include/offers.php +++ b/include/offers.php @@ -37,6 +37,7 @@ require('./header.php'); // ?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 + // ?send_invoice= Send invoice to contact // ?delete= Delete the offer with id //------------------------------------------------------------------------------ @@ -137,6 +138,25 @@ require('./header.php'); echo ""; } + // Send invoice + if (isset($_GET['send_invoice'])) { + echo "
"; + $id = (int) $_GET['send_invoice']; + try { + $offer = new Offer($_pdo, $id); + if ($offer->send()) { + echo "
The invoice for offer {$id} has been sent to {$offer->getContact()->email}.
"; + } else { + echo "
The invoice could not be sent due to an unknown error.
"; + } + } catch (PDOException $e) { + echo "
The invoice could not be sent due to a PDO error.
"; + } catch (Exception $e) { + echo "
The offer with id {$id} could not be found.
"; + } + echo "
"; + } + // Delete offer if (isset($_GET['delete'])) { echo "
"; -- cgit v1.2.3