コード例 #1
0
ファイル: multicourse.php プロジェクト: kostastzo/openeclass
            if ($prof_uid) {
                $tool_content .= '<br>' . q($langTeacher) . ': <b>' . q($prof_name) . '</b>';
            } elseif ($prof_not_found) {
                $tool_content .= '<br>' . q($langTeacher) . ': <b>' . q($prof_info) . '</b>: ' . q($langNoUsersFound2);
            }
            $tool_content .= '</div>';
        }
        $line = strtok("\n");
    }
} else {
    $tree = new hierarchy();
    $course = new course();
    $user = new user();
    load_js('jstree');
    $tool_content .= "<div class='alert alert-info'>{$langMultiCourseInfo}</div>\n        <div class='form-wrapper'>\n        <form role='form' class='form-horizontal' method='post' action='" . $_SERVER['SCRIPT_NAME'] . "' onsubmit=\"return validateNodePickerForm();\">\n        <fieldset>\n        <div class='form-group'>\n            <label for='title' class='col-sm-3 control-label'>{$langMultiCourseTitles}:</label>\n            <div class='col-sm-9'>" . text_area('courses', 20, 80, '') . "</div>\n        </div>\n\t<div class='form-group'>\n            <label for='title' class='col-sm-3 control-label'>{$langFaculty}:</label>\t  \n            <div class='col-sm-9'>";
    list($js, $html) = $tree->buildCourseNodePicker(array('allowables' => $user->getDepartmentIds($uid)));
    $head_content .= $js;
    $tool_content .= $html;
    $tool_content .= "</div></div>";
    $tool_content .= "<div class='form-group'><label class='col-sm-offset-4 col-sm-8'>{$langConfidentiality}</label></div>\n        <div class='form-group'>\n            <label for='password' class='col-sm-3 control-label'>{$langOptPassword}</label>\n            <div class='col-sm-9'>\n                <input id='coursepassword' class='form-control' type='text' name='password' id='password' autocomplete='off' />\n            </div>\n        </div>\n        <div class='form-group'>\n        <label for='Public' class='col-sm-3 control-label'>{$langOpenCourse}</label>\n            <div class='col-sm-9 radio'><label><input id='courseopen' type='radio' name='formvisible' value='2' checked> {$langPublic}</label></div>\n            </div>\n        <div class='form-group'>\n            <label for='PrivateOpen' class='col-sm-3 control-label'>{$langRegCourse}</label>\t\n            <div class='col-sm-9 radio'><label><input id='coursewithregistration' type='radio' name='formvisible' value='1'> {$langPrivOpen}</label></div>\n        </div>\n        <div class='form-group'>\n            <label for='PrivateClosed' class='col-sm-3 control-label'>{$langClosedCourse}</label>\n            <div class='col-sm-9 radio'><label><input id='courseclose' type='radio' name='formvisible' value='0'> {$langClosedCourseShort}</label></div>\n       </div>\n        <div class='form-group'>\n             <label for='Inactive' class='col-sm-3 control-label'>{$langInactiveCourse}</label>\n             <div class='col-sm-9 radio'><label><input id='courseinactive' type='radio' name='formvisible' value='3'> {$langCourseInactiveShort}</label></div>\n         </div>\n         <div class='form-group'>\n          <label for='language' class='col-sm-3 control-label'>{$langLanguage}:</label>\t  \n           <div class='col-sm-9'>" . lang_select_options('lang') . "</div>\n         </div>\n         <div class='form-group'>\n            <div class='col-sm-10 col-sm-offset-2'>\n                <input class='btn btn-primary' type='submit' name='submit' value='" . q($langSubmit) . "'>\n                <a href='index.php' class='btn btn-default'>{$langCancel}</a>    \n            </div>\n        </div>\n        </fieldset>\n        </form>\n        </div>";
}
draw($tool_content, 3, null, $head_content);
/**
 * @brief helper function
 * @param type $sql
 * @param type $terms
 * @return boolean
 */
function prof_query($sql, $terms)
{
    $result = Database::get()->querySingle("SELECT id FROM user WHERE status = 1 AND ( {$sql} )", $terms);