Skip to content
Snippets Groups Projects
buchungen.class.php 1.22 KiB
Newer Older
Eric Laufer's avatar
Eric Laufer committed
<?php

Eric Laufer's avatar
Eric Laufer committed
class buchungen{
Eric Laufer's avatar
Eric Laufer committed
	private $db;
	
	function __construct(){
		global $datenbank;
		$this->db = $datenbank;
	}
	
	public function Auflisten(){
Eric Laufer's avatar
Eric Laufer committed
		$aus = '
			<table class="table" id="UserBuchung">
				<thead>
					<tr>
						<th>#</th>
						<th>User</th>
						<th>Datum</th>
						<th>Zeit</th>
						<th>Buchungs-ID</th>
						<th>Buchungsmenge</th>
						<th>Verwendungszweck</th>
						<th>Buchung Eroflgreich</th>
					</tr>
				</thead>
				<tbody>';
				
		foreach($this->db->get_results("SELECT * FROM ". PREFIX . BUCH ." ORDER BY id DESC ") AS $res){
Eric Laufer's avatar
Eric Laufer committed
			if($res->buchung_ok == 1){
				$ok = '<img src="https://img.icons8.com/material/24/000000/checked.png" style="color:green;">';
			}else{
				$ok = '<img src="https://img.icons8.com/material/24/000000/close-window.png" style="color:red">';
			}
Eric Laufer's avatar
Eric Laufer committed
			$aus .= '
					<tr>
						<td>'. $res->id .'</td>
						<td>'. $res->uid .'</td>
						<td>'. date("d.m.Y",$res->buchungszeit) .'</td>
						<td>'. date("H:i",$res->buchungszeit) .'</td>
						<td>'. $res->buchungs_id .'</td>
						<td>'. number_format($res->buchungsmenge,2,',','.') .'</td>
						<td>'. $res->verwendungszweck .'</td>
						<td>'. $ok .'</td>
					</tr>
					';
Eric Laufer's avatar
Eric Laufer committed
		}
Eric Laufer's avatar
Eric Laufer committed
		$aus .= '</tbody></table>';
Eric Laufer's avatar
Eric Laufer committed
		return $aus;
	}
}