function member_fields($email) { $fieldnames = array('firstName', 'prefName', 'lastName', 'email', 'phone', 'picture', 'passengers', 'onCampus', 'location', 'about', 'major', 'minor', 'techYear', 'hometown', 'gChat', 'twitter', 'gatewayDrug', 'conflicts'); $ret = array(); $member = mysql_fetch_array(mysql_query("select * from member where email = '{$email}'"), MYSQL_ASSOC); foreach ($fieldnames as $field) { $ret[$field] = $member[$field]; } $ret["registration"] = enrollment($email); return $ret; }
function rosterProp($member, $prop) { global $SEMESTER, $CHOIR; if (!$CHOIR) { die("No choir selected"); } $html = ''; switch ($prop) { case "Section": $section = mysql_fetch_array(mysql_query("select `sectionType`.`name` from `sectionType`, `activeSemester` where `sectionType`.`id` = `activeSemester`.`section` and `activeSemester`.`choir` = '{$CHOIR}' and `activeSemester`.`semester` = '{$SEMESTER}' and `activeSemester`.`member` = '" . $member["email"] . "'")); $html .= $section['name']; break; case "Contact": $html .= "<a href='tel:" . $member["phone"] . "'>" . $member["phone"] . "</a><br><a href='mailto:" . $member['email'] . "'>" . $member["email"] . "</a>"; break; case "Location": $html .= $member["location"]; break; case "Car": if ($member["passengers"] == 0) { $html .= "No"; } else { $html .= $member["passengers"] . " passengers"; } break; case "Enrollment": $enr = enrollment($member["email"]); if ($enr == "class") { $html .= "<span style=\"color: blue\">class</span>"; } else { if ($enr == "club") { $html .= "club"; } else { $html .= "<span style=\"color: gray\">inactive</span>"; } } break; case "Balance": $balance = balance($member['email']); if ($balance < 0) { $html .= "<span class='moneycell' style='color: red'>{$balance}</span>"; } else { $html .= "<span class='moneycell'>{$balance}</span>"; } break; case "Dues": $result = mysql_fetch_array(mysql_query("select sum(`amount`) as `balance` from `transaction` where `memberID` = '" . $member['email'] . "' and `type` = 'dues' and `semester` = '{$SEMESTER}'")); $balance = $result['balance']; if ($balance == '') { $balance = 0; } if ($balance >= 0) { $html .= "<span class='duescell' style='color: green'>{$balance}</span>"; } else { $html .= "<span class='duescell' style='color: red'>{$balance}</span>"; } break; case "Gigs": $gigcount = attendance($member["email"], 3); $result = mysql_fetch_array(mysql_query("select `gigreq` from `semester` where `semester` = '{$SEMESTER}'")); $gigreq = $result['gigreq']; if ($gigcount >= $gigreq) { $html .= "<span class='gigscell' style='color: green'>"; } else { $html .= "<span class='gigscell' style='color: red'>"; } $html .= "{$gigcount}</span>"; break; case "Score": if (enrollment($member["email"]) == 'inactive') { $grade = "--"; } else { $grade = attendance($member["email"], 0); } $html .= "<span class='gradecell'"; if (enrollment($member["email"]) == "class" && $grade < 80) { $html .= " style=\"color: red\""; } $html .= ">{$grade}</span>"; break; case "Tie": $html .= "<span class='tiecell' "; $result = mysql_fetch_array(mysql_query("select sum(`amount`) as `amount` from `transaction` where `memberID` = '" . $member['email'] . "' and `type` = 'deposit'")); $tieamount = $result['amount']; if ($tieamount == '') { $tieamount = 0; } if ($tieamount >= fee("tie")) { $html .= "style='color: green'"; } else { $html .= "style='color: red'"; } $html .= ">"; $query = mysql_query("select `tie` from `tieBorrow` where `member` = '" . $member['email'] . "' and `dateIn` is null"); if (mysql_num_rows($query) != 0) { $result = mysql_fetch_array($query); $html .= $result['tie']; } else { $html .= "•"; } $html .= "</span>"; break; default: $html .= "???"; break; } return $html; }
function rosterProp($member, $prop) { global $SEMESTER, $CHOIR; if (!$CHOIR) { die("No choir selected"); } $html = ''; switch ($prop) { case "Section": $section = mysql_fetch_array(mysql_query("select `sectionType`.`name` from `sectionType`, `activeSemester` where `sectionType`.`id` = `activeSemester`.`section` and `activeSemester`.`choir` = '{$CHOIR}' and `activeSemester`.`semester` = '{$SEMESTER}' and `activeSemester`.`member` = '" . $member["email"] . "'")); $html .= $section['name']; break; case "Contact": $html .= "<a href='tel:" . $member["phone"] . "'>" . $member["phone"] . "</a><br><a href='mailto:" . $member['email'] . "'>" . $member["email"] . "</a>"; break; case "Location": $html .= $member["location"]; break; case "Balance": $balance = balance($member['email']); if ($balance < 0) { $html .= "<span class='moneycell' style='color: red'>{$balance}</span>"; } else { $html .= "<span class='moneycell'>{$balance}</span>"; } break; case "Dues": $result = mysql_fetch_array(mysql_query("select sum(`amount`) as `balance` from `transaction` where `memberID` = '" . $member['email'] . "' and `type` = 'dues' and `semester` = '{$SEMESTER}'")); $balance = $result['balance']; if ($balance == '') { $balance = 0; } if ($balance >= 0) { $html .= "<span class='duescell' style='color: green'>{$balance}</span>"; } else { $html .= "<span class='duescell' style='color: red'>{$balance}</span>"; } break; case "Score": if (enrollment($member["email"]) == 'inactive') { $grade = "--"; } else { $grade = attendance($member["email"], 0); } $html .= "<span class='gradecell'"; if (enrollment($member["email"]) == "class" && $grade < 80) { $html .= " style=\"color: red\""; } $html .= ">{$grade}</span>"; break; default: $html .= "???"; break; } return $html; }