Exemple #1
0
?>
					</div>
					<div class="chunk">
						<?php 
$callings = $mem->Callings();
echo count($callings) == 1 ? '<b>Calling</b>' : '<b>Callings</b>';
foreach ($callings as $c) {
    echo $c->Name . "<br>";
}
?>
					</div>

					<div class="chunk">
						<b>FHE group</b>
						<?php 
$group = FheGroup::Load($mem->FheGroup);
if ($group) {
    echo $group->GroupName;
}
?>
					</div>

					<div class="chunk">
						<b>Member since</b>
						<?php 
echo date('F Y', strtotime($mem->RegistrationDate()));
?>
					</div>

					<div class="chunk">
						<b>Profile updated</b>
Exemple #2
0
    $id = DB::Safe($_GET['id']);
    // Remove all members from this group which is about to be deleted
    $r = DB::Run("UPDATE Members SET FheGroup=0 WHERE FheGroup={$id}");
    if (!$r) {
        Response::Send(500, "Could not remove members from FHE group: " . mysql_error());
    }
    // Delete the group
    $r = DB::Run("DELETE FROM FheGroups WHERE id={$id} LIMIT 1");
    if (!$r) {
        Response::Send(500, "Members removed from FHE group, but could not delete FHE group because: " . mysql_error());
    } else {
        Response::Send(200);
    }
} elseif ($action == "edit") {
    $id = $_POST['id'];
    $group = FheGroup::Load($id);
    if (!$group) {
        Response::Send(500, "Bad group ID");
    }
    @($name = $_POST['groupname']);
    @($ldr1 = $_POST['ldr1']);
    @($ldr2 = $_POST['ldr2']);
    @($ldr3 = $_POST['ldr3']);
    if (!$name) {
        Response::Send(400, "Please type a group name.");
    }
    // Make sure new leaders are removed from old group leaderships.
    // This next for loop is the exact same as the loop above near the top of this file.
    // TODO: This setup is awful. I want to redo this another time. What if the
    // leadership becomes discombobulated? (e.g. removes a leader1 but keeps leader 2... just looks weird)
    // This is a messy implementation. That's what I get for being in a hurry, I guess.
Exemple #3
0
 public function FheGroup()
 {
     return FheGroup::Load($this->FheGroup);
 }
Exemple #4
0
$r = DB::Run($q);
while ($row = mysql_fetch_array($r)) {
    array_push($mems, Member::Load($row['ID']));
}
// Build list of options
$memList = "";
foreach ($mems as $mem) {
    $memList .= "\r\n<option value=\"{$mem->ID()}\">" . $mem->FirstName() . " " . $mem->LastName . "</option>";
}
$memList .= "\r\n";
// Get a list of FHE groups
$groups = array();
$q2 = "SELECT ID FROM FheGroups WHERE WardID={$MEMBER->WardID} ORDER BY GroupName ASC";
$r2 = DB::Run($q2);
while ($row = mysql_fetch_array($r2)) {
    array_push($groups, FheGroup::Load($row['ID']));
}
?>
<!DOCTYPE html>
<html>
	<head>
		<title>Manage FHE groups &mdash; <?php 
echo $WARD ? $WARD->Name . " Ward" : SITE_NAME;
?>
</title>
		<?php 
include "../includes/head.php";
?>
		<style>
		.no-group {
			background-color: #FFFFAA !important;