id;
$x = "$vol->name";
return $x;
}
function order_vols($vols) {
$online = array();
$offline = array();
foreach ($vols as $vol) {
if (online($vol->status)) {
$online[] = $vol;
} else {
$offline[] = $vol;
}
}
shuffle($online);
return array_merge($online, $offline);
}
function vol_modes($vol) {
$x = "";
if ($vol->voice_ok && $vol->text_ok) {
return "Either";
}
if ($vol->text_ok) {
return "Text only";
}
if ($vol->voice_ok) {
return "Voice only";
}
}
function rating_info($vol) {
if ($vol->nratings == 0) {
return "(no ratings)";
}
$x = $vol->rating_sum/$vol->nratings;
if ($x > 4.5) $img = "stars-5-0.gif";
else if ($x > 4.0) $img = "stars-4-5.gif";
else if ($x > 3.5) $img = "stars-4-0.gif";
else if ($x > 3.0) $img = "stars-3-5.gif";
else if ($x > 2.5) $img = "stars-3-0.gif";
else if ($x > 2.0) $img = "stars-2-5.gif";
else if ($x > 1.5) $img = "stars-2-0.gif";
else if ($x > 1.0) $img = "stars-1-5.gif";
else if ($x > 0.5) $img = "stars-1-0.gif";
else if ($x > 0.0) $img = "stars-0-5.gif";
else $img = "stars-0-0.gif";
return "
Usual hours: $vol->availability";
}
if ($vol->specialties) {
$x .= "
Specialties: $vol->specialties";
}
if ($vol->projects) {
$x .= "
Projects: $vol->projects";
}
if (!$lang) {
$x .= "
Primary language: $vol->lang1";
if (!$vol->lang2) {
$x .= "
Secondary language: $vol->lang2";
}
}
$x .= "";
return $x;
}
function show_vol($vol) {
$status = $vol->status;
$image = button_image($status);
list_item_array(array(
vol_info($vol),
status_string($status),
vol_modes($vol),
info($vol),
rating_info($vol)
));
}
function show_vols($vols) {
echo "
You can send email to a volunteer even if they're offline.
To do so, click their name.
";
list_start("border=0");
list_heading_array(array(
"Volunteer name
click to contact",
"Status",
"Voice/Text",
"Info",
"Feedback
Click to see comments",
));
foreach ($vols as $vol) {
show_vol($vol);
}
list_end();
}
if ($lang) {
page_head("Online Help in $lang");
} else {
page_head("Online Help in all languages");
}
$vols = get_vols($lang);
$vols = order_vols($vols);
show_vols($vols);
page_tail();
?>