<?php
error_reporting(0);
include ('config.php');
mysql_select_db($datenbank, $connect);
$query_show = "SELECT * FROM rechnungen ORDER BY rechnungsnr ASC";
$show = mysql_query($query_show, $connect)
or die ("Konnte keine Verbindung zur Datenbank herstellen!");
$row_show = mysql_fetch_assoc($show);
$totalRows_show = mysql_num_rows($show);
?>
<html>
<head>
<title>Rechnungen</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="csslogin.css" rel="stylesheet" type="text/css" />
<style type="text/css">
@import url("http://www.sandystests.de/Kontakt/csslogin.css");
</style>
</head>
<body>
<div id="wrap">
<div id="header">
<!--Eine Logografik für die Website-->
<img src="bilder/Logo4.png" alt="Sabanovic Saso GmbH" width="490" height="147">
</div>
<div id="navigation">
</div><!--Navi Ende-->
<div id="content">
<table>
<tr><td width="125"><strong>RE-Datum</strong></td>
<td width="283"><strong>RE-Nummer</strong></td>
<td width="133"><strong>Kunde</strong></td>
</tr></table>
<?php do {
?>
<table width="557" bgcolor="#ededee">
<tr>
<td width="125"><?php echo $row_show ['ReDatum']; ?></td>
<td width="221"><?php echo $row_show ['rechnungsnr']; ?></td>
<td width="195"><div align="right"><?php echo $row_show ['KundenNR']; ?>, <?php echo $row_show ['name'];?></div></td>
</tr>
<tr>
</table>
<table bgcolor="#eeddff">
<td width="71"><font size="-2"> </font></td>
<td width="376"><font size="-2"><?php echo $row_show ['was1']; ?></font></td>
<td width="54"><div align="right"><font size="-2"><?php echo number_format(($row_show ['aw1']*$row_show ['aw']),2,",",",."); ?></font></div></td>
<td width="37"></td></tr>
<tr>
<td><font size="-2"> </font></td>
<td><font size="-2"><?php echo $row_show ['was2']; ?></font></td>
<td><div align="right"><font size="-2"><?php echo number_format(($row_show ['aw2']*$row_show ['aw']),2,",",",."); ?></font></div></td>
<td></td></tr>
<tr>
<td><font size="-2"> </font></td>
<td><font size="-2"><?php echo $row_show ['was3']; ?></font></td>
<td><div align="right"><font size="-2"><?php echo number_format(($row_show ['aw3']*$row_show ['aw']),2,",",",."); ?></font></div></td>
<td></td></tr>
<tr>
<td><font size="-2"> </font></td>
<td><font size="-2"><?php echo $row_show ['was4']; ?></font></td>
<td><div align="right"><font size="-2"><?php echo number_format(($row_show ['aw4']*$row_show ['aw']),2,",",",."); ?></font></div></td>
<td></td></tr>
<tr>
<td><font size="-2"> </font></td>
<td><font size="-2"><?php echo $row_show ['was5']; ?></font></td>
<td><div align="right"><font size="-2"><?php echo number_format(($row_show ['aw5']*$row_show ['aw']),2,",",",."); ?></font></div></td>
<td></td></tr>
<tr>
<td><font size="-2"><?php echo $row_show ['st6']; ?></font></td>
<td><font size="-2"><?php echo $row_show ['was6']; ?></font></td>
<td><div align="right"><font size="-2"><?php echo number_format(((($row_show ['eu6']* $row_show['st6'])/($row_show['mwst']+100))*100),2,",",",."); ?></font></div></td>
<td><div align="right"><font size="-2">netto</font></div></td>
</tr>
<tr>
<td><font size="-2"><?php echo $row_show ['st7']; ?></font></td>
<td><font size="-2"><?php echo $row_show ['was7']; ?></font></td>
<td><div align="right"><font size="-2"><?php echo number_format(((($row_show ['eu7']* $row_show['st7'])/($row_show['mwst']+100))*100),2,",",",."); ?></font></div></td>
<td><div align="right"><font size="-2">netto</font></div></td></tr>
<tr>
<td><font size="-2">km</font></td>
<td><font size="-2"><?php echo $row_show ['km']; ?></font></td>
<td><div align="right"><font size="-2"><?php echo number_format(($row_show ['km']*$row_show ['km1']),2,",","."); ?></font></div></td>
<td></td></tr>
<tr>
<td><font size="-2">netto</font></td>
<td><font size="-2"> </font></td>
<td><div align="right"><font size="-2"><?php $netto =($row_show ['aw1']*$row_show ['aw'])+($row_show ['aw2']*$row_show ['aw'])+
($row_show ['aw3']*$row_show ['aw'])+($row_show ['aw4']*$row_show ['aw'])+
($row_show ['aw5']*$row_show ['aw'])+
(($row_show ['eu6']* $row_show['st6'])/($row_show['mwst']+100)*100)+
(($row_show ['eu7']* $row_show['st7'])/($row_show['mwst']+100)*100)+
($row_show ['km']*$row_show ['km1']);
echo number_format($netto,2,",",",.");?></font></div></td>
<td></td>
</tr>
<tr>
<td><font size="-2">Mwst</font></td>
<td><font size="-2"><?php echo $row_show['mwst']; ?>%</font></td>
<td><div align="right"><font size="-2">
<?php $ust = $netto/100*$row_show['mwst'];
echo number_format($ust,2,",","."); ?>
</font></div></td>
<td></td>
</tr>
<tr>
<td><font size="-2">Brutto</font></td>
<td><font size="-2"> </font></td>
<td><div align="right"><strong><font size="-2" style="bold">
<?php $brutto = $netto+$ust;
echo number_format($brutto,2,",","."); ?>
</font></strong></div></td>
<td></td>
</tr>
</table>
<br />
<br />
<?php }
while ($row_show = mysql_fetch_assoc($show)); ?>
<?php include ('time.php'); ?>
<table>
<tr>
<td width="192">Stand am <?php echo $date1; ?></td>
<td width="201">netto: <?php echo $netto; ?></td>
<td width="149">brutto: <?php echo $brutto; ?></td>
</tr>
</table>
<?php
mysql_free_result($show);
?>
</div><!--content Ende-->
<div id="sidebar">
</div><!--sidebar Ende-->
</div><!--Wrap Ende-->
</body>
</html>