loggedin) { die("Logt u a.u.b. eerst in."); } if (!$action) $action="search_commit"; if ($action=="search_commit") { if ((!$vestiging) || (!$lijst_type)) { ?> Kies een vestiging:


"; ?> Deel 1 Deel 2

"; print ""; die(""); } // Pre-cache tabel: Merk $merk_count = 0; $data = mysql_query("SELECT * FROM merk"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'merk'!"); while ($dat = mysql_fetch_array($data)) { $merken[$merk_count]["ID"] = $dat["ID"]; $merken[$merk_count]["Naam"] = $dat["Naam"]; $merk_count++; } // Pre-cache tabel: Type $type_count = 0; $data = mysql_query("SELECT * FROM type"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'type'!"); while ($dat = mysql_fetch_array($data)) { $typen[$type_count]["ID"] = $dat["ID"]; $typen[$type_count]["Naam"] = $dat["Omschrijving"]; $typen[$type_count]["Merk"] = $dat["Merk"]; $type_count++; } // Pre-cache tabel: Brandstof $brandstof_count = 0; $data = mysql_query("SELECT * FROM brandstof"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'brandstof'!"); while ($dat = mysql_fetch_array($data)) { $brandstoffen[$brandstof_count]["ID"] = $dat["ID"]; $brandstoffen[$brandstof_count]["Naam"] = $dat["Naam"]; $brandstof_count++; } // Pre-cache tabel: Koetswerk $koetswerk_count = 0; $data = mysql_query("SELECT * FROM koetswerk"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'koetswerk'!"); while ($dat = mysql_fetch_array($data)) { $koetswerken[$koetswerk_count]["ID"] = $dat["ID"]; $koetswerken[$koetswerk_count]["Naam"] = $dat["Naam"]; $koetswerk_count++; } // Pre-cache tabel: Versnelling $versnelling_count = 0; $data = mysql_query("SELECT * FROM versnelling"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'versnelling'!"); while ($dat = mysql_fetch_array($data)) { $versnellingen[$versnelling_count]["ID"] = $dat["ID"]; $versnellingen[$versnelling_count]["Naam"] = $dat["Naam"]; $versnelling_count++; } // Pre-cache tabel: Kleur $kleur_count = 0; $data = mysql_query("SELECT * FROM kleur"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'kleur'!"); while ($dat = mysql_fetch_array($data)) { $kleuren[$kleur_count]["ID"] = $dat["ID"]; $kleuren[$kleur_count]["Naam"] = $dat["Naam"]; $kleur_count++; } // Pre-cache tabel: Accessoires $accessoire_count = 0; $data = mysql_query("SELECT * FROM accessoires"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'accessoires'!"); while ($dat = mysql_fetch_array($data)) { $accessoires[$accessoire_count]["ID"] = $dat["ID"]; $accessoires[$accessoire_count]["Naam"] = $dat["Naam"]; $accessoire_count++; } // Pre-cache tabel: Meeruitvoeringen $meeruitvoering_count = 0; $data = mysql_query("SELECT * FROM meeruitvoeringen"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'meeruitvoeringen'!"); while ($dat = mysql_fetch_array($data)) { $meeruitvoeringen[$meeruitvoering_count]["ID"] = $dat["ID"]; $meeruitvoeringen[$meeruitvoering_count]["Naam"] = $dat["Naam"]; $meeruitvoering_count++; } // Pre-cache tabel: Uitvoering $uitvoering_count = 0; $data = mysql_query("SELECT * FROM uitvoering"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'uitvoering'!"); while ($dat = mysql_fetch_array($data)) { $uitvoeringen[$uitvoering_count]["ID"] = $dat["ID"]; $uitvoeringen[$uitvoering_count]["Naam"] = $dat["Naam"]; $uitvoering_count++; } // Pre-cache tabel: Vestiging $vestiging_count = 0; $data = mysql_query("SELECT * FROM vestiging"); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'vestiging'!"); while ($dat = mysql_fetch_array($data)) { $vestigingen[$vestiging_count]["ID"] = $dat["ID"]; $vestigingen[$vestiging_count]["Naam"] = $dat["Naam"]; $vestiging_count++; } if ($lijst_type == 1) { print "

Auto Maasstad Occasionlijst (Deel 1)

"; print ""; print ""; print ""; print ""; print "
Vestiging:".$vestigingen[zoek_item($vestiging, $vestiging_count, $vestigingen)]["Naam"]."
Datum:".date("D m F Y")."
Tijd:".date("H:i:s")."

"; $cnt = 0; for ($i=0; $i<$merk_count; $i++) { $mn = $merken[$i]["Naam"]; $mi = $merken[$i]["ID"]; $close_table = false; $query = "SELECT * FROM auto WHERE Merk='$mi' AND Vestiging=$vestiging ORDER BY Type"; $data = mysql_query($query); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'auto'!".mysql_error()); $vorige_type = -1; while ($dat = mysql_fetch_array($data)) { if ($vorige_type != $dat["Type"]) { $vorige_type = $dat["Type"]; //print "Merk: $mn
"; //print "Type: ".$typen[zoek_item($vorige_type, $type_count, $typen)]["Naam"]."
"; if ($close_table) print "
\n"; $close_table = true; print "\n"; print "\n"; } $cnt++; print "\n"; print "\n"; print "\n"; $meeruitvoering = ""; $mu = $meeruitvoeringen[zoek_item($dat["Meeruitv1"], $meeruitvoering_count, $meeruitvoeringen)]["Naam"]; if ($mu != "") $meeruitvoering .= "$mu\n"; $mu = $meeruitvoeringen[zoek_item($dat["Meeruitv2"], $meeruitvoering_count, $meeruitvoeringen)]["Naam"]; if ($mu != "") $meeruitvoering .= "
$mu\n"; $mu = $meeruitvoeringen[zoek_item($dat["Meeruitv3"], $meeruitvoering_count, $meeruitvoeringen)]["Naam"]; if ($mu != "") $meeruitvoering .= "
$mu\n"; $mu = $meeruitvoeringen[zoek_item($dat["Meeruitv4"], $meeruitvoering_count, $meeruitvoeringen)]["Naam"]; if ($mu != "") $meeruitvoering .= "
$mu\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "
".strtoupper($mn)." " . strtoupper($typen[zoek_item($vorige_type, $type_count, $typen)]["Naam"])."UITVOERINGMEERUITVOERINGBOUWJAARKLEURKM/STANDKENTEKENPRIJS (€)MARGE/BTW
".$typen[zoek_item($vorige_type, $type_count, $typen)]["Naam"]." ".$dat["Motor"]." ".$uitvoeringen[zoek_item($dat["Uitvoering"], $uitvoering_count, $uitvoeringen)]["Naam"]." $meeruitvoering ".$dat["Bouwmaand"] . " " . $dat["Bouwjaar"]." ".$kleuren[zoek_item($dat["Kleur"], $kleur_count, $kleuren)]["Naam"]." ".mooi_getal($dat["Kilometerstand"])." ".$dat["Kenteken"]." ".mooi_nummer($dat["Prijs"])." "; if ($dat["BTW"]=="1") print "BTW"; else print "MARGE"; print " 

\n"; } if ($cnt==0) print "Sorry, er zijn geen resultaten gevonden."; } else { if ($lijst_type==2) { print "

Auto Maasstad Occasionlijst (Deel 2)

"; print ""; print ""; print ""; print ""; print "
Vestiging:".$vestigingen[zoek_item($vestiging, $vestiging_count, $vestigingen)]["Naam"]."
Datum:".date("D m F Y")."
Tijd:".date("H:i:s")."

"; $cnt = 0; for ($i=0; $i<$merk_count; $i++) { $mn = $merken[$i]["Naam"]; $mi = $merken[$i]["ID"]; $close_table = false; $query = "SELECT * FROM auto WHERE Merk='$mi' AND Vestiging=$vestiging ORDER BY Type"; $data = mysql_query($query); if (!$data) die("FATAL ERROR: Could not SELECT FROM 'auto'!".mysql_error()); $vorige_type = -1; while ($dat = mysql_fetch_array($data)) { if ($vorige_type != $dat["Type"]) { $vorige_type = $dat["Type"]; if ($close_table) print "
\n"; $close_table = true; print "\n"; /* Totaal 670 pixels breed voor A4 portrait */ print "\n"; } $cnt++; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print "
KENTEKENINKOOPPRIJS (€)DATUM INNAMEVERKOPER
".$dat["Kenteken"]." ".mooi_nummer($dat["Inkoopprijs"])." ".$dat["InnameDatum"]." ".$dat["Verkoper"]." 

\n"; } if ($cnt==0) print "Sorry, er zijn geen resultaten gevonden."; } else { die ("Lijst type is ongeldig!"); } } } send_footer(); ?>