/*
Copyright-boodschap:
Copyright (c) 2001 by Thijs Sloesen
All rights reserved!
Contact Thijs Sloesen at: epidemi@seekitfast.com
For license-details see license.txt as shipped with this product.
Auto Maasstad Site - Search Page
*/
function zoek_item($m, $num_items, $items)
{
for ($i=0; $i < $num_items; $i++)
{
if ($items[$i]["ID"] == $m)
return $i;
}
return -1; // niet gevonden
}
include "shared.php";
init();
send_header("Occasions");
if ($action == "add_commit")
{
$accX=$accX.$eacc1.$eacc2.$eacc3.$eacc4.$eacc5;
$query="UPDATE auto SET
Actief='$actief',
Inkoopprijs='$inkoopprijs',
InnameDatum='$innamedatum',
Werk='$werk',
Duplicaatcode='$duplicaatcode',
Merk='$merk',
Model='$model',
Type='$type',
Uitvoering='$uitvoering',
Brandstof='$brandstof',
Chassisnr='$chassisnr',
Koetswerk='$koetswerk',
Kleur='$kleur',
Gewicht='$gewicht',
BrutoBPM='$brutobpm',
Datumdeel1='$datumdeel1',
Meldcode='$meldcode',
Prijs='$prijs',
Transmissie='$transmissie',
Kilometerstand='$kilometerstand',
AccX='$accX',
BTW='$btw',
Garantie='$garantie'
WHERE Kenteken='$kenteken'";
// $query="UPDATE auto SET " . $query_names . "=" . $query_values . " WHERE Kenteken='$kenteken'";
$result = mysql_query($query);
if (!$result) { $e = mysql_error(); die ("FATAL ERROR: Kan auto niet toevoegen aan database! mysql error: $e query: $query"); }
print "De auto is gewijzigd!
";
// $query = "UPDATE auto SET Gewicht='$gewicht' WHERE kenteken='$kenteken'";
// mysql_query($query) or die ("query mislukt");
// print "De auto is gewijzigd!
";
}
else if (!$action)
{
if ($kenteken==-1)
die("Selecteer een auto!");
if ($kenteken=="-")
die("Selecteer een auto!");
$query = "SELECT * FROM auto WHERE Kenteken='$kenteken'";
//print "$query
";
// Pre-cache tabel: model
$model_count = 0;
$data = mysql_query("SELECT * FROM model ORDER BY naam");
if (!$data)
die("FATAL ERROR: Could not SELECT FROM 'model'!");
while ($dat = mysql_fetch_array($data))
{
$modellen[$model_count]["ID"] = $dat["ID"];
$modellen[$model_count]["Naam"] = $dat["Naam"];
$model_count++;
}
// Pre-cache tabel: merk
$merk_count = 0;
$data = mysql_query("SELECT * FROM merk ORDER BY naam");
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: Brandstof
$brandstof_count = 0;
$data = mysql_query("SELECT * FROM brandstof ORDER BY naam");
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: Type
$type_count = 0;
$data = mysql_query("SELECT * FROM type ORDER BY Model, Omschrijving");
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"];
$type_count++;
}
// Pre-cache tabel: Koetswerk
$koetswerk_count = 0;
$data = mysql_query("SELECT * FROM koetswerk ORDER BY naam");
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: Transmissie
$transmissie_count = 0;
$data = mysql_query("SELECT * FROM transmissie ORDER BY naam");
if (!$data)
die("FATAL ERROR: Could not SELECT FROM 'transmissie'!");
while ($dat = mysql_fetch_array($data))
{
$transmissies[$transmissie_count]["ID"] = $dat["ID"];
$transmissies[$transmissie_count]["Naam"] = $dat["Naam"];
$transmissie_count++;
}
// Pre-cache tabel: Kleur
$kleur_count = 0;
$data = mysql_query("SELECT * FROM kleur ORDER BY naam");
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 ORDER BY naam");
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 ORDER BY naam");
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 ORDER BY naam");
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++;
}
$data = mysql_query($query);
if (!$data)
die("FATAL ERROR: Could not SELECT FROM 'auto'!".mysql_error());
$cnt = 0;
while ($dat = mysql_fetch_array($data))
{
// $cnt++;
// print "";
?>
print "";
}
// if ($cnt==0)
// print "