コード例 #1
0
ファイル: edit.php プロジェクト: khanhnnvn/OKMS
		</tr>
		<tr>
			<td><label for="mail">Email:</label></td>
			<td><?php 
print $old_mail;
?>
<input type="hidden" name="mail" value="<?php 
print $old_mail;
?>
" /></td>
		</tr>
		<tr>
			<td><label for="rid">Role:</label></td>
			<td><?php 
if (isset($_SESSION['rid']) && $_SESSION['rid'] == 1) {
    print select_role('rid', $old_rid);
} elseif (isset($_SESSION['rid']) && $_SESSION['rid'] != 1) {
    print load_name_from_rid($old_rid);
}
?>
</td>
		</tr>
		<tr>
			<td>Belonged courses:</td>
			<td><?php 
print view_user_courses($uid);
?>
</td>
		</tr>
		<tr>
			<td><input onclick="checkPass();" type="submit" name="submit" value="Save" /></td>
コード例 #2
0
ファイル: create.php プロジェクト: khanhnnvn/OKMS
			<td><label for="fullname">Fullname:</label></td>
			<td><input type="text" name="fullname" size="60" maxlength="128" class="required" /></td>
		</tr>
		<tr>
			<td><label for="pass">Password:</label></td>
			<td><input type="password" name="pass" size="60" maxlength="128" class="required" /></td>
		</tr>
		<tr>
			<td><label for="pass1">Retype Password:</label></td>
			<td><input type="password" name="pass1" size="60" maxlength="128" class="required" /></td>
		</tr>
		<tr>
			<td><label for="rid">Role:</label></td>
			<td><?php 
if ($_SESSION['rid'] == 1) {
    print select_role('rid');
} else {
    print radio_role('role');
    ?>
<input id="rid" type="hidden" name="rid" /><?php 
}
?>
</td>
		</tr>
		<tr>
			<td><input type="submit" name="submit" value="Submit" /></td>
			<td><input type="reset" value="Reset" /></td>
		</tr>
	</table>
</form>
<?php 
コード例 #3
0
    $f_person = $_GET['person'];
    $title = "Rediger lenke";
    $form = 'linkage_edit';
    $focus = 'text';
    require "./form_header.php";
    echo "<h2>Rediger lenke {$id}</h2>\n";
    echo '<p>' . fetch_val("SELECT source_text FROM sources WHERE source_id={$node}") . "</p>\n";
    $row = fetch_row_assoc("SELECT * FROM source_linkage WHERE source_fk={$node} AND per_id={$id}");
    $person = $row['person_fk'] ? $row['person_fk'] : 0;
    form_begin($form, $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('node', $node);
    hidden_input('per_id', $id);
    hidden_input('f_person', $f_person);
    // role_fk
    select_role($row['role_fk']);
    person_id_input($person, 'person_fk', 'Person: ');
    select_surety($row['surety_fk']);
    text_input("Navn i kilden: ", 100, 's_name', $row['s_name']);
    textarea_input("Note: ", 5, 100, 'sl_note', $row['sl_note']);
    form_submit();
    form_end();
    echo "<h3>Personer nevnt i kilden:</h3>\n";
    list_mentioned($node, 0);
    echo "</body>\n</html>\n";
} else {
    $node = $_POST['node'];
    $note = rtrim($_POST['sl_note']);
    $f_person = $_POST['f_person'];
    pg_prepare("query", "UPDATE\n            source_linkage\n        SET\n            role_fk = \$1,\n            person_fk = \$2,\n            surety_fk = \$3,\n            s_name = \$4,\n            sl_note = \$5\n        WHERE\n            source_fk = \$6\n        AND\n            per_id = \$7\n    ");
    pg_execute("query", array($_POST['role_id'], $_POST['person_fk'] ? $_POST['person_fk'] : NULL, $_POST['surety'], $_POST['s_name'], $note, $node, $_POST['per_id']));
コード例 #4
0
if (!isset($_POST['posted'])) {
    $node = $_GET['node'];
    $title = "Lag lenke";
    $form = 'linkage_add';
    $focus = 'text';
    $per_id = fetch_val("SELECT COUNT(*) + 1 FROM source_linkage WHERE source_fk={$node}");
    require "./form_header.php";
    echo "<h2>Lag lenke</h2>\n";
    echo '<p>' . fetch_val("SELECT source_text FROM sources WHERE source_id={$node}") . "</p>\n";
    form_begin($form, $_SERVER['PHP_SELF']);
    hidden_input('posted', 1);
    hidden_input('node', $node);
    // per_id
    text_input("Lnr.: ", 10, 'per_id', $per_id);
    // role_fk
    select_role();
    person_id_input(0, 'person_id', 'Person:');
    select_surety();
    text_input("Navn i kilden: ", 100, 's_name');
    textarea_input("Note: ", 5, 100, 'sl_note');
    form_submit();
    form_end();
    echo "<h3>Personer nevnt i kilden:</h3>\n";
    list_mentioned($node, 0);
    echo "</body>\n</html>\n";
} else {
    $node = $_POST['node'];
    $note = rtrim($_POST['sl_note']);
    pg_prepare("query", "INSERT INTO\n            source_linkage(\n                source_fk,\n                per_id,\n                role_fk,\n                person_fk,\n                surety_fk,\n                s_name,\n                sl_note\n            )\n        VALUES (\$1, \$2, \$3, \$4, \$5, \$6, \$7)");
    pg_execute("query", array($node, $_POST['per_id'], $_POST['role_id'], $_POST['person_id'] ? $_POST['person_id'] : NULL, $_POST['surety'], $_POST['s_name'], $note));
    // return to parent node
コード例 #5
0
ファイル: index.php プロジェクト: khanhnnvn/OKMS
<div style="float: right" id="search_bar">
	<form action="" method="POST">
		<input id="search_user_box" type="text" name="keyword" title="Fill in your search query" size="20" placeholder="Search user.." />
	</form>
	<div style="display: none;" id="search_user_suggestion"></div>
</div>
<script type="text/javascript">
function searchUserSuggestion() {
	if ($("input#search_user_box").val() != '') {
		$("#search_user_suggestion").delay(200).load("triggers/search_user.php",{keyword:$("input#search_user_box").val()}).slideDown();
	} else {
		$("#search_user_suggestion").css("display","none");
	}
}
$("input#search_user_box").keyup(searchUserSuggestion).change(searchUserSuggestion);
if ($("input#search_user_box").val() == '') {
	$("#search_user_suggestion").css("display","none");
}
</script>
<?php 
$rid = isset($_POST['rid']) ? $_POST['rid'] : 0;
print select_role('rid', $rid);
print '<div id="admin_user_section">';
print list_users($rid, 10, 1);
print '</div>';
?>
<script type="text/javascript">
$("select#rid").change(function(){
	$("#admin_user_section").load("triggers/admin_user.php",{rid:$(this).val(),count:10,page:1});
});
</script>