0){ while ($row = db_fetch_assoc($result)){ $array_participants = unserialize($row['participants']); foreach($array_participants as $index => $subarray_participants){ if (($subarray_participants['acctid']==$accountid) && ($subarray_participants['state']=="aboard")){ $difference = $row['date'] - time(); $days = floor($difference / 86400); $hours = floor(($difference - ($days*86400)) / 3600); $minutes = floor(($difference - ($days*86400) - ($hours*3600)) / 60); $str_nextmeeting = "`bNächster Termin`b in ".$days." Tagen ".$hours." Stunden und ".$minutes." Minuten!"; $str_color = "`&"; if ($difference<=345600) $str_color = "`y"; // 4 Tage if ($difference<=259200) $str_color = "`8"; // 3 Tage if ($difference<=172800) $str_color = "`/"; // 2 Tage if ($difference<=86400) $str_color = "`^"; // 1 Tag if ($difference<=43200) $str_color = "`6"; // 12 Stunden if ($difference<=21600) $str_color = "`q"; // 6 Stunden if ($difference<=10800) $str_color = "`d"; // 3 Stunden if ($difference<=7200) $str_color = "`Q"; // 2 Stunden if ($difference<=3600) $str_color = "`D"; // 1 Stunde if ($difference<=0){ $str_nextmeeting = "`bNächster Termin`b: Ein Treffen läuft gerade!"; $str_color = "`$"; //Hat schon angefangen un dauert noch an (max. 2h) } if ($difference<(-7200)){ $str_color = "`("; $str_nextmeeting = "`bNächster Termin`b: Du hast dich zu keinem Treffen angemeldet."; break 1; } break 2; } } } } else { $str_color = "`("; $str_nextmeeting = "`bNächster Termin`b: Es stehen keine Treffen an."; } $str_return = $str_color.$str_nextmeeting."`0"; return $str_return; } if ($_GET['type']=="access"){ if ($_GET['op']==""){ $sql = "SELECT * FROM `meetings` ORDER BY `date` ASC"; $result = db_query($sql); if (db_num_rows($result) > 0) { $str_output .= "
| Name | Datum | Wer? | Priorität (1-9) |
|---|---|---|---|
| ".($bool_signed?"`b`2":"").($bool_old?"`(":"").$row['name'].($bool_signed?"`b":"")."`0 | "; $str_output .= "".($bool_old?"`(":"").date("d.m.Y H:i",$row['date'])." Uhr`0 | "; $str_output .= "".($bool_old?"`(":"").$row['group']."`0 | "; $str_output .= "".($bool_old?"`(":"").$row['priority']."`0 | "; $str_output .= "
| `2Anwesend`0 | `4Abwesend`0 |
|---|---|
| "; foreach($array_participants as $subarray){ if ($subarray['state']=="aboard"){ $request = db_fetch_assoc(db_query("SELECT `name` FROM `accounts` WHERE `acctid` = '".$subarray['acctid']."' LIMIT 1")); $participantsection .= $request['name']."`n"; if ($request['name']==$session['user']['name']) $mystate = "aboard"; } } $participantsection .= " | "; foreach($array_participants as $subarray){ if ($subarray['state']=="absent"){ $request = db_fetch_assoc(db_query("SELECT `name` FROM `accounts` WHERE `acctid` = '".$subarray['acctid']."' LIMIT 1")); $participantsection .= $request['name']."`n"; if ($request['name']==$session['user']['name']) $mystate = "absent"; } } $participantsection .= " |