$id = $content['downloadInvoice']; $transaction = $this->query("SELECT * from transactions WHERE id='{$id}'")[0]; $ticket = $this->query("SELECT * from tickets WHERE id='{$transaction['ticket_id']}'")[0]; if (!$this->isMyTicket($ticket) && $transaction['ticket_id']) { $this->reloadTarget(); } if ($ticket) { $transactions = $this->query("SELECT * from transactions WHERE ticket_id='{$ticket['id']}'"); } $this->ajax = true; $this->createPDFInvoice($transaction, true, $transactions); } } $mod = new billing(); if (isset($_POST['stripeToken'])) { $mod->updateToken($_POST); } else { if (isset($_GET['cancelsub'])) { $mod->cancelSubscription(); } else { if (isset($_GET['checking'])) { $mod->checkingMain(); } else { if (isset($_POST['createDwollaAccount'])) { $mod->createDwollaAccount($_POST); } else { if (isset($_POST['addAccount'])) { $mod->addBankAccount($_POST); } else { if (isset($_GET['invoices'])) { $mod->showInvoices();