/** * Generate the rent payment statement from a tenant as a PDF document * @param string $start The start period of the rent payment * @param string $end The end period of rent payment * @return file A PDF file containing the record */ public function generatePdfRecord($start, $end) { /*$hdgs = array('Start Period(yy-mm-dd)', 'End Period(yy-mm-dd)', 'Date Paid', 'Receipt No', 'Amount'); $aligns = array('L', 'L', 'L', 'L', 'R'); $widths = NULL; $ttl = $this->getFullName(); $db = Database::getInstance(); $mysqli = $db->getConnection(); $sql = "SELECT start_date, end_date, date_paid, receipt_no, FORMAT(amount, 0) "; $sql .= "FROM rent WHERE (SELECT CONVERT(date_paid, DATE) BETWEEN "; $sql .= "'".$mysqli->real_escape_string($start); $sql .= "' AND '".$mysqli->real_escape_string($end)."' = 1) AND tid = ".$this->id; $result = $mysqli->query($sql); if($result->num_rows == 0){ return false; } else { $report = new Report(); $report->pdfStmt($ttl, $result, $hdgs, $widths, $aligns, 'P', 'A4', $start, $end); }*/ $rent = new Rent(); $rent->getPaymentHistoryInPdf($this->id, $start, $end); }