/**
 * @param array $selected_column_indexes
 * @return array
 */
function get_admin_users_list_fieldname_options($selected_column_indexes)
{
    $fieldNames = get_admin_users_list_fieldnames();
    $list = array();
    foreach ($fieldNames as $i => $field) {
        $list[$i]['name'] = $field->title;
        $list[$i]['val'] = '' . $i;
    }
    return option_list($list, $selected_column_indexes);
}
Exemplo n.º 2
0
/**
 * @return array
 */
function get_resources_list_fieldname_options()
{
    $fieldNames = get_resources_list_fieldnames();
    $list = array();
    foreach ($fieldNames as $i => $field) {
        $list[$i]['name'] = $field->title;
        $list[$i]['val'] = '' . $i;
    }
    return option_list($list, get_resources_list_default_column_indexes());
}
Exemplo n.º 3
0
    foreach ($result['resources_utest_pre'] as $resource) {
        $selectorDefaults[] = $resource['val'];
    }
    $selectorOptions = option_list($selectorValues, $selectorDefaults);
    $selectorString = "<select class=\"groupResourcesUTestPreSelector\" name=\"groupResourcesUTestPre{$result['groupid']}\" id=\"groupResourcesUTestPre{$result['groupid']}\" data-groupid=\"{$result['groupid']}\" data-stage=\"1\" multiple='multiple' >";
    foreach ($selectorOptions as $option) {
        $selectorString .= $option;
    }
    $selectorString .= "</select>";
    $data[$i][4] = $selectorString;
    $i++;
}
$i = 0;
foreach ($results as $result) {
    $selectorDefaults = array();
    foreach ($result['resources_utest_post'] as $resource) {
        $selectorDefaults[] = $resource['val'];
    }
    $selectorOptions = option_list($selectorValues, $selectorDefaults);
    $selectorString = "<select class=\"groupResourcesUTestPostSelector\" name=\"groupResourcesUTestPost{$result['groupid']}\" id=\"groupResourcesUTestPost{$result['groupid']}\" data-groupid=\"{$result['groupid']}\" data-stage=\"2\" multiple='multiple' >";
    foreach ($selectorOptions as $option) {
        $selectorString .= $option;
    }
    $selectorString .= "</select>";
    $data[$i][5] = $selectorString;
    $i++;
}
$dataSet = (object) array('tableDataSet' => (object) array('data' => $data, 'columns' => get_user_groups_list_fieldnames()));
$link = null;
header('Content-Type: application/json');
echo json_encode($dataSet);
Exemplo n.º 4
0
function print_data_input_formular($action, $classes, $lastpage)
{
    if ($action == "") {
        $action = $_SERVER['PHP_SELF'];
    }
    $given_name = "";
    $last_name = "";
    $birth_day = "_";
    $birth_month = "-";
    $birth_year = "-";
    $class = "";
    $autocorrection_on = " checked ";
    $autocorrection_off = "";
    $alter = "";
    if (isset($_SESSION["given_name"])) {
        $given_name = $_SESSION["given_name"];
    }
    if (isset($_SESSION["last_name"])) {
        $last_name = $_SESSION["last_name"];
    }
    if (isset($_SESSION["birth_day"])) {
        $birth_day = $_SESSION["birth_day"];
    }
    if (isset($_SESSION["birth_month"])) {
        $birth_month = $_SESSION["birth_month"];
    }
    if (isset($_SESSION["birth_year"])) {
        $birth_year = $_SESSION["birth_year"];
    }
    if (isset($_SESSION["class"])) {
        $class = $_SESSION["class"];
    }
    if (isset($_SESSION["autocorrection"])) {
        if ($_SESSION["autocorrection"] == false) {
            $autocorrection_on = "";
            $autocorrection_off = " checked ";
        }
    }
    if (isset($_SESSION["alter"])) {
        if ($_SESSION["alter"] > 0) {
            $alter = "<tr><td>Alter:</td><td>" . $_SESSION["alter"] . " Jahre</td></tr>";
        }
    }
    echo "\n\t\t\n\t\t<table>\n\t\t\t<form action='{$action}' method='post'>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>Vorname:</td>\n\t\t\t\t\t<td><input type='text' name='given_name' value='{$given_name}' size='40' autocomplete='off'" . form_error_css($_SESSION["given_name_errno"]) . "></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>Nachname:</td>\n\t\t\t\t\t<td><input type='text' name='last_name' value='{$last_name}' size='40' autocomplete='off'" . form_error_css($_SESSION["last_name_errno"]) . "></td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>Geburtsdatum: (Tag.Monat.Jahr)</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select name='birth_day' size='1'  autocomplete='off'" . form_error_css($_SESSION["birth_day_errno"]) . ">\n\t\t\t\t\t\t\t" . option_list(1, 31, $birth_day) . "\n\t\t\t\t\t\t</select>.\n\t\t\t\t\t\t<select name='birth_month' size='1' autocomplete='off'" . form_error_css($_SESSION["birth_month_errno"]) . ">\n\t\t\t\t\t\t\t" . option_list(1, 12, $birth_month) . "\n\t\t\t\t\t\t</select>.\n\t\t\t\t\t\t<select name='birth_year' size='1' autocomplete='off'" . form_error_css($_SESSION["birth_year_errno"]) . ">\n\t\t\t\t\t\t\t" . option_list(1910, 2010, $birth_year) . "\n\t\t\t\t\t\t</select>\t\t\t\t\t\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>Klasse</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<select name='class' size='1' " . form_error_css($_SESSION["class_errno"]) . ">\n\t\t\t\t\t\t\t<option value='-'>-</option>\n\t\t\t\t\t\t\t" . option_list_from_array($classes, $class) . "\n\t\t\t\t\t\t</select>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>Autokorrektur:</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\t<input type='radio' name='autocorrection' value='on' {$autocorrection_on} >an<br>\n\t\t\t\t\t\t<input type='radio' name='autocorrection' value='off' {$autocorrection_off} >aus\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t{$alter}\n\t\t\t\t<tr>\n\t\t\t\t\t<td><input type='submit' name='back' value='zurück'></td>\n\t\t\t\t\t<td><input type='submit' name='button_check_data' value='Weiter'></td>\n\t\t\t\t</tr>\n\t\t\t</form>\n\t\t</table>\n\t\t";
    //print_data_input_formular($_SERVER['PHP_SELF'],$classes.$lastpage);
    //		print_button($lastpage, "data_input", "zurück");
}
Exemplo n.º 5
0
/**
 * @param string $str
 * @param string $edit
 * @param \PDO $link
 * @return bool|null
 */
function change_selector($str, $edit, $link)
{
    if (change($edit, $link)) {
        return true;
    }
    switch ($edit) {
        case "input_language":
            $options = get_interface_languages_list($link);
            break;
        case "interface_language":
            $options = get_interface_languages_list($link);
            break;
        case "studies_type":
            $options = eval(STUDIES_TYPES_LIST);
            break;
        case "studies_level":
            $options = eval(STUDIES_LEVELS_LIST);
            break;
        default:
            return null;
    }
    $edit_options = option_list($options, $_SESSION['user_array'][$edit]);
    echo "<form method=\"POST\" id=\"editForm\">" . $str . ": <select name=\"{$edit}\">";
    foreach ($edit_options as $option) {
        echo $option;
    }
    echo "</select>";
    echo "<input type=\"hidden\" name=\"edit\" value=\"" . $edit . "\">" . PHP_EOL;
    echo "<input type=\"hidden\" name=\"user\" value=\"" . $_SESSION['user_array']['user'] . "\">" . PHP_EOL;
    echo "<input type=\"checkbox\" name=\"h" . $edit . "\" value=\"true\"";
    if (ord($_SESSION['user_array']['h' . $edit])) {
        echo " checked=\"checked\" ";
    }
    echo '/> ' . PR_HIDE;
    echo "[<a href=\"#\" onclick=\"javascript:document.getElementById('editForm').submit();return false;\">" . PR_SEND . "</a>]<br /></form>";
    return false;
}