Subversion-Projekte lars-tiefland.content-management

Revision

Blame | Letzte Änderung | Log anzeigen | RSS feed

<?
    require_once  "/web/apache/content-management/Online-Shop/connect2.php";

    if ( $_POST["zusatzInfo"] )
    {
        $zusatzInfo = serialize( $_POST["zusatzInfo"] );
        $result = mysql_query( "
                                update Bestellung
                                set zusatzInfo = '$zusatzInfo'
                                where
                                        Bestellung.ID = '" . $_GET[ID] . "'
                                " );
    }

    $result = mysql_query( "
                        select
                                Logins.*,
                                shops.Name as shopName,
                                Bestellung.*,
                                date_format(Bestellung.erstellt_am, '%d.%m.%Y') as erstellt_am,
                                left(Bestellung.erstellt_von,locate('@',Bestellung.erstellt_von)-1) as erstellt_von
                        from
                                Bestellung,
                                Logins,
                                shops
                        where
                                Bestellung.ID = '" . $_GET[ID] . "'
                        and
                                Bestellung.Login = Logins.ID
                        and
                                Bestellung.shops_ID = shops.ID
                        " );
    $Bestellung = mysql_fetch_assoc( $result );
    $zusatzInfo = unserialize( $Bestellung["zusatzInfo"] );
    //$zusatzInfo = $_POST["zusatzInfo"];

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Unbenanntes Dokument</title>
<style type="text/css">
<!--
body {
        font-family:Arial, Helvetica, sans-serif;
}
.break {
        clear:both;
        float:none;
}
.footer {
        clear:both;
        float:none;
}
.bottom {
        padding-top:20px;
}
#Personendaten {
        float:left;     
        left:0px;
        top:40px;
        width:49%;
        height:auto;
        z-index:1;
    padding-right:5px;
}
#Fahrzeugdaten {
        float:left;
        width:49%;
        height:auto;
        z-index:2;
    padding-bottom:5px;
}
#items {
        
        left:0px;
        width:650px;
        top:325px;
        height:auto;
        z-index:3;
}
#disclaimer {
        padding-top:10px;
        left:0px;
        bottom:-105px;
        width:650px;
        height:auto;
        font-size:10px;
        z-index:4
}
#Logo {
        float:left;
        left:0px;
        
        width:50px;
        height:61px;
        z-index:5;
        padding-top:20px;
}
#Adresse {
        float:left;
        padding-left:10px;
        left:60px;
        top:-40px;
        width:257px;
        height:58px;
        z-index:6
}
#Unterschrift {
        
        left:321px;
        padding-top:30px;
        width:330px;
        height:40px;
        text-align:center;
        z-index:7
}
#headline { 
        
        left:0px;
        top:0px;
        width:650px;
        height:auto;
        text-align:center;
        z-index:8
}
#shopInfo {
        
        left:0px;
        top:244px;
        width:324px;
        height:49px;
        z-index:9;
}
table {
        border-color:#000000;
}
td, th, th.big {
        white-space:nowrap;
        text-align:left;
        font-size:12px;
        height:30px;
        border-color:#000000;
}
th.big {
        font-size:18px;
}
#items * td {
        height:15px;
        border-style:solid;
        border-width: 0px 1px 0px 1px;
        border-color:#000000;
        vertical-align:top;
}
td.borderTop {
        border-top:1px solid #000000;
}

@media print {
        input {
                display:none;
        }
}

@media screen {
        input {
                border:none;
                width:95%;
                height:100%;
                background-color:#FFFFFF;
        }
        span.wert {
                display:none;
        }
        input.radio {
                border:none;
                width:20px;
                height:20px;
        }
}
-->
</style>
</head>

<body onload="window.print();">
<form method="post" action="">
<div id="headline">
        <h2>Werkstattauftrag / Bestellung Nr. <?= $_GET[ID]; ?> - <?= $Bestellung[erstellt_am]; ?></h2>
</div>
<div id="Personendaten">
        <table border="1" cellspacing="0" cellpadding="4" width="100%">
            <tr>
              <th colspan="2" class="big">Kundendaten</th>
            </tr>
                <tr>
                        <th>Firma</th>
                        <td><?= ( $Bestellung[Name2] ) ? $Bestellung[Name2] : "&nbsp;"; ?></td>
                </tr>
            <tr>
              <th width="20%">Name, Vorname </th>
              <td width="80%"><?= $Bestellung[Anrede]; ?> <?= $Bestellung[Vorname]; ?> <?= $Bestellung[Name1]; ?></td>
            </tr>
            <tr>
              <th>Strasse, HausNr. </th>
              <td><?= $Bestellung[Strasse]; ?> <?= $Bestellung[Hausnummer]; ?></td>
            </tr>
            <tr>
              <th>PLZ, Ort</th>
              <td><?= $Bestellung[PLZ]; ?> <?= $Bestellung[ORT]; ?></td>
            </tr>
            <tr>
              <th>Telefon / Fax </th>
              <td><?= $Bestellung[Telefon]; ?> / <?= $Bestellung[Fax]; ?></td>
            </tr>
            <tr>
              <th colspan="2" class="big"><?= $Bestellung[shopName]; ?></th>
            </tr>
        </table>
</div>
<div id="Fahrzeugdaten">
  <table border="1" cellspacing="0" cellpadding="4" width="100%">
    <tr>
      <th colspan="4" class="big">Fahrzeugdaten</th>
    </tr>
    <tr>
      <th width="18%">Fahrgestell-Nr:</th>
      <td colspan="3">
        <input type="text" name="zusatzInfo[fahrgestellNr]" value="<?= $zusatzInfo[fahrgestellNr]; ?>" />
                <span class="wert"><?= $zusatzInfo[fahrgestellNr]; ?></span>
      </td>
    </tr>
    <tr>
      <th>Fahrzeugtyp:</th>
      <td width="32%"><input type="text" name="zusatzInfo[fahrzeugTyp]" value="<?= $zusatzInfo[fahrzeugTyp]; ?>" />
          <span class="wert"><?= $zusatzInfo[fahrzeugTyp]; ?></span>
          </td>
      <th width="15%">km-Stand:</th>
      <td width="35%"><input type="text" name="zusatzInfo[km]" value="<?= $zusatzInfo[km]; ?>" />
          <span class="wert"><?= $zusatzInfo[km]; ?></span>
          </td>
    </tr>
    <tr>
      <th>Kennzeichen:</th>
      <td><input type="text" name="zusatzInfo[kennzeichen]" value="<?= $zusatzInfo[kennzeichen]; ?>" />
          <span class="wert"><?= $zusatzInfo[kennzeichen]; ?></span></td>
      <th>Zulassung:</th>
      <td><input type="text" name="zusatzInfo[zulassung]" value="<?= $zusatzInfo[zulassung]; ?>" />
          <span class="wert"><?= $zusatzInfo[zulassung]; ?></span></td>
    </tr>
    <tr>
      <th>KW/PS:</th>
      <td><input type="text" name="zusatzInfo[kw_ps]" value="<?= $zusatzInfo[kw_ps]; ?>" />
          <span class="wert"><?= $zusatzInfo[kw_ps]; ?></span></td>
      <th>Hubraum</th>
      <td><input type="text" name="zusatzInfo[hubraum]" value="<?= $zusatzInfo[hubraum]; ?>" />
          <span class="wert"><?= $zusatzInfo[hubraum]; ?></span></td>
    </tr>
    <tr>
      <th>T&Uuml;V:</th>
      <td><input type="text" name="zusatzInfo[tuev]" value="<?= $zusatzInfo[tuev]; ?>" />
          <span class="wert"><?= $zusatzInfo[tuev]; ?></span></td>
      <th>AU:</th>
      <td><span class="wert"><?= $zusatzInfo[au]; ?></span></td>
    </tr>
    <tr>
      <th colspan="4">angenommen durch: <?= $Bestellung[erstellt_von]; ?><input style="display:none" type="submit" value="OK" /></th>
    </tr>
  </table>
</div>
<div id="items">
  <table border="1" cellpadding="4" cellspacing="0">
    <tr>
      <th style="height:40px;" colspan="4" class="big">Arbeiten / verwendete Ersatzteile</th>
    </tr>
    <tr>
      <th width="26" style="height:50px;">Menge</th>
      <th width="494" style="height:50px;">Bezeichnung</th>
      <th width="65" style="height:50px;">Einzelpreis</th>
      <th width="65" style="height:50px;">Gesamtpreis</th>
    </tr>
<?
    $query_art = "SELECT * FROM artikel_to_Bestellung WHERE Bestellung= '" .
        $_GET[ID] . "' AND status != 'storniert' ORDER BY Rang";
    $result = mysql_query( $query_art );
    if ( !$result )
        echo mysql_error() . "<br>" . $query_art;
    while ( $artikel = mysql_fetch_assoc( $result ) )
    {
        if ( $artikel["artikel"] != 999999 )
        {
            $sql_a = "SELECT * from artikel WHERE ID=" . $artikel["artikel"];
            $res_a = mysql_query( $sql_a );

            if ( !$res_a )
            {
                //$errString = mysql_error()."<br>$sql_q";
                echo "<tr><td colspan=4>" . mysql_error() . "<br>$sql_q</td></tr>";
            }
            $row_a = mysql_fetch_assoc( $res_a );

            $kennung = $row_a["kennung"];
            if ( $row_a["Father"] == -3 )
            {
                $artikel["Menge"] = "&nbsp;";
                $sum = number_format( $artikel[Preis_pro_Stueck], 2, '.', '' );
            }
            else
            {
                $sum = number_format( $artikel[Preis_pro_Stueck] * $artikel[Menge],
                    2, '.', '' );
            }
        }
        else
        {
            $sum = number_format( $artikel[Preis_pro_Stueck] * $artikel[Menge],
                2, '.', '' );
        }
?>
    <tr>
      <td width="26"><?= $artikel[Menge]; ?></td>
      <td width="494"><?= $artikel[Bezeichnung]; ?></td>
      <td width="65" style="text-align: right;"><? $pps = $artikel[Preis_pro_Stueck];
        if ( $pps > 0 )
        {
            echo $pps;
        }
        else
        {
            echo "&nbsp;";
        } ?></td>
      <td width="65" style="text-align: right;"><? if ( $sum > 0 )
        {
            echo $sum;
        }
        else
        {
            echo "&nbsp;";
        } ?></td>
    </tr>
<?
        $total += $sum;
    }
    $total = number_format( $total, 2, '.', '' );
?>
    <tr style="border-top:1px solid #000000;">
      <td colspan="3" style="border-top:1px solid #000000;">&nbsp;</td>
      <td style="border-top:1px solid #000000;text-align:right;"><u><?= $total; ?></u></td>
    </tr>
    <tr>
      <td colspan="4" style="border-top:1px solid #000000;font-weight:bold;"><?= nl2br( $Bestellung["Bemerkung_extern"] ); ?></td>
    </tr>
    <tr>
      <td colspan="4" style="border-top:1px solid #000000;"><p>Die ersetzten Teile sollen ausgeliefert
          werden:
                        <input type="radio" class="radio" name="zusatzInfo[teileAusliefern]" value="Ja" <? if ( $zusatzInfo["teileAusliefern"] ==
"Ja" )
    {
        echo "checked ";
    } ?>/><span class="wert">(&nbsp;<? if ( $zusatzInfo[teileAusliefern] !=
"Ja" )
    {
        echo "&nbsp;";
    }
    else
    {
        echo "X";
    } ?>&nbsp;)</span> Ja
                        &nbsp;&nbsp;&nbsp;
                        <input type="radio" class="radio" name="zusatzInfo[teileAusliefern]" value="Nein" <? if ( $zusatzInfo["teileAusliefern"] ==
"Nein" )
    {
        echo "checked ";
    } ?>/><span class="wert">(&nbsp;<? if ( $zusatzInfo[teileAusliefern] !=
"Nein" )
    {
        echo "&nbsp;";
    }
    else
    {
        echo "X";
    } ?>&nbsp;)</span> Nein
        </p>      </td>
    </tr>
    <tr>
      <td colspan="4">Erforderliche Mehrarbeiten ausf&uuml;hren? Ggf.
        bis &euro; <input type="text" name="zusatzInfo[mehrarbeitMaxKosten]" value="<?= $zusatzInfo["mehrarbeitMaxKosten"] ?>" style="width:50px; border-bottom:1px solid #000000;" />
                <span class="wert"><?= $zusatzInfo["mehrarbeitMaxKosten"]; ?></span>            </td>
    </tr>
</table>
</div>
<div class="break"></div>
<div class="footer">
        <div id="disclaimer">
                <p>Der Auftrag wird unter ausdr&uuml;cklicher Anerkennung der mir ausgeh&auml;ndigten &quot;Bedingungen
                f&uuml;r die Ausf&uuml;hrung von Arbeiten an Kraftfahrzeugen, Anh&auml;ngern, Aggregaten und
                deren Teilen und f&uuml;r Kostenvoranschl&auml;ge&quot; erteilt. Die Aufbewahrungsfrist für Reparaturen, Motoren,                         Trolly`s etc. beträgt sechs Wochen bei Nichtabholung behalten wir uns vor die reparierten Teile der Verschrottung zu                          zuführen und auch diese Kosten in Rechnung zu stellen.
                </p>
                <p>
                        <strong style="font-size: 1.2em;">Bitte beachten Sie, dass bei einer Bezahlung vor Ort mit Kreditkarte oder EC-Karte Ihr Tageslimit nicht überschritten wird! Wie hoch Ihr Tageslimit eingestellt ist erfahren Sie bei Ihrer Bank.</strong>
                </p>
        </div>
        
        <div class="bottom">
                <div id="Logo">
                        <img src="../../../../images/Domain-Logos/17.gif" width="50" height="61" alt="" />
                </div>

                <div id="Adresse">
                        PIEPER Technik GmbH<br />
                Sandstrasse 14-18<br />
                D-45964 Gladbeck<br />
                Tel. (0 20 43) 6 99 10
            </div>
        
                <div id="Unterschrift">
                        ____________________________________<br />Unterschrift des Kunden
                </div>
        </div>
        <div class="break"></div>
</div>
</form>
<input type="text" name="zusatzInfo[au]" value="<?= $zusatzInfo[au]; ?>" /> 
+
</body>
</html>