示例#1
0
function active_semesters($memberID)
{
    global $CHOIR;
    if (!$CHOIR) {
        die("Choir is not set");
    }
    $table = "<style>table.semesters { width: auto; } table.semesters td { padding: 2px 10px; } select.section { margin-bottom: 0px; width: 10em; }</style><table class='semesters'><tr><th>Semester</th><th>Status</th><th>Section</th><th>Score</th></tr>";
    $query = mysql_query("select `semester` from `semester` order by `beginning` asc");
    while ($result = mysql_fetch_array($query)) {
        $activebtn = 0;
        $semester = $result['semester'];
        $query1 = mysql_query("select `enrollment` from `activeSemester` where `member` = '{$memberID}' and `semester` = '{$semester}' and `choir` = '{$CHOIR}'");
        $active = mysql_num_rows($query1);
        if ($active) {
            $result1 = mysql_fetch_array($query1);
            $enrollment = $result1['enrollment'];
            if ($enrollment == "club") {
                $activebtn = 1;
            } else {
                if ($enrollment == "class") {
                    $activebtn = 2;
                } else {
                    die("Invalid enrollment state");
                }
            }
        }
        $table .= "<tr data-semester='{$semester}'><td>{$semester}</td><td><div class='btn-group' data-toggle='buttons-radio'>" . "<button class='btn btn-small semesterbutton" . ($activebtn == 0 ? ' active' : '') . "' data-val='0'>Inactive</button>" . "<button class='btn btn-small semesterbutton" . ($activebtn == 1 ? ' active' : '') . "' data-val='1'>Club</button>" . "<button class='btn btn-small semesterbutton" . ($activebtn == 2 ? ' active' : '') . "' data-val='2'>Class</button>" . "</div></td><td>" . dropdown(sections(), "section", $active ? sectionFromEmail($memberID, false, $semester) : 0, !$active) . "</td>" . "<td>" . ($active ? "<span>" : "<span style='color: gray'>") . attendance($memberID, 0, $semester) . "</span></td></tr>";
    }
    $table .= "</table>";
    return $table;
}
示例#2
0
    $content .= "# the Free Software Foundation; either version 2 of the License.\n";
    $content .= "\n";
    $content .= "\$sections_chemin={$sections_chemin};\n";
    $content .= "\$togglesection={$togglesection};\n";
    $content .= "?>";
    fwrite($file, $content);
    fclose($file);
    Header("Location: admin.php?op=sections");
}
// Fonctions Param du menu barre des sections
switch ($op) {
    case "new_rub_section":
        new_rub_section($type);
        break;
    case "sections":
        sections();
        break;
    case "sectionedit":
        sectionedit($secid);
        break;
    case "sectionmake":
        sectionmake($secname, $image, $members, $Mmembers, $rubref, $introd);
        break;
    case "sectiondelete":
        sectiondelete($secid, $ok);
        break;
    case "sectionchange":
        sectionchange($secid, $secname, $image, $members, $Mmembers, $rubref, $introd);
        break;
    case "rubriquedit":
        rubriquedit($rubid);
示例#3
0
echo $choirname;
?>
 this semester?  If not, hit Close and you will still be able to view the site, but you won't be assessed dues or expected at events.  If you are returning, please verify the information below, then hit Confirm to confirm your account.</p>
		<form class="form-horizontal">
		    <div class="control-group">
			<label class="control-label" style='font-weight: bold'>Registration:</label>
			<div class="controls"><div class="btn-group" data-toggle="buttons-radio"><button type="button" class="btn" id="confirm_class">Class</button><button type="button" class="btn" id="confirm_club">Club</button></div></div>
		    </div>
		    <div class="control-group">
			<label class="control-label" style='font-weight: bold'>Location:</label>
			<div class="controls"><input type="text" id="confirm_location"></div>
		    </div>
		    <div class="control-group">
			<label class="control-label" style='font-weight: bold'>Section:</label>
			<div class="controls"><?php 
echo dropdown(sections(), "section");
?>
</div>
		    </div>
		</form></div>
		<div class="modal-footer">
		    <a href="#" class="btn" style="color: inherit" data-dismiss="modal">Close</a>
		    <a href="#" class="btn btn-primary" style="color: inherit" onclick="confirm_account()">Confirm</a>
		</div>
	</div>

	<?php 
if ($userEmail != '') {
    $sql = "select UNIX_TIMESTAMP(semester.end) as end from semester,variables where semester.semester=variables.semester";
    $arr = mysql_fetch_array(mysql_query($sql));
    $semesterEnd = $arr['end'];
示例#4
0
<?php

snippet('header');
?>

  <main class="main" role="main">

    <div class="text">
      <h1><?php 
echo $page->title()->html();
?>
</h1>
      <?php 
echo $page->text()->kirbytext();
?>
    </div>

    <?php 
sections()->render();
?>

  </main>

<?php 
snippet('footer');
示例#5
0
    if ($field == 'calltime') {
        return date("h:i A", $call);
    }
    if ($field == 'donedate') {
        return date("Y-m-d", $done);
    }
    if ($field == 'donetime') {
        return date("h:i A", $done);
    }
    if ($field == 'perftime') {
        return date("h:i A", $perf);
    }
    return '????';
}
// Fear my wrath, for I am lord of the data structures.
$fields = array('general' => array(array('name', 'Event Name', 'text'), array('type', 'Event Type', '.type'), array('calldate', 'Call Date', 'date'), array('calltime', 'Call Time', 'time'), array('donedate', 'Release Date', 'date'), array('donetime', 'Release Time', 'time'), array('location', 'Location', 'text'), array('points', 'Points', 'number'), array('semester', 'Semester', 'select', semesters(), $SEMESTER, false), array('comments', 'Comments', 'textarea'), array('repeat', 'Repeat', 'select', array('no' => 'no', 'daily' => 'daily', 'weekly' => 'weekly', 'biweekly' => 'biweekly', 'monthly' => 'monthly', 'yearly' => 'yearly'), 'no', $eventNo), array('until', 'Repeat Until', 'date')), 'gig' => array(array('uniform', 'Uniform', 'select', uniforms(), '', false), array('perftime', 'Performance Time', 'time'), array('cname', 'Contact Name', 'text'), array('cemail', 'Contact Email', 'text'), array('cphone', 'Contact Phone', 'text'), array('price', 'Price', 'number'), array('gigcount', 'Count Toward Volunteer Gig Requirement', 'bool'), array('public', 'Public Event', 'bool'), array('summary', 'Public Summary', 'textarea'), array('description', 'Public Description', 'textarea')), 'rehearsal' => array(array('section', 'Section', 'select', sections(), '', $eventNo)));
$html = '';
foreach ($fields as $category => $catfields) {
    $html .= "<table id='event_{$category}' class='table no-highlight no-border' style='width: 100%; display: none'><style>select { width: 200px; }</style>";
    foreach ($catfields as $field) {
        $html .= "<tr id='event_row_" . $field[0] . "'><td>" . $field[1] . "</td><td style='text-align: right'>";
        $value = '';
        if ($eventNo) {
            $value = htmlspecialchars(value($field[0]), ENT_QUOTES);
        }
        switch ($field[2]) {
            case 'text':
                $html .= "<input type='text' name='{$field['0']}' value='{$value}' style='width: 200px'>";
                break;
            case 'textarea':
                $html .= "<textarea name='{$field['0']}' style='width: 200px; height: 60px'>{$value}</textarea>";
示例#6
0
</style>
<?php 
$userinfo = array();
if ($USER) {
    $userinfo = mysql_fetch_array(mysql_query("select * from `member` where `email` = '{$USER}'"));
    $query = mysql_query("select `enrollment` from `activeSemester` where `member` = '{$USER}' and `semester` = '{$SEMESTER}'");
    if (mysql_num_rows($query) == 0) {
        $userinfo["registration"] = "inactive";
    } else {
        $res = mysql_fetch_array($query);
        $userinfo["registration"] = $res['enrollment'];
    }
    $query = mysql_fetch_array(mysql_query("select `section` from `activeSemester` where `member` = '{$USER}' and `semester` = '{$SEMESTER}' and choir = '{$CHOIR}'"));
    $userinfo["section"] = $query["section"];
}
$fields = array(array("firstName", "First Name", "text", 1), array("prefName", "Preferred Name", "text", 0), array("lastName", "Last Name", "text", 1), array("section", "Section", "select", 1, $USER ? sections() : array()), array("email", "Email", "text", 1), array("password", "Password", "password", 1), array("password2", "Confirm password", "password", 1), array("phone", "Phone number (digits only)", "text", 1), array("picture", "Picture (URL)", "text", 0), array("registration", "Are you in the class or club?", "radio", 1, array("class" => "Class", "club" => "Club")), array("passengers", "How many passengers (<i>aside from yourself</i>) can ride in your car?  (0 if you don't have a car)", "number", 1), array("onCampus", "Do you live on campus?", "bool", 1), array("location", "Where do you live? (for carpool purposes)", "text", 1), array("about", "About you (public)", "text", 0), array("major", "Your major", "text", 1), array("minor", "Your minor", "text", 0), array("hometown", "Your hometown", "text", 1), array("techYear", "How many years have you been at GT?", "number", 0), array("gChat", "GChat screen name", "text", 0), array("twitter", "Twitter handle", "text", 0), array("gatewayDrug", "How did you hear about this organization?", "text", 0), array("conflicts", "Any conflicts we should know about", "text", 0));
if (!$USER) {
    array_splice($fields, 3, 0, array(array("choir", "Organization (If you are in several, choose one to start and add yourself to the others later)", "select", 1, choirs())));
}
$form = "";
foreach ($fields as $field) {
    $name = $field[0];
    echo "<div class='control-group'><label class='control-label wider" . ($field[3] ? " required" : "") . "' for='" . $name . "'>" . $field[1] . "</label><div class='controls'>";
    if ($field[2] == "text" || $field[2] == "password" || $field[2] == "number" || $field[2] == "date") {
        echo "<input type='" . $field[2] . "' name='" . $name . "'" . ($USER && $field[2] != "password" ? " value='" . $userinfo[$name] . "'" : "") . ">";
    } else {
        if ($field[2] == "bool") {
            echo "<input type='checkbox' name='" . $name . "'" . ($USER && $userinfo[$name] != 0 ? " checked" : "") . ">";
        } else {
            if ($field[2] == "select") {
                echo dropdown($field[4], $name, $USER ? $userinfo[$name] : "");
示例#7
0
<?php

require_once './functions.php';
echo dropdown(sections(mysql_real_escape_string($_POST['choir'])), 'section', $USER ? sectionFromEmail($user) : '');
?>