Beispiel #1
0
function member_table($conditions, $type = 'normal')
{
    global $SEMESTER;
    $cols = rosterPropList($type);
    $sql = 'select * from `member` order by `lastName` asc, `firstName` asc';
    if ($conditions != '' && $conditions != '()') {
        $sql = 'select * from `member` where ' . $conditions . ' order by `lastName` asc, `firstName` asc';
    }
    $members = mysql_query($sql);
    if (!$members) {
        die(mysql_error());
    }
    $html = "<table class='no-highlight' id='roster_table'><thead><tr>";
    foreach ($cols as $col => $width) {
        $html .= "<th style='width: {$width}'>{$col}</th>";
    }
    $html .= "</tr></thead><tbody>";
    $i = 1;
    while ($member = mysql_fetch_array($members, MYSQL_ASSOC)) {
        $html .= "<tr data-member='" . $member["email"] . "'>";
        foreach ($cols as $col => $width) {
            $html .= "<td style='width: {$width}px'";
            switch ($col) {
                case "#":
                    $html .= ">{$i}";
                    break;
                case "Name":
                    $html .= " data-tab=''><a href='#profile:" . $member["email"] . "'>" . completeNameFromEmail($member["email"]) . "</a>";
                    break;
                default:
                    $html .= ">" . rosterProp($member, $col);
                    break;
            }
            $html .= "</td>";
        }
        $html .= "</tr>";
        if ($type == "normal") {
            $html .= "<tr><td colspan=" . count($cols) . "><div class=tabbox></div></td></tr>";
        }
        $i++;
    }
    $html .= "</tbody></table>";
    return $html;
}
Beispiel #2
0
function basic_info($person)
{
    global $officer, $uber;
    $member = mysql_fetch_array(mysql_query("select * from `member` where `email` = '{$person}'"));
    $about = getMemberAttribute('about', $person);
    if ($about == '') {
        $about = "I don't have a quote";
    }
    $html .= "<img class='profile' src='" . profilePic($person) . "'>";
    $html .= "<h3><span style='font-weight: normal; padding-right: 8pt'>" . implode(" and ", positions($person)) . " </span> " . completeNameFromEmail($person) . "</h3>";
    $html .= "<div class='about'>\"{$about}\"</div>";
    $html .= "<table style='width: initial'><tr><td style='width: 40%; vertical-align: top'>";
    $html .= "<table>";
    $html .= "<tr><td class='key'>Email</td><td><a href='mailto:{$person}'>{$person}</a></td></tr>";
    $html .= "<tr><td class='key'>Phone</td><td><a href='tel:" . phoneNumber($person) . "'>" . phoneNumber($person) . "</a></td></tr>";
    $html .= "<tr><td class='key'>Section</td><td>" . sectionFromEmail($person, 1) . "</td></tr>";
    $html .= "<tr><td class='key'>Car</td><td>" . rosterProp($member, "Car") . "</td></tr>";
    $html .= "<tr><td class='key'>Major</td><td>" . getMemberAttribute('major', $person) . "</td></tr>";
    $html .= "<tr><td class='key'>Year at Tech</td><td>" . getMemberAttribute('techYear', $person) . "</td></tr>";
    $sql = mysql_query("select `semester`.`semester` from `activeSemester`, `semester` where `activeSemester`.`member` = '{$person}' and `activeSemester`.`semester` = `semester`.`semester` order by `semester`.`beginning` desc");
    $activeSemesters = '';
    while ($row = mysql_fetch_array($sql)) {
        $activeSemesters .= "<span class='label'>" . $row['semester'] . "</span> ";
    }
    if ($officer) {
        $html .= "<tr><td class='key'>Active</td><td>{$activeSemesters}</td></tr>";
        $html .= "</table></td><td style='width: 40%; vertical-align: top'><table>";
        $html .= "<tr><td class='key'>Enrollment</td><td>" . rosterProp($member, "Enrollment") . "</td></tr>";
        if ($uber || hasPosition($USER, "Treasurer")) {
            $html .= "<tr><td class='key'>Balance</td><td>" . rosterProp($member, "Balance") . "</td></tr>";
            $html .= "<tr><td class='key'>Dues</td><td>" . rosterProp($member, "Dues") . "</td></tr>";
            $html .= "<tr><td class='key'>Tie</td><td>" . rosterProp($member, "Tie") . "</td></tr>";
        }
        if ($uber) {
            $html .= "<tr><td class='key'>Gigs</td><td>" . rosterProp($member, "Gigs") . "</td></tr>";
            $html .= "<tr><td class='key'>Score</td><td>" . rosterProp($member, "Score") . "</td></tr>";
            $html .= "<tr><td class='key'>Actions</td><td><button class='btn action' onclick='chgusr(\"{$person}\")'>Log in as</button><button class='btn action' style='color: red' onclick='delusr(\"{$person}\")'>Delete</button></td></tr>";
        }
    }
    $html .= "</table></td></tr></table>";
    return $html;
}