本文整理汇总了PHP中display_success函数的典型用法代码示例。如果您正苦于以下问题:PHP display_success函数的具体用法?PHP display_success怎么用?PHP display_success使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了display_success函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: try_add_user
function try_add_user($login, $pass, $pass2, $realname, $session, $is_admin, $antispam)
{
$return_val = false;
// Help prevent robot registrations
if (!check_antispam($antispam)) {
display_error("Invalid security code");
} else {
if ($session != md5(session_id() . $_SERVER['REMOTE_ADDR'])) {
display_error("Invalid session.");
} else {
if ($pass != $pass2) {
display_warning("Password mismatch");
} else {
if ($realname == '' || $pass == '' || $pass2 == '' || $login == '') {
display_warning("Please fill out all fields");
} else {
if (get_user_id($login) > 0) {
display_error("The user <strong>{$login}</strong> already exists.");
} else {
add_user($login, $realname, $pass, $is_admin);
$return_val = display_success("<strong>{$login}</strong> has been successfully created");
}
}
}
}
}
return $return_val;
}
示例2: parse_messages
function parse_messages()
{
if (isset($_GET['success']) && $_GET['success']) {
display_success($_GET['success'], true);
}
if (isset($_GET['errors']) && $_GET['errors']) {
display_errors(explode($_GET['errors']));
}
}
示例3: apply_settings
function apply_settings($password, $password2, $realname)
{
global $LSP_URL;
if ($password != $password2) {
display_error('Password mismatch');
return false;
} else {
change_user(SESSION(), $realname, $password);
display_success('Account settings have been updated', array('<a href="">User Settings</a>', 'Success'), $LSP_URL . "?account=settings");
return true;
}
}
示例4: delete_record
if (isset($_GET['delete'])) {
$id = $_GET['delete'];
//sementara delete data tanpa cek ke table lain karna ini cek ke tabel transaksi
//CEK DATA IN other table BEFORE DELETE
// $cek_exist = count_data(TB_PREF."items", 'id', "id_brand='".$id."'");
// if ($cek_exist[0]>0) {
// display_error("Data ini masih digunakan... "
// . "| <a href='?".$parameter_key."kd_tabel=tb_stores' />Close</a>");
// }
// else{
$table = TB_PREF . "stores";
$field_key = "id";
$field_val = "'" . $id . "'";
$query = delete_record($table, $field_key, $field_val);
if ($query) {
display_success("Data berhasil dihapus " . "| <a href='?" . $parameter_key . "kd_tabel=tb_stores' />Close</a>");
} else {
display_error("Gagal menghapus data <br>" . "(" . mysql_error() . ") | <a href='?" . $parameter_key . "kd_tabel=tb_stores' />Close</a>");
}
// }
}
//-------------------------------FORM-----------------------------------------
start_form();
//form input
if (isset($_POST['AddNew'])) {
start_table("class='form'");
text_field('Store Name: ', 'store_name', $val_selected['store_name'], true);
text_area('Description: ', 'description', $val_selected['description']);
text_field('Address: ', 'address', $val_selected['address'], false);
text_field('Contact: ', 'contact', $val_selected['contact'], false);
text_with_list_users("Person: ", "person_id", $val_selected['person_id'], false, true, "-", "level='" . USER_STORE . "'");
示例5: switch
}
if ($ERROR) {
$STEP = 1;
}
break;
case 1:
default:
continue;
break;
}
if ((int) $evaluation_record["max_submittable"] === 0 || $completed_attempts < $evaluation_record["max_submittable"]) {
// Display Content
switch ($STEP) {
case 2:
if ($SUCCESS) {
$content["evaluation_attempt"] = display_success();
}
break;
case 1:
default:
if ($evaluation_record["evaluation_finish"] < time() && $evaluation_record["min_submittable"] > $completed_attempts) {
$NOTICE++;
$NOTICESTR[] = "This evaluation has not been completed and was marked as to be completed by " . date(DEFAULT_DATE_FORMAT, $evaluation_record["evaluation_finish"]) . ". Please complete this evaluation now to continue using " . APPLICATION_NAME . ".";
}
if (isset($evaluation_record["evaluation_description"]) && $evaluation_record["evaluation_description"]) {
$content["evaluation_attempt"] .= "<div class=\"display-generic\">" . $evaluation_record["evaluation_description"] . "</div>";
}
/**
* Check to see if they currently have any evaluation attempts underway, if they do then
* restart their session, otherwise start them a new session.
*/
示例6: unset
$PROCESSED["grade_id"] = $grades[$proxy_id]["grade_id"];
$db->AutoExecute("assessment_grades", $PROCESSED, "UPDATE", "`grade_id`=" . $db->qstr($PROCESSED["grade_id"]));
} else {
$db->AutoExecute("assessment_grades", $PROCESSED, "INSERT");
}
}
unset($PROCESSED);
}
}
if (!$ERROR) {
add_success("Successfully imported results from the attached quiz questions into <strong>" . $assessment_name . "</strong>.");
}
} else {
add_error("No students have been found in the cohort assigned to this assessment [<strong>" . $assessment_name . "</strong>].");
}
} else {
add_error("No quizzes were found to be associated with this assessment [<strong>" . $assessment_name . "</strong>].");
}
} else {
add_error("The assessment " . $assessment_name . " does not have a quiz attached, results can not be imported.");
}
if ($ERROR) {
add_error("You will now be redirected to the <strong>Grade Assessment</strong> page for <strong>" . $assessment_name . "</strong>. This will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue now.");
echo display_error();
}
if ($SUCCESS) {
add_success("You will now be redirected to the <strong>Grade Assessment</strong> page for <strong>" . $assessment_name . "</strong>. This will happen <strong>automatically</strong> in 5 seconds or <a href=\"" . $url . "\" style=\"font-weight: bold\">click here</a> to continue now.");
echo display_success();
}
$ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
}
示例7: complete_upload_match_media
/**
* Checks a registration request for invalid inputs
*
* @access public
* @return true
*/
function complete_upload_match_media()
{
if (valid_request(array(isset($_GET['match_id']), isset($_FILES['match_media']), isset($_POST['description'])))) {
require CLASS_PATH . 'class.upload.php';
global $db;
global $smarty;
if (strlen($_POST['description']) < 2 || strlen($_POST['description']) > 20) {
display_errors(751);
return true;
}
$upload = new Upload($_FILES['match_media']);
if ($upload->uploaded) {
//getting the internal file name out of the current time
$name = microtime();
$name = substr($name, 2, 8) . substr($name, 11);
$upload->file_new_name_body = $name;
$upload->allowed = array('application/zip', 'image/*');
$upload->process(MATCH_MEDIA_PATH);
if ($upload->processed) {
$sql = "add_match_media(" . $_GET['match_id'] . ",\n " . $_SESSION['user_id'] . ",\n '" . $_POST['description'] . "',\n '" . $upload->file_dst_name . "', \n " . filesize($upload->file_dst_pathname) . ")";
$db->run($sql);
if ($db->error_result) {
display_errors(750);
} else {
display_success("upload_match_media");
$smarty->assign('content', $smarty->fetch("succes.tpl"));
}
} else {
display_errors(750);
}
$upload->clean();
} else {
display_errors(750);
return true;
}
}
return true;
}
示例8: clean_input
$student_id = clean_input($_GET["id"], "numeric");
$BREADCRUMB[] = array("url" => ENTRADA_URL . "/admin/observerships?section=add", "title" => "Add Observership");
switch ($STEP) {
case 2:
$observership_array = $_POST;
$observership_array["student_id"] = $student_id;
/*
* Admins adding observerships are approved automatically.
*/
$OBSERVERSHIP = Observership::fromArray($observership_array, "add", $student_id);
if (!$OBSERVERSHIP->isValid()) {
add_error("<strong>Invalid data entered</strong>. Please confirm everything and try again.");
} else {
if ($OBSERVERSHIP->create()) {
$url = ENTRADA_URL . "/admin/users/manage/students?section=observerships&id=" . $student_id;
echo display_success("Successfully created Observership. You will be redirected to your Observership index in <strong>5 seconds</strong> or <a href=\"" . $url . "\">click here</a> to go there now.");
$ONLOAD[] = "setTimeout('window.location=\\'" . $url . "\\'', 5000)";
return;
} else {
add_error("<strong>Error occurred creating Observership</strong>. Please confirm everything and try again.");
}
}
break;
case 1:
default:
$OBSERVERSHIP = new Observership();
break;
}
define('ADMIN_OBSERVERSHIP_FORM', true);
$ACTION = "Create";
require_once 'form.inc.php';
示例9: get_user_bio
public function get_user_bio()
{
// Retrieve Local Parameters
$user_id = mysql_escape_string($_POST['user_id']);
$getbio = mysql_query("SELECT bio FROM users WHERE user_id='" . $user_id . "'");
$results = mysql_fetch_array($getbio);
$data = array("bio" => $results['bio']);
display_success($data);
}
示例10: application_log
}
} else {
application_log("error", "Attempt to update observership with id [" . $observership_id . "] for proxy id [" . $PROXY_ID . "] where status was invalid or different student_id.");
add_error("An error ocurred while trying to update observership status. An administrator has been informed, please try again later.");
}
unset($observership);
}
}
break;
}
switch ($STEP) {
case 2:
if ($ERORR) {
echo display_error();
} else {
echo display_success("Successfully updated observerships for " . $user->getFullname(false) . ". You will be redirected to the students observership managment page in 5 seconds. Please <a href=\"" . ENTRADA_URL . "/admin/users/manage/students?section=observerships&id=" . $PROXY_ID . "\">click here</a> if you do not wish to wait.");
if (count($pending_observerships) > 0) {
$ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/users/manage/students?section=observerships&id=" . $PROXY_ID . "\\'', 5000)";
} else {
$ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/users/manage?id=" . $PROXY_ID . "\\'', 5000)";
}
}
break;
case 1:
default:
if (clerkship_fetch_schedule($user->getID()) == false || ($ENTRADA_USER->getGroup() == "staff" || $ENTRADA_USER->getGroup() == "medtech")) {
?>
<div class="row-fluid">
<a id="add_observership" href="<?php
echo ENTRADA_URL;
?>
示例11: show_file
function show_file($file_id, $user, $success = null)
{
global $LSP_URL, $DATA_DIR;
$dbh =& get_db();
$stmt = $dbh->prepare('SELECT licenses.name AS license, size, realname, filename, users.login, ' . 'categories.name AS category, subcategories.name AS subcategory,' . 'insert_date, update_date, description, downloads, files.id FROM files ' . 'INNER JOIN categories ON categories.id=files.category ' . 'INNER JOIN subcategories ON subcategories.id=files.subcategory ' . 'INNER JOIN users ON users.id=files.user_id ' . 'INNER JOIN licenses ON licenses.id=files.license_id ' . 'WHERE files.id=:file_id');
$stmt->bindParam(':file_id', $file_id);
$found = false;
if ($stmt->execute()) {
while ($object = $stmt->fetch(PDO::FETCH_ASSOC)) {
$title = array($object['category'], $object['subcategory'], get_file_url($file_id));
if ($success == null) {
echo '<div class="col-md-9">';
create_title($title);
} else {
if ($success === true) {
display_success("Updated successfully", $title);
echo '<div class="col-md-9">';
} else {
if ($success === false) {
display_error("Update failed.", $title);
echo '<div class="col-md-9">';
} else {
display_success("{$success}", $title);
}
}
}
echo '<table class="table table-striped">';
show_basic_file_info($object, false);
// Bump the download button under details block
$url = htmlentities('download_file.php?file=' . $object['id'] . '&name=' . $object['filename']);
echo '<tr><td><strong>Name:</strong> ' . $object['filename'];
if (is_image($url)) {
echo '<br><br><a href="' . $url . '"><img class="thumbnail" src="' . scale_image($DATA_DIR . $file_id, 300, parse_extension($url)) . '" alt=""></a>';
}
echo '</td><td class="lsp-file-info">';
echo '<a href="' . $url . '" id="downloadbtn" class="lsp-dl-btn btn btn-primary">';
echo '<span class="fa fa-download lsp-download"></span> Download</a>';
echo '</td></tr>';
echo '<tr><td colspan="2"><div class="well"><strong>Description:</strong><p>';
echo $object['description'] != '' ? parse_links(newline_to_br($object['description'], true)) : 'No description available.';
echo '</p></div></td></tr>';
echo '<tr><td colspan="2">';
echo '<nav id="lspnav" class="navbar navbar-default"><ul class="nav navbar-nav">';
$can_edit = $object['login'] == $user || is_admin(get_user_id($user));
$can_rate = !SESSION_EMPTY();
$rate_self = $object['login'] == $user;
global $LSP_URL;
create_toolbar_item('Comment', "{$LSP_URL}?comment=add&file={$file_id}", 'fa-comment', $can_rate);
create_toolbar_item('Edit', "{$LSP_URL}?content=update&file={$file_id}", 'fa-pencil', $can_edit);
create_toolbar_item('Delete', "{$LSP_URL}?content=delete&file={$file_id}", 'fa-trash', $can_edit);
$star_url = $LSP_URL . '?' . file_show_query_string() . '&rate=';
create_toolbar_item(get_stars($file_id, $star_url, $rate_self ? false : $can_rate), '', null, $can_rate, $rate_self);
echo '</ul></nav>';
echo '<strong>Comments:</strong>';
echo '</td></tr>';
get_comments($file_id);
echo '</table></div>';
$found = true;
break;
}
}
if (!$found) {
display_error('Invalid file: "' . sanitize($file_id) . '"');
}
$stmt = null;
$dbh = null;
}
示例12: complete_edit_user_rights
function complete_edit_user_rights()
{
if (valid_request(array(isset($_GET['user_id'])))) {
global $db;
global $smarty;
if (!isset($_POST['admin'])) {
$admin_perm = 0;
} else {
$admin_perm = 1;
}
if (!isset($_POST['managment'])) {
$managment_perm = 0;
} else {
$managment_perm = 1;
}
if (!isset($_POST['tech'])) {
$tech_perm = 0;
} else {
$tech_perm = 1;
}
$sql = "edit_user_rights(" . $_GET['user_id'] . ",\n " . $admin_perm . ",\n " . $tech_perm . ",\n " . $managment_perm . ")";
$db->run($sql);
if ($db->error_result) {
display_errors(1);
} else {
display_success("edit_user_rights");
}
}
return true;
}
示例13: vote_candidate
public function vote_candidate()
{
// get parameters
$election_id = mysql_escape_string($this->_parameters['election_id']);
$user_id = mysql_escape_string($this->_parameters['user_id']);
$candidate_id = mysql_escape_string($this->_parameters['candidate_id']);
$checkIfVoted = mysql_query("SELECT * FROM votes WHERE election_id='" . $election_id . "' AND user_id='" . $user_id . "'");
if (mysql_num_rows($checkIfVoted) > 0) {
display_error(204);
}
// cast vote
$castVote = mysql_query("INSERT INTO votes (election_id, candidate_id, user_id) VALUES ('" . $election_id . "', '" . $candidate_id . "', '" . $user_id . "')");
display_success();
}
示例14: count_data
}
}
}
//-------------------------------UPDATE ACTION-----------------------------------------
if (isset($_POST['submit_update'])) {
//CEK EXISTING DATA IN TABLE
$cek_exist = count_data(TB_PREF . "items", 'item_name', "item_name='" . $_POST['item_name'] . "'");
if ($cek_exist[0] > 1) {
display_error("Data pembaruhan sudah ada " . "| <a href='?" . $parameter_key . "kd_tabel=tb_items' />Close</a>");
} else {
$table = TB_PREF . "items";
$value = "item_code='" . $_POST['item_code'] . "', " . " item_name='" . $_POST['item_name'] . "', " . " id_brand='" . $_POST['id_brand'] . "', " . " unit_price='" . $_POST['unit_price'] . "', " . " discount='" . $_POST['discount'] . "', " . " weight='" . $_POST['weight'] . "', " . " description='" . $_POST['description'] . "' ";
$where = " WHERE id='" . $_POST['id'] . "'";
$query = update_record($table, $value, $where);
if ($query) {
display_success("Data berhasil diperbaruhi " . "| <a href='?" . $parameter_key . "kd_tabel=tb_items' />Close</a>");
} else {
display_error("Gagal memperbaruhi data <br>" . "(" . mysql_error() . ") | <a href='?" . $parameter_key . "kd_tabel=tb_items' />Close</a>");
}
}
}
//-------------------------------ISSET UPDATE/DELETE-----------------------------------------
if (isset($_GET['update'])) {
$id = $_GET['update'];
$val_selected = display_table_all_column(TB_PREF . 'items', "id='{$id}'", true, false, '', '');
$_POST['AddNew'] = 'update';
}
//DELETE ACTION
/*sementara delete item tidak bisa
if(isset($_GET['delete'])){
$id = $_GET['delete'];
示例15: die
FROM user
WHERE user_name = "' . $_POST['user_name'] . '"';
if (($new_id = $mydb->queryrow($sql)) === false) {
die('Database error - Could not determine new user ID');
}
$user_id = (int) $new_id['user_id'];
$sql = 'INSERT INTO user_templates (user_id, user_template)
VALUES (' . $user_id . ', "' . addslashes($skin_data['skin_html']) . '")';
if (!$mydb->query($sql)) {
die('Database error - Could not insert skin data');
}
$activation_key = md5(pow($user_id, 2));
$activation_link = 'http://www.stfc.it/index.php?a=activate&galaxy=' . $galaxy . '&user_id=' . $user_id . '&key=' . $activation_key;
$mail_message = $locale['mail_message_congrats'] . ' ' . $_POST['user_name'] . '!' . NL;
$mail_message .= $locale['mail_message_reg1a'] . ' ' . $galaxyname . ' ' . $locale['mail_message_reg1b'] . NL;
$mail_message .= $locale['mail_message_reg2'] . NL . $activation_link . "\n\n" . $locale['mail_message_reg3'] . NL;
$mail_message .= $locale['mail_message_reg4'] . NL . NL . $locale['mail_message_sig_line1'] . NL;
$mail_message .= $locale['mail_message_sig_line2'] . NL . NL . 'Credits: http://www.stfc.it/index.php?a=imprint';
send_mail("STFC2 Mailer", $config['admin_email'], $_POST['user_name'], $_REQUEST['user_email'], $locale['mail_subject_reg'], $mail_message);
// Update NewRegister
$sql = 'UPDATE config SET new_register = new_register + 1';
if (!$mydb->query($sql)) {
die('Database error - Could not update new_register');
}
display_success($galaxyname, $galaxyimg);
return true;
}
}
}
display_registration(NULL, '(' . $locale['there_are'] . ' ' . $playercount['num'] . ' ' . $locale['on'] . ' ' . $config['max_player'] . ' ' . $locale['occupied_places'] . ')', $galaxy);
}