function select_list($fieldname,$Selected_Value,$Hersteller="",$Gruppe1="",$Gruppe2="",$Gruppe3="", $FSYSTEM="",$Artikel1="") {
$db = odbc_connect('mac_dbf','', ' ');
if ($Gruppe2) $where .= "Gruppe2 = '$Gruppe2' AND ";
if ($Hersteller) $where = "Hersteller = '$Hersteller' AND ";
if ($Gruppe1) $where .= "Gruppe1 = '$Gruppe1' AND ";
if ($Gruppe3) $where .= "Gruppe3 = '$Gruppe3' AND ";
if ($FSYSTEM) $where .= "FSYSTEM = '$FSYSTEM' AND ";
if ($Artikel1) $where .= "Artikel1 = $Artikel1' AND ";
if ($where) $where = "WHERE ".substr($where,0,strlen($where)-4);
echo "$where <br>";
$sql = "SELECT $fieldname FROM mac_dbf $where GROUP BY $fieldname ";
$result = odbc_exec($db, $sql);
$num_fields = odbc_num_fields($result);
$Option = "<option value=\"\">*</option>\n";
while (odbc_fetch_row ($result)) {
for ($i = 1; $i <= $num_fields; ++$i) {
$row = odbc_result($result,$i);
$field_name = odbc_field_name($result,$i);
if ($Selected_Value == $row) $selected = "selected";
else $selected = "";
$Option .= "<option $selected>$row</option>\n ";
}
}
odbc_free_result($result);
odbc_close($db);
return $Option;
}
with this i would like that,if ichose "Hersteller", as request get all Products of "Hersteller" in Gruppe1,Gruppe2, Gruppe3... . This code does it. From to to down.
Hesrteller
Gruupe1
Gruupe2
Gruupe3
Gruupe2
Perfect!
I would like also,that if ich make a chose from somewhere but not from "Hesterller", (from Grupe1 or Gruppe2) i can get the same result. But i cann't get any information about the attributs wich are up of my chose. If the chose is from Gruppe2 i cann't get from which Gruppe1 noch Hersteller ist this Gruppe2.
Gruupe4
Gruupe3
Gruupe2
Gruupe1
Hersteller
IS NOT POSSIBLE!.
can someone help me?
Regards.
$db = odbc_connect('mac_dbf','', ' ');
if ($Gruppe2) $where .= "Gruppe2 = '$Gruppe2' AND ";
if ($Hersteller) $where = "Hersteller = '$Hersteller' AND ";
if ($Gruppe1) $where .= "Gruppe1 = '$Gruppe1' AND ";
if ($Gruppe3) $where .= "Gruppe3 = '$Gruppe3' AND ";
if ($FSYSTEM) $where .= "FSYSTEM = '$FSYSTEM' AND ";
if ($Artikel1) $where .= "Artikel1 = $Artikel1' AND ";
if ($where) $where = "WHERE ".substr($where,0,strlen($where)-4);
echo "$where <br>";
$sql = "SELECT $fieldname FROM mac_dbf $where GROUP BY $fieldname ";
$result = odbc_exec($db, $sql);
$num_fields = odbc_num_fields($result);
$Option = "<option value=\"\">*</option>\n";
while (odbc_fetch_row ($result)) {
for ($i = 1; $i <= $num_fields; ++$i) {
$row = odbc_result($result,$i);
$field_name = odbc_field_name($result,$i);
if ($Selected_Value == $row) $selected = "selected";
else $selected = "";
$Option .= "<option $selected>$row</option>\n ";
}
}
odbc_free_result($result);
odbc_close($db);
return $Option;
}
with this i would like that,if ichose "Hersteller", as request get all Products of "Hersteller" in Gruppe1,Gruppe2, Gruppe3... . This code does it. From to to down.
Hesrteller
Gruupe1
Gruupe2
Gruupe3
Gruupe2
Perfect!
I would like also,that if ich make a chose from somewhere but not from "Hesterller", (from Grupe1 or Gruppe2) i can get the same result. But i cann't get any information about the attributs wich are up of my chose. If the chose is from Gruppe2 i cann't get from which Gruppe1 noch Hersteller ist this Gruppe2.
Gruupe4
Gruupe3
Gruupe2
Gruupe1
Hersteller
IS NOT POSSIBLE!.
can someone help me?
Regards.
Kommentar