本文整理汇总了PHP中draw_header函数的典型用法代码示例。如果您正苦于以下问题:PHP draw_header函数的具体用法?PHP draw_header怎么用?PHP draw_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了draw_header函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: redirect_visitor
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
// get a list of documents the user has "view" permission for
// get current user's information-->department
$user_obj = new User($_SESSION['uid'], $pdo);
if (!$user_obj->isRoot()) {
header('Location:error.php?ec=24');
}
$flag = 0;
if (isset($_GET['submit']) && $_GET['submit'] == 'view_checkedout') {
echo PHP_EOL . '<form name="table" action="file_ops.php" method="POST">';
echo PHP_EOL . '<input name="submit" type="hidden" value="Clear Status">';
draw_header(msg('label_checked_out_files'), $last_message);
$file_id_array = $user_obj->getCheckedOutFiles();
$page_url = 'file_ops.php?';
$user_perm_obj = new UserPermission($_SESSION['uid'], $pdo);
$list_status = list_files($file_id_array, $user_perm_obj, $GLOBALS['CONFIG']['dataDir'], true, true);
if ($list_status != -1) {
echo PHP_EOL . '<BR><div class="buttons"><button class="positive" type="submit" name="submit" value="Clear Status">' . msg('button_clear_status') . '</button></div><br />';
echo PHP_EOL . '</form>';
}
draw_footer();
} elseif (isset($_POST['submit']) && $_POST['submit'] == 'Clear Status') {
if (isset($_POST["checkbox"])) {
foreach ($_POST['checkbox'] as $cbox) {
$file_id = $cbox;
$file_obj = new FileData($file_id, $pdo);
$file_obj->setStatus(0);
示例2: isset
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
$user_obj = new User($_SESSION['uid'], $pdo);
$settings = new Settings($pdo);
//If the user is not an admin and he/she is trying to access other account that
// is not his, error out.
if (!$user_obj->isRoot() == true) {
header('Location: error.php?ec=24');
exit;
}
if (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'update') {
draw_header(msg('label_settings'), $last_message);
$settings->edit();
draw_footer();
} elseif (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'Save') {
draw_header(msg('label_settings'), $last_message);
// Clean up the datadir a bit to make sure it ends with slash
if (!empty($_POST['dataDir'])) {
if (substr($_POST['dataDir'], -1) != '/') {
$_POST['dataDir'] .= '/';
}
}
// Perform Input Validation
if (!is_dir($_POST['dataDir'])) {
$_POST['last_message'] = $GLOBALS['lang']['message_datadir_problem_exists'];
} elseif (!is_writable($_POST['dataDir'])) {
$_POST['last_message'] = $GLOBALS['lang']['message_datadir_problem_writable'];
} elseif (!is_numeric($_POST['max_filesize']) || (!is_numeric($_POST['revision_expiration']) || !is_numeric($_POST['max_query']))) {
$_POST['last_message'] = $GLOBALS['lang']['message_config_value_problem'];
} elseif ($settings->save($_POST)) {
$_POST['last_message'] = $GLOBALS['lang']['message_all_actions_successfull'];
示例3: draw_footer
?>
</button>
</div>
</td>
</tr>
</table>
</form>
<script>
$(document).ready(function(){
$('#modifyDeptForm').validate();
});
</script>
<?php
draw_footer();
} elseif (isset($_REQUEST['submit']) && $_REQUEST['submit'] == 'updatepick') {
draw_header(msg('area_choose_department'), $last_message);
?>
<form action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="GET" enctype="multipart/form-data">
<INPUT type="hidden" name="state" value="<?php
echo $_REQUEST['state'] + 1;
?>
">
<table border="0" cellspacing="5" cellpadding="5">
<tr>
<td><b><?php
echo msg('label_department_to_modify');
?>
:</b></td>
示例4: mysql_query
// includes
// open connection
if (!isset($_POST['submit'])) {
// form not yet submitted, display initial form
// pre-fill the form with some information so that user knows which file is being updated
$query = "SELECT description, realname FROM {$GLOBALS['CONFIG']['db_prefix']}data WHERE id = '{$_REQUEST['id']}' AND status = '{$_SESSION['uid']}'";
$result = mysql_query($query, $GLOBALS['connection']) or die("Error in query: {$query}. " . mysql_error());
// in case script is directly accessed, query above will return 0 rows
if (mysql_num_rows($result) <= 0) {
$last_message = 'Failed';
header('Location:error.php?ec=2&last_message=' . urlencode($last_message));
exit;
} else {
// get result data
list($description, $realname) = mysql_fetch_row($result);
draw_header(msg('button_check_in'), $last_message);
// correction
if ($description == '') {
$description = msg('message_no_description_available');
}
// clean up
mysql_free_result($result);
// start displaying form
?>
<table border="0" cellspacing="5" cellpadding="5">
<form action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="POST" enctype="multipart/form-data">
<input type="hidden" name="id" value="<?php
echo $_GET['id'];
示例5: max
$stmt->execute(array(':newvalue' => $_REQUEST['newvalue'], ':primary_type' => $_REQUEST['primary_type']));
}
}
// Do Deletes
$query = "\n SELECT\n max(id)\n FROM\n {$udf_table_name}\n ";
$stmt = $pdo->prepare($query);
$stmt->execute();
$result = $stmt->fetchColumn();
$max = $result;
while ($max > 0) {
if (isset($_REQUEST['x' . $max]) && $_REQUEST['x' . $max] == "on") {
$query = "\n DELETE FROM\n {$GLOBALS['CONFIG']['db_prefix']}udftbl_{$field_name}{$tablename}\n WHERE\n id = {$max}\n ";
$stmt = $pdo->prepare($query);
$stmt->execute();
}
$max--;
}
$query = "\n SELECT\n *\n FROM\n {$_REQUEST['udf']}\n ";
$stmt = $pdo->prepare($query);
$stmt->execute();
$rows2 = $stmt->fetchAll();
$GLOBALS['smarty']->assign('udf', $_REQUEST['udf']);
$GLOBALS['smarty']->assign('display_name', $display_name);
$GLOBALS['smarty']->assign('rows', $rows2);
display_smarty_template('udf/edit_type_4.tpl');
}
draw_footer();
} else {
draw_header(msg('label_user_defined_field'), $last_message);
draw_footer();
}
示例6: or
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// includes
include 'odm-load.php';
session_start();
$last_message = isset($_REQUEST['last_message']) ? htmlspecialchars($_REQUEST['last_message']) : '';
draw_header(msg('error'), $last_message);
if (isset($_REQUEST['ec']) && intval($_REQUEST['ec']) >= 0) {
switch ($_REQUEST['ec']) {
// login failure
case 0:
$message = msg('message_there_was_an_error_loggin_you_in');
break;
// session problem
// session problem
case 1:
$message = msg('message_session_error');
break;
// malformed variable/failed query
// malformed variable/failed query
case 2:
$message = msg('message_error_performing_action');
示例7: header
if (!isset($_REQUEST['id']) || $_REQUEST['id'] == '') {
header('Location:error.php?ec=2');
exit;
}
/* if the user has read-only authority on the file, his check out
will be the same as the person with admin or modify right except that the DB will not have any recored of him checking out this file. Therefore, he will not be able to check-in the file on
the server
*/
$fileobj = new FileData($_GET['id'], $GLOBALS['connection'], DB_NAME);
$fileobj->setId($_GET['id']);
if ($fileobj->getError() != NULL || $fileobj->getStatus() > 0 || $fileobj->isArchived()) {
header('Location:error.php?ec=2');
exit;
}
if (!isset($_GET['submit'])) {
draw_header(msg('area_check_out_file'), $last_message);
// form not yet submitted
// display information on how to initiate download
checkUserPermission($_REQUEST['id'], $fileobj->WRITE_RIGHT, $fileobj);
?>
<p>
<form action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="get">
<input type="hidden" name="id" value="<?php
echo $_GET['id'];
?>
示例8: session_start
// check for session and $_REQUEST['id']
session_start();
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
redirect_visitor();
}
include 'udf_functions.php';
// open a connection to the database
$user_obj = new User($_SESSION['uid'], $pdo);
// Check to see if user is admin
if (!$user_obj->isAdmin()) {
header('Location:error.php?ec=4');
exit;
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
draw_header(msg('accesslogpage_access_log'), $last_message);
$query = "SELECT \n a.*,\n d.realname,\n u.username\n FROM \n {$GLOBALS['CONFIG']['db_prefix']}access_log a\n INNER JOIN \n {$GLOBALS['CONFIG']['db_prefix']}data AS d ON a.file_id = d.id\n INNER JOIN \n {$GLOBALS['CONFIG']['db_prefix']}user AS u ON a.user_id = u.id\n ";
$stmt = $pdo->prepare($query);
$stmt->execute();
$result = $stmt->fetchAll();
$actions_array = array("A" => msg('accesslogpage_file_added'), "B" => msg('accesslogpage_reserved'), "C" => msg('accesslogpage_reserved'), "V" => msg('accesslogpage_file_viewed'), "D" => msg('accesslogpage_file_downloaded'), "M" => msg('accesslogpage_file_modified'), "I" => msg('accesslogpage_file_checked_in'), "O" => msg('accesslogpage_file_checked_out'), "X" => msg('accesslogpage_file_deleted'), "Y" => msg('accesslogpage_file_authorized'), "R" => msg('accesslogpage_file_rejected'));
$accesslog_array = array();
foreach ($result as $row) {
$details_link = 'details.php?id=' . $row['file_id'] . '&state=' . ($_REQUEST['state'] + 1);
$accesslog_array[] = array('user_id' => $row['user_id'], 'file_id' => $row['file_id'], 'user_name' => $row['username'], 'realname' => $row['realname'], 'action' => $actions_array[$row['action']], 'details_link' => $details_link, 'timestamp' => $row['timestamp']);
}
$view->setData(['accesslog_array' => $accesslog_array, 'showCheckBox' => false, 'form' => 0]);
$view->setView('access_log');
$view->setLayout('default');
echo $view->__invoke();
draw_footer();
示例9: draw_header
draw_header(msg('message_documents_waiting'), $last_message);
$userpermission = new UserPermission($_SESSION['uid'], $pdo);
if ($user_obj->isAdmin()) {
$id_array = $user_obj->getAllRevieweeIds();
} else {
$id_array = $user_obj->getRevieweeIds();
}
$list_status = list_files($id_array, $userpermission, $GLOBALS['CONFIG']['dataDir'], true);
if ($list_status != -1) {
display_smarty_template('toBePublished.tpl');
}
} elseif (isset($_REQUEST['submit']) && ($_REQUEST['submit'] == 'commentAuthorize' || $_REQUEST['submit'] == 'commentReject')) {
if (!isset($_REQUEST['checkbox'])) {
header('Location: ' . $_SERVER['PHP_SELF'] . '?last_message=' . urlencode(msg('message_you_did_not_enter_value')));
}
draw_header(msg('label_comment'), $last_message);
$checkbox = isset($_REQUEST['checkbox']) ? $_REQUEST['checkbox'] : '';
/* if($mode == 'reviewer')
{
$access_mode = 'enabled';
}
else
{
$access_mode = 'disabled';
}
*/
if ($_REQUEST['submit'] == 'commentReject') {
$submit_value = 'Reject';
} elseif ($_REQUEST['submit'] == 'commentAuthorize') {
$submit_value = 'Authorize';
示例10: User_Perms
$user_perms_obj = new User_Perms($_SESSION['uid'], $pdo);
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
if (!isset($_REQUEST['id']) || $_REQUEST['id'] == '') {
header('Location:error.php?ec=2');
exit;
}
if (strchr($_REQUEST['id'], '_')) {
header('Location:error.php?ec=20');
}
$filedata = new FileData($_REQUEST['id'], $pdo);
if ($filedata->isArchived()) {
header('Location:error.php?ec=21');
}
// form not yet submitted, display initial form
if (!isset($_REQUEST['submit'])) {
draw_header(msg('area_update_file'), $last_message);
checkUserPermission($_REQUEST['id'], $filedata->ADMIN_RIGHT, $filedata);
$current_user_dept = $user_perms_obj->user_obj->getDeptId();
$data_id = $_REQUEST['id'];
// includes
$department_query = "SELECT department FROM {$GLOBALS['CONFIG']['db_prefix']}user WHERE id=:user_id";
$department_stmt = $pdo->prepare($department_query);
$department_stmt->bindParam(':user_id', $_SESSION['uid']);
$department_stmt->execute();
$result = $department_stmt->fetchAll();
if ($department_stmt->rowCount() != 1) {
header('Location:error.php?ec=14');
exit;
//non-unique error
}
$filedata = new FileData($data_id, $pdo);
示例11: redirect_visitor
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
redirect_visitor();
}
include 'udf_functions.php';
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
/*$_GET['where']='department';
$_GET['keyword']='Information Systems';
$_SESSION['uid']=102;
$_GET['submit']='submit';
$_GET['exact_phrase']='on';
$_GET['case_sensitivity']='';
*/
/// includes
$start_time = time();
draw_header(msg('search'), $last_message);
echo '<body bgcolor="white">';
if (!isset($_GET['submit'])) {
?>
<p>
<table border="0" cellspacing="5" cellpadding="5">
<form action=<?php
echo $_SERVER['PHP_SELF'];
?>
method="get">
<tr>
<td valign="top"><b><?php
echo msg('label_search_term');
?>
示例12: session_start
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
// check to ensure valid session, else redirect
session_start();
//$_SESSION['uid']=102; $sort_by = 'author';
//$start_time = time();
// includes
$GLOBALS['state'] = 1;
require_once 'odm-load.php';
if (!isset($_SESSION['uid'])) {
redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
draw_header(msg('label_file_listing'), $last_message);
sort_browser();
$user_obj = new User($_SESSION['uid'], $pdo);
if ($user_obj->isAdmin()) {
$reviewIdCount = sizeof($user_obj->getAllRevieweeIds());
} elseif ($user_obj->isReviewer()) {
$reviewIdCount = sizeof($user_obj->getRevieweeIds());
} else {
$reviewIdCount = 0;
}
if ($reviewIdCount > 0) {
echo '<img src="images/exclamation.gif" /> <a href="toBePublished.php?state=1">' . msg('message_documents_waiting') . '</a>: ' . e::h($reviewIdCount) . '</a><br />';
}
$rejected_files_obj = $user_obj->getRejectedFileIds();
if (isset($rejected_files_obj[0]) && $rejected_files_obj[0] != null) {
echo '<img src="images/exclamation_red.gif" /> <a href="rejects.php?state=1">' . msg('message_documents_rejected') . '</a>: ' . sizeof($rejected_files_obj) . '<br />';
示例13: header
header('Location:error.php?ec=2');
ob_end_flush();
// Flush buffer onto screens
ob_end_clean();
// Clean up buffer
exit;
} else {
// all checks completed
/* to avoid problems with some browsers,
download script should not include parameters on the URL
so let's use a form and pass the parameters via POST
*/
// form not yet submitted
// display information on how to initiate download
if (!isset($submit)) {
draw_header('Add New User', $last_message);
?>
<p>
<form action="<?php
echo $_SERVER['PHP_SELF'];
?>
" method="post">
<input type="hidden" name="id" value="<?php
echo $_POST['id'];
?>
">
<input type="submit" name="submit" value="Click here"> to begin downloading the selected document to your local workstation.
</form>
Once the document has completed downloading, you may <a href="out.php">continue browsing</a>.
<?php
示例14: session_start
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
session_start();
include 'odm-load.php';
if (!isset($_SESSION['uid'])) {
redirect_visitor();
}
$last_message = isset($_REQUEST['last_message']) ? $_REQUEST['last_message'] : '';
draw_header(msg('area_personal_profile'), $last_message);
?>
<html>
<br><br>
<INPUT type="hidden" name="callee" value="profile.php">
<table name="list" align="center" border="0">
<tr><td><a href="user.php?submit=Modify+User&item=<?php
echo $_SESSION['uid'];
?>
"><?php
echo msg('profilepage_update_profile');
?>
</a></td></tr>
</table>
<?php
示例15: VALUES
$query = "DELETE FROM {$GLOBALS['CONFIG']['db_prefix']}dept_reviewer WHERE user_id = :user_id";
$stmt = $pdo->prepare($query);
$stmt->execute(array(':user_id' => $_POST['id']));
if (isset($_REQUEST['department_review'])) {
for ($i = 0; $i < sizeof($_REQUEST['department_review']); $i++) {
$query = "INSERT INTO {$GLOBALS['CONFIG']['db_prefix']}dept_reviewer (dept_id,user_id) VALUES(:dept_id, :user_id)";
$stmt = $pdo->prepare($query);
$stmt->execute(array(':dept_id' => $_REQUEST['department_review'][$i], ':user_id' => $_POST['id']));
}
}
}
// back to main page
$last_message = urlencode(msg('message_user_successfully_updated'));
header('Location: out.php?last_message=' . $last_message);
} elseif (isset($_REQUEST['submit']) and $_REQUEST['submit'] == 'updatepick') {
draw_header(msg('userpage_modify_user'), $last_message);
// Check to see if user is admin
$query = "SELECT admin FROM {$GLOBALS['CONFIG']['db_prefix']}admin WHERE id = :uid and admin = '1'";
$stmt = $pdo->prepare($query);
$stmt->execute(array(':uid' => $_SESSION['uid']));
if ($stmt->rowCount() <= 0) {
header('Location: error.php?ec=4');
exit;
}
$query = "SELECT id, username, first_name, last_name FROM {$GLOBALS['CONFIG']['db_prefix']}user ORDER BY last_name";
$stmt = $pdo->prepare($query);
$stmt->execute();
$users = $stmt->fetchAll();
$GLOBALS['smarty']->assign('state', (int) $_REQUEST['state'] + 1);
$GLOBALS['smarty']->assign('users', $users);
display_smarty_template('user/edit_pick.tpl');