Planner

Planlægningskalenderen for $event_name, $user_name

“;
echo “

“;

echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
$sql=”SELECT id, tekst, minantal FROM planner_options WHERE event_id=$event_id ORDER BY starttid ASC”;
$result = mysql_query($sql);
while ($row = mysql_fetch_array($result)) {
$sql=”SELECT svar FROM planner_result WHERE event_id=$event_id AND user_id=$user_id AND option_id=$row[id]”;
$result2 = mysql_query($sql);
$row2 = mysql_fetch_array($result2);
if ($row2[svar] == “”) { $svar=”U”; }
else { $svar=”$row2[svar]”; }
echo “

“;
$sql=”SELECT count(*) as antal FROM planner_result WHERE event_id=$event_id AND option_id=$row[id] AND svar=’J'”;
$result3 = mysql_query($sql);
$row3 = mysql_fetch_array($result3);
$antal=$row3[antal];
$sql=”SELECT user_name FROM planner_result, planner_users WHERE planner_result.event_id=$event_id AND planner_result.user_id=planner_users.id AND planner_result.option_id=$row[id] AND planner_result.svar=’J’ ORDER BY user_name DESC”;
$result4 = mysql_query($sql);
$ulist=””;
while ($row4 = mysql_fetch_array($result4)) {
if ($ulist == “”) { $ulist=”$row4[user_name]”;}
else { $ulist=”$row4[user_name] $ulist”; }
}
if ($antal == 0) { $class=”box-red”; }
if ($antal > 0) { $class=”box-yellow”; }
if ($antal >= $row[minantal]) { $class=”box-green”; }

echo “

“;
echo ““;
echo ““;
echo “

“;
if ($svar == “J”) { $sel=”checked”; }
else { $sel=””; }
echo “

“;
if ($svar == “N”) { $sel=”checked”; }
else { $sel=””; }
echo “

“;
if ($svar == “U”) { $sel=”checked”; }
else { $sel=””; }
echo “

“;
echo “

“;
echo “

“;
}
echo “

Aktivitet Kan deltage Kan ikke deltage Ubesvaret
$row[tekst]

“;
}
echo “
“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

“;
echo “

Betyder at der er nok, som har tilmeldt sig!
Betyder at der er nogen, men ikke nok, som har tilmeldt sig!
Betyder at der ikke er nogen, som har tilmeldt sig!

“;

?>