Exemple #1
0
function semesterDropdown()
{
    global $SEMESTER;
    return dropdown(semesters(), "semester", $SEMESTER);
}
Exemple #2
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>";