| Gast | Problem und Frage zu Listenfeldauswertung .... Hi,
irgendwie hab ich grad mal wieder 'n Brett vorm Kopf
Also ich hab hier ein Formular, wo zwei Listboxen (SELECT) sowie 15 Checkboxen existieren.
in den Listboxen kann man zwischen Werktagen (1-10) und Wochentagen (1-10) auswählen. Je nachdem was man dort auswählt, sollen die Checkboxen ausgewählt sein ...
Mein bisheriger Code zur Auswertung: PHP-Code: $form_auftragsprioritaet_wtage = $_POST["form_auftragsprioritaet_wtage"];
$form_auftragsprioritaet_atage = $_POST["form_auftragsprioritaet_atage"];
$prio_auswahl_wt_array = array("-" => "Werktage", "10wtage" => "10 Werktage, bis zum ".date("d.m.",$datum10),"09wtage" => "9 Werktage, bis zum ". date("d.m.",$datum09), "08tage" => "8 Werktage, bis zum ". date("d.m.",$datum08), "07tage" => "7 Werktage, bis zum ". date("d.m.",$datum07), "06tage" => "6 Werktage, bis zum ". date("d.m.",$datum06), "05tage" => "5 Werktage, bis zum ". date("d.m.",$datum05), "04tage" => "4 Werktage, bis zum ". date("d.m.",$datum04), "03tage" => "3 Werktage, bis zum ". date("d.m.",$datum03), "02tage" => "2 Werktage, bis zum ". date("d.m.",$datum02), "01tage" => "1 Werktag, bis zum ". date("d.m.",$datum01));
$prio_auswahl_at_array = array("-" => "Wochentage", "10atage" => "10 Wochentage, bis zum ". date("d.m.",$arbeitstag10), "09atage" => "9 Wochentage, bis zum ". date("d.m.",$arbeitstag09), "08atage" => "8 Wochentage, bis zum ". date("d.m.",$arbeitstag08), "07atage" => "7 Wochentage, bis zum ". date("d.m.",$arbeitstag07), "06atage" => "6 Wochentage, bis zum ". date("d.m.",$arbeitstag06), "05atage" => "5 Wochentage, bis zum ". date("d.m.",$arbeitstag05), "04atage" => "4 Wochentage, bis zum ". date("d.m.",$arbeitstag04), "03atage" => "3 Wochentage, bis zum ". date("d.m.",$arbeitstag03), "02atage" => "2 Wochentage, bis zum ". date("d.m.",$arbeitstag02), "01atage" => "1 Wochentag, bis zum ". date("d.m.",$arbeitstag01));
$prioritaets_auswahl_wtage = "<SELECT name=\"form_auftragsprioritaet_wtage\">";
foreach ($prio_auswahl_wt_array as $k => $v)
{
if ($k == $form_auftragsprioritaet_wtage)
{
$prioritaets_auswahl_wtage .= "<OPTION value=\"".$k."\" selected>".$v."</OPTION>";
}
else
{
$prioritaets_auswahl_wtage .= "<OPTION value=\"".$k."\">".$v."</OPTION>";
}
}
$prioritaets_auswahl_wtage .= "</SELECT>";
$prioritaets_auswahl_atage = "<SELECT name=\"form_auftragsprioritaet_atage\">";
foreach ($prio_auswahl_at_array as $k => $v)
{
if ($k == $form_auftragsprioritaet_atage)
{
$prioritaets_auswahl_atage .= "<OPTION value=\"".$k."\" selected>".$v."</OPTION>";
}
else
{
$prioritaets_auswahl_atage .= "<OPTION value=\"".$k."\">".$v."</OPTION>";
}
}
$prioritaets_auswahl_atage .= "</SELECT>";
// $prioritaets_auswahl_atage = "<SELECT name=\"form_auftragsprioritaet_atage\"><OPTION value=\"-\">Wochentage</OPTION><OPTION value=\"10atage\">10 Wochentage, bis zum ". date("d.m.",$arbeitstag10) ."</OPTION><OPTION value=\"09atage\">9 Wochentage, bis zum ". date("d.m.",$arbeitstag09) ."</OPTION><OPTION value=\"08atage\">8 Wochentage, bis zum ". date("d.m.",$arbeitstag08) ."</OPTION><OPTION value=\"07atage\">7 Wochentage, bis zum ". date("d.m.",$arbeitstag07) ."</OPTION><OPTION value=\"06atage\">6 Wochentage, bis zum ". date("d.m.",$arbeitstag06) ."</OPTION><OPTION value=\"05atage\">5 Wochentage, bis zum ". date("d.m.",$arbeitstag05) ."</OPTION><OPTION value=\"04atage\">4 Wochentage, bis zum ". date("d.m.",$arbeitstag04) ."</OPTION><OPTION value=\"03atage\">3 Wochentage, bis zum ". date("d.m.",$arbeitstag03) ."</OPTION><OPTION value=\"02atage\">2 Wochentage, bis zum ". date("d.m.",$arbeitstag02) ."</OPTION><OPTION value=\"01atage\">1 Wochentag, bis zum ". date("d.m.",$arbeitstag01) ."</OPTION></SELECT>";
$tag0 = strtotime(now);
$tag1 = strtotime("+1 days");
$tag2 = strtotime("+2 days");
$tag3 = strtotime("+3 days");
$tag4 = strtotime("+4 days");
$tag5 = strtotime("+5 days");
$tag6 = strtotime("+6 days");
$tag7 = strtotime("+7 days");
$tag8 = strtotime("+8 days");
$tag9 = strtotime("+9 days");
$tag10 = strtotime("+10 days");
$tag11 = strtotime("+11 days");
$tag12 = strtotime("+12 days");
$tag13 = strtotime("+13 days");
$tag14 = strtotime("+14 days");
if ($form_auftragspriorität_atage != "-" AND $form_auftragsprioritaet_wtage == "-")
{
switch($form_auftragsprioritaet_atage)
{
case "-":
break;
case "10atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = date("Y-m-d",$tag4);
$form_todo_check_field05 = date("Y-m-d",$tag5);
$form_todo_check_field06 = date("Y-m-d",$tag6);
$form_todo_check_field07 = date("Y-m-d",$tag7);
$form_todo_check_field08 = date("Y-m-d",$tag8);
$form_todo_check_field09 = date("Y-m-d",$tag9);
$form_todo_check_field10 = date("Y-m-d",$tag10);
break;
case "09atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = date("Y-m-d",$tag4);
$form_todo_check_field05 = date("Y-m-d",$tag5);
$form_todo_check_field06 = date("Y-m-d",$tag6);
$form_todo_check_field07 = date("Y-m-d",$tag7);
$form_todo_check_field08 = date("Y-m-d",$tag8);
$form_todo_check_field09 = date("Y-m-d",$tag9);
$form_todo_check_field10 = "";
break;
case "08atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = date("Y-m-d",$tag4);
$form_todo_check_field05 = date("Y-m-d",$tag5);
$form_todo_check_field06 = date("Y-m-d",$tag6);
$form_todo_check_field07 = date("Y-m-d",$tag7);
$form_todo_check_field08 = date("Y-m-d",$tag8);
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
case "07atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = date("Y-m-d",$tag4);
$form_todo_check_field05 = date("Y-m-d",$tag5);
$form_todo_check_field06 = date("Y-m-d",$tag6);
$form_todo_check_field07 = date("Y-m-d",$tag7);
$form_todo_check_field08 = "";
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
case "06atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = date("Y-m-d",$tag4);
$form_todo_check_field05 = date("Y-m-d",$tag5);
$form_todo_check_field06 = date("Y-m-d",$tag6);
$form_todo_check_field07 = "";
$form_todo_check_field08 = "";
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
case "05atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = date("Y-m-d",$tag4);
$form_todo_check_field05 = date("Y-m-d",$tag5);
$form_todo_check_field06 = "";
$form_todo_check_field07 = "";
$form_todo_check_field08 = "";
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
case "04atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = date("Y-m-d",$tag4);
$form_todo_check_field05 = "";
$form_todo_check_field06 = "";
$form_todo_check_field07 = "";
$form_todo_check_field08 = "";
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
case "03atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = date("Y-m-d",$tag3);
$form_todo_check_field04 = "";
$form_todo_check_field05 = "";
$form_todo_check_field06 = "";
$form_todo_check_field07 = "";
$form_todo_check_field08 = "";
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
case "02atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = date("Y-m-d",$tag2);
$form_todo_check_field03 = "";
$form_todo_check_field04 = "";
$form_todo_check_field05 = "";
$form_todo_check_field06 = "";
$form_todo_check_field07 = "";
$form_todo_check_field08 = "";
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
case "01atage":
$form_todo_check_field00 = date("Y-m-d",$tag0);
$form_todo_check_field01 = date("Y-m-d",$tag1);
$form_todo_check_field02 = "";
$form_todo_check_field03 = "";
$form_todo_check_field04 = "";
$form_todo_check_field05 = "";
$form_todo_check_field06 = "";
$form_todo_check_field07 = "";
$form_todo_check_field08 = "";
$form_todo_check_field09 = "";
$form_todo_check_field10 = "";
break;
}
}
if (isset($form_todo_check_field00) AND !empty($form_todo_check_field00))
{
$todo_check_field_00 = "<input type=\"checkbox\" name=\"form_todo_check_field00\" value=\"". $form_todo_check_field00 ."\" checked>";
}
else
{
$todo_check_field_00 = "<input type=\"checkbox\" name=\"form_todo_check_field00\" value=\"". date("Y-m-d",$tag0) ."\">";
}
if (isset($form_todo_check_field01) AND !empty($form_todo_check_field01))
{
$todo_check_field_01 = "<input type=\"checkbox\" name=\"form_todo_check_field01\" value=\"". $form_todo_check_field01 ."\" checked>";
}
else
{
$todo_check_field_01 = "<input type=\"checkbox\" name=\"form_todo_check_field01\" value=\"". date("Y-m-d",$tag1) ."\">";
}
if (isset($form_todo_check_field02) AND !empty($form_todo_check_field02))
{
$todo_check_field_02 = "<input type=\"checkbox\" name=\"form_todo_check_field02\" value=\"". $form_todo_check_field02 ."\" checked>";
}
else
{
$todo_check_field_02 = "<input type=\"checkbox\" name=\"form_todo_check_field02\" value=\"". date("Y-m-d",$tag2) ."\">";
}
if (isset($form_todo_check_field03) AND !empty($form_todo_check_field03))
{
$todo_check_field_03 = "<input type=\"checkbox\" name=\"form_todo_check_field03\" value=\"". $form_todo_check_field03 ."\" checked>";
}
else
{
$todo_check_field_03 = "<input type=\"checkbox\" name=\"form_todo_check_field03\" value=\"". date("Y-m-d",$tag3) ."\">";
}
if (isset($form_todo_check_field04) AND !empty($form_todo_check_field04))
{
$todo_check_field_04 = "<input type=\"checkbox\" name=\"form_todo_check_field04\" value=\"". $form_todo_check_field04 ."\" checked>";
}
else
{
$todo_check_field_04 = "<input type=\"checkbox\" name=\"form_todo_check_field04\" value=\"". date("Y-m-d",$tag4) ."\">";
}
if (isset($form_todo_check_field05) AND !empty($form_todo_check_field05))
{
$todo_check_field_05 = "<input type=\"checkbox\" name=\"form_todo_check_field05\" value=\"". $form_todo_check_field05 ."\" checked>";
}
else
{
$todo_check_field_05 = "<input type=\"checkbox\" name=\"form_todo_check_field05\" value=\"". date("Y-m-d",$tag5) ."\">";
}
if (isset($form_todo_check_field06) AND !empty($form_todo_check_field06))
{
$todo_check_field_06 = "<input type=\"checkbox\" name=\"form_todo_check_field06\" value=\"". $form_todo_check_field06 ."\" checked>";
}
else
{
$todo_check_field_06 = "<input type=\"checkbox\" name=\"form_todo_check_field06\" value=\"". date("Y-m-d",$tag6) ."\">";
}
if (isset($form_todo_check_field07) AND !empty($form_todo_check_field07))
{
$todo_check_field_07 = "<input type=\"checkbox\" name=\"form_todo_check_field07\" value=\"". $form_todo_check_field07 ."\" checked>";
}
else
{
$todo_check_field_07 = "<input type=\"checkbox\" name=\"form_todo_check_field07\" value=\"". date("Y-m-d",$tag7) ."\">";
}
if (isset($form_todo_check_field08) AND !empty($form_todo_check_field08))
{
$todo_check_field_08 = "<input type=\"checkbox\" name=\"form_todo_check_field08\" value=\"". $form_todo_check_field08 ."\" checked>";
}
else
{
$todo_check_field_08 = "<input type=\"checkbox\" name=\"form_todo_check_field08\" value=\"". date("Y-m-d",$tag8) ."\">";
}
if (isset($form_todo_check_field09) AND !empty($form_todo_check_field09))
{
$todo_check_field_09 = "<input type=\"checkbox\" name=\"form_todo_check_field09\" value=\"". $form_todo_check_field09 ."\" checked>";
}
else
{
$todo_check_field_09 = "<input type=\"checkbox\" name=\"form_todo_check_field09\" value=\"". date("Y-m-d",$tag9) ."\">";
}
if (isset($form_todo_check_field10) AND !empty($form_todo_check_field10))
{
$todo_check_field_10 = "<input type=\"checkbox\" name=\"form_todo_check_field10\" value=\"". $form_todo_check_field10 ."\" checked>";
}
else
{
$todo_check_field_10 = "<input type=\"checkbox\" name=\"form_todo_check_field10\" value=\"". date("Y-m-d",$tag10) ."\">";
}
if (isset($form_todo_check_field11) AND !empty($form_todo_check_field11))
{
$todo_check_field_11 = "<input type=\"checkbox\" name=\"form_todo_check_field11\" value=\"". $form_todo_check_field11 ."\" checked>";
}
else
{
$todo_check_field_11 = "<input type=\"checkbox\" name=\"form_todo_check_field11\" value=\"". date("Y-m-d",$tag11) ."\">";
}
if (isset($form_todo_check_field12) AND !empty($form_todo_check_field12))
{
$todo_check_field_12 = "<input type=\"checkbox\" name=\"form_todo_check_field12\" value=\"". $form_todo_check_field12 ."\" checked>";
}
else
{
$todo_check_field_12 = "<input type=\"checkbox\" name=\"form_todo_check_field12\" value=\"". date("Y-m-d",$tag12) ."\">";
}
if (isset($form_todo_check_field13) AND !empty($form_todo_check_field13))
{
$todo_check_field_13 = "<input type=\"checkbox\" name=\"form_todo_check_field13\" value=\"". $form_todo_check_field13 ."\" checked>";
}
else
{
$todo_check_field_13 = "<input type=\"checkbox\" name=\"form_todo_check_field13\" value=\"". date("Y-m-d",$tag13) ."\">";
}
if (isset($form_todo_check_field14) AND !empty($form_todo_check_field14))
{
$todo_check_field_14 = "<input type=\"checkbox\" name=\"form_todo_check_field14\" value=\"". $form_todo_check_field14 ."\" checked>";
}
else
{
$todo_check_field_14 = "<input type=\"checkbox\" name=\"form_todo_check_field14\" value=\"". date("Y-m-d",$tag14) ."\">";
}
Wenn ich Wochentage auswähle, dann werden die entsprechenden Checkboxen auch angewählt. Nur wenn ich Werktage auswähle, dann passiert bis jetzt noch nix (weiss noch nicht genau wie ich das mache).
Das was mich momentan stutzig macht ist, das wenn ich PHP-Code: if ($form_auftragspriorität_atage == "-" AND $form_auftragsprioritaet_wtage == "-")
{
echo "at / wt ";
}
if ($form_auftragspriorität_atage == "-" AND $form_auftragsprioritaet_wtage != "-")
{
echo "at & <> wt ";
}
if ($form_auftragspriorität_atage != "-" AND $form_auftragsprioritaet_wtage != "-")
{
echo "<> at & <> wt ";
}
if ($form_auftragspriorität_atage != "-" AND $form_auftragsprioritaet_wtage == "-")
{
echo "<> at & wt ";
}
reinhänge alles eigtnlich korrekt auswähle, er dann meistens die priorität bei atagen als <> anzeigt ...
Kann mir jemand helfen ??
Thx
BP |