<?php 
include "inc/dbconnect.php";
include ("inc/datum.php");
$result = mysql_query("
    SELECT
        o.*,
        g.geslacht,
        g.naam,
        g.email,
        p.produkt,
        u.uitvoering,
				f.formaat,
				a.afwerking,
				aan.aantal
    FROM
        opdrachten AS o,
        gebruikers AS g,
        produkten AS p,
        uitvoeringen AS u,
				formaten AS f,
				afwerkingen AS a,
				aantallen AS aan
    WHERE
        o.relatienr = '".$map."'
    AND
        g.gebruikerid = '".$gebruiker_id."'
    AND
        p.produktid = o.produktid
    AND
        u.uitvoeringid = o.uitvoeringid
    AND
        f.formaatid = o.formaatid
    AND
        a.afwerkingid = o.afwerkingid
    AND
        aan.aantalid = o.aantalid
",$db);
while ($row = mysql_fetch_array($result)) 
{
$email = $row['email'];
$prijs = number_format($row['prijs'], 2, ',', '.');
$datumshow = fixDate($row['datum']);

				if ($alternate == "1") 
				{ 
				$color = "#efefef"; 
				$alternate = "2"; 
				} 
				else 
				{ 
				$color = "#dedede"; 
				$alternate = "1"; 
				} 

									 if ($row['formaat'] == 'custom')
									 {
									 $content_custom = '<table border=0 bgcolor=#FF8000 cellspacing=0 cellpadding=2 width=800>
									 <tr><td colspan=\"7\" class=\'kop3\'><b>'.$row['bestand'].'</b></td></tr>
									 <tr>
									 <td bgcolor='.$color.' width=250 class=\'kop2\'>Produkt</td>
									 <td bgcolor='.$color.' width=130 class=\'kop2\'>Uitvoering</td>
									 <td bgcolor='.$color.' width=90 class=\'kop2\'>Formaat</td>
									 <td bgcolor='.$color.' width=120 class=\'kop2\'>Afwerking</td>
									 <td bgcolor='.$color.' width=50 class=\'kop2\'>Aantal</td>
									 <td bgcolor='.$color.' width=100 class=\'kop2\'>Totaal</td>
									 </tr>
									 <tr>
									 <td bgcolor='.$color.' width=250>'.$row['produkt'].'</td>
									 <td bgcolor='.$color.' width=130>'.$row['uitvoering'].'</td>
									 <td bgcolor='.$color.' width=90>'.$row['kort'].' x '.$row['lang'].' cm.</td>
									 <td bgcolor='.$color.' width=120>'.$row['afwerking'].'</td>
									 <td bgcolor='.$color.' width=50>'.$row['aantal'].'</td>
									 <td bgcolor='.$color.' width=100>&euro; '.$prijs.'</td>
									 </tr>
									 </table>';
									 }
									 else
									 {
									 $content = '<table border=0 bgcolor=#FF8000 cellspacing=0 cellpadding=2 width=800>
									 <tr><td colspan=\"7\" class=\'kop3\'><b>'.$row['bestand'].'</b></td></tr>
									 <tr>
									 <td bgcolor='.$color.' width=250 class=\'kop2\'>Produkt</td>
									 <td bgcolor='.$color.' width=130 class=\'kop2\'>Uitvoering</td>
									 <td bgcolor='.$color.' width=90 class=\'kop2\'>Formaat</td>
									 <td bgcolor='.$color.' width=120 class=\'kop2\'>Afwerking</td>
									 <td bgcolor='.$color.' width=50 class=\'kop2\'>Aantal</td>
									 <td bgcolor='.$color.' width=100 class=\'kop2\'>Totaal</td>
									 </tr>
									 <tr>
									 <td bgcolor='.$color.' width=250>'.$row['produkt'].'</td>
									 <td bgcolor='.$color.' width=130>'.$row['uitvoering'].'</td>
									 <td bgcolor='.$color.' width=90>'.$row['formaat'].'</td>
									 <td bgcolor='.$color.' width=120>'.$row['afwerking'].'</td>
									 <td bgcolor='.$color.' width=50>'.$row['aantal'].'</td>
									 <td bgcolor='.$color.' width=100>&euro; '.$prijs.'</td>
									 </tr>
									 </table>';
									 }
									 $totaalopdrachten .= $content_custom.$content; 
} 

$body = '<html>
<head>
<style type=\'text/css\'>
<!--body { color: #464646; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none }
td { color: #464646; font-size: 11px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: none }
td.kop2 {  color: #464646; font-family: Verdana; font-size: 11px; color: #000000; font-weight: bold; text-decoration: none }
td.kop3 {  color: #464646; font-family: Verdana; font-size: 12px; color: #FFFFFF; font-weight: bold; text-decoration: none }
a:link     { color: #464646; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: underline }
a:visited     { color: #464646; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: underline }
a:hover    { color: #464646; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: underline }
a:active    { color: #8c8c8c; font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif; text-decoration: underline }-->
</style>
</head>
<body>';
	
$aanhef_klant = 'Geachte '.$row['geslacht'].' '.$row['naam'].',<br><br>
Uw opdracht is succesvol bij ons binnengekomen op '.$datumshow.'. Deze kunt u over 3 werkdagen afhalen. Eventuele vragen kunt u stellen via 
<a href=\'mailto:[email protected]?subject=vraag over map '.$map.'\'>deze link</a>.<br><br>
Wij danken u hartelijk voor uw opdracht.<br><br>';
	
$aanhef_colorstone = 'Onderstaand een nieuwe opdracht, binnengekomen op '.$datumshow.' via ftp map '.$map.'.<br><br>';

$headers  = 'MIME-Version: 1.0' . "\r\n"; 
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; 
$totaal = $body.$aanhef_klant.$totaalopdrachten; 
$totaal_colorstone = $body.$aanhef_colorstone.$totaalopdrachten; 

$mail = "[email protected]";
mail($email, 'Uw opdracht', $totaal, $headers, 'From: '.$mail.'\r\n');
mail($mail, 'Nieuwe opdracht', $totaal_colorstone, $headers, 'From: '.$email.'\r\n');
?>
Undefined variable: mail

Dat betekent dat de variabele $mail ergens niet bestaat. En dat klopt ook op regel 132 in bovenstaande code bestaat $mail nog niet. Verplaats regel 136 dus even naar regel 129.

ps. Wat betreft die volgorde, misschien even een ORDER BY aan de query toevoegen?
Blanche, enorm bedankt voor je hulp. Ik ben ontzettend blij; alles werkt goed!!

Zit ik alleen met 1 klein dingetje nog; hij doet het wel zoals bedoelt maar ik krijg toch bij error_reporting;
Notice: Undefined variable: alternate
Puur voor het mooie ben ik benieuwd of dit op te lossen is?

Dit is de code;

if ($alternate == "1") 
        { 
            $color = "#efefef"; 
            $alternate = "2"; 
        } 
        else 
        { 
            $color = "#dedede"; 
            $alternate = "1"; 
        } 
Dat komt omdat alternate vooraf niet gedeclareerd is. Je zou het zo op kunnen lossen:
<?php
if (isset($alternate) && $alternate == "1")
{
$color = "#efefef";
$alternate = "2";
}
else
{
$color = "#dedede";
$alternate = "1";
}
?>
Ook deze fout is verholpen; nogmaals bedankt voor je geweldige hulp!!

Reageren