public function get_bill($type = BILL_TYPE_AUTODETECT, $target = BILL_TARGET_ATTENDEE) { global $g_pdo; if ($type == BILL_TYPE_AUTODETECT) { $type = BILL_TYPE_QUOTATION; if ($this->is_confirmed()) { $type = BILL_TYPE_INVOICE; } } $request = <<<EOF SELECT `id` FROM `bill` WHERE `id_event`= :id_event AND `type`= :type AND target = :target EOF; debug($request); $q = $g_pdo->prepare($request); $array = array(":id_event" => $this->id, ":type" => $type, ":target" => $target); $q->execute($array); $bill_array = array(); while (($record = $q->fetch()) != NULL) { debug("record=" . sprint_r($record)); $bill = Bill::get_from_id($record["id"]); $bill_array[] = $bill; } return $bill_array; }
public function get_bill() { return Bill::get_from_id($this->bill_id); }
<?php require_once BASE_DIR . "/include/constants.inc"; require_once BASE_DIR . "/include/globals.inc"; require_once BASE_DIR . "/include/misc.inc"; require_once BASE_DIR . "/include/print.inc"; require_once BASE_DIR . "/include/format.inc"; $bill = Bill::get_from_id(100077); ?> <?php print_bill($bill, PRINT_BILL_CONTEXT_DEFAULT, PRINT_BILL_FORMAT_PDF);