本文整理汇总了PHP中setAlert函数的典型用法代码示例。如果您正苦于以下问题:PHP setAlert函数的具体用法?PHP setAlert怎么用?PHP setAlert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了setAlert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
modTitle('Planit | Recheche');
if (!isCO()) {
setAlert('Veuillez vous connecter pour faire une recherche', 'warning');
}
loadModel('villes');
$k['villes'] = getAllVille();
set($k);
if (!empty($_POST)) {
$ok = 0;
foreach ($_POST as $post) {
if (!empty($post)) {
$ok = 1;
break;
}
}
if ($ok) {
loadModel('recherche');
$v['result'] = search_result($_POST);
if (empty($v['result'])) {
setAlert('Aucun resultat trouve', 'warning');
}
set($v);
} else {
setAlert('Remplir au moins un champs', 'danger');
}
}
render();
}
示例2: index
function index()
{
modTitle('Planit | Deconnexion');
setAlert('Vous êtes bien déconnecté, redirection vers la page d\'accueil dans 5 secondes', 'danger');
deco();
render();
}
示例3: notLoggedIn
public static function notLoggedIn()
{
//**********Not Logged In**********//
setAlert('danger', 'Not Logged In', 'You are not currently logged in, and cannot access this page. Please log in.');
?>
<div class="container">
<div class="page-header" style="margin-top: -25px">
<h1>Access Denied</h1>
</div>
<?php
showAlerts();
?>
</div> <!-- /container -->
<?php
}
示例4: regsec_load
/**
* Loads the correct core include file based on the requested page and action, and returns a full array of requests
* @access public
* @return array
*/
function regsec_load()
{
/** Getting the raw HTTP Request Header and breaking it up into a request array */
$raw_http_request = explode("/", trim($_SERVER['REQUEST_URI'], "/"));
$request_array = array();
/** Setting default values of False for all request_array key values */
$request_array['page'] = false;
$request_array['action'] = false;
$request_array['value_1'] = false;
$request_array['value_2'] = false;
/** Assigning the first URI option to the Page array key */
if (isset($raw_http_request[0])) {
$request_array['page'] = $raw_http_request[0];
}
/** Assigning the second URI option to the Action array key */
if (isset($raw_http_request[1])) {
$request_array['action'] = $raw_http_request[1];
}
/** Assigning the third URI option to the Value 1 array key */
if (isset($raw_http_request[2])) {
$request_array['value_1'] = $raw_http_request[2];
}
/** Assigning the fourth URI option to the Value 2 array key */
if (isset($raw_http_request[3])) {
$request_array['value_2'] = $raw_http_request[3];
}
/** Loading the correct page */
if (!$request_array['page']) {
/** The visitor is not requesting any specific page, so we're loading the main page instead */
require_once INCPATH . "dashboard.inc.php";
} elseif (file_exists(INCPATH . $request_array['page'])) {
/** The visitor is requesting a core include file, so we're loading that */
require_once INCPATH . $request_array['page'];
} elseif (file_exists(ABSPATH . "plugins/" . $request_array['page'])) {
/** The page they're requesting can only be provided by a plugin, so we're serving that now */
require_once ABSPATH . "plugins/" . $request_array['page'];
} else {
/** We cannot find the page they are requesting, so we're serving the main page with an error notice */
require_once INCPATH . "dashboard.inc.php";
setAlert('danger', 'Page Not Found', 'The page you have requested could not be found. Please ensure the page has been spelled correctly and try again.');
}
/** Returning our HTTP Request array */
return $request_array;
}
示例5: register
public function register()
{
if (post('register')) {
$pengguna = ['username' => post('username'), 'email' => post('email'), 'level' => 0, 'aktif' => 1];
$pelanggan = ['nama_lengkap' => post('nama'), 'alamat' => post('alamat'), 'kota' => post('kota'), 'telp' => post('telp')];
if (post('password') == post('passconf')) {
$pengguna['password'] = md5(post('password'));
}
if ($userId = User::add($pengguna)) {
$pelanggan['id_pengguna'] = $userId;
if (Customer::add($pelanggan)) {
setAlert('success', 'Registrasi berhasil, silahkan login ke akun yang baru saja anda buat');
redirect('login');
} else {
setAlert('error', 'Maaf registrasi gagal');
redirect('register');
}
}
}
return $this->render('form-register', ['heading' => 'Silahkan register']);
}
示例6: connexion
function connexion()
{
if (isCo()) {
redirect();
}
modTitle('Planit | Connexion');
if (!empty($_POST)) {
loadModel('user');
if (empty($_POST['pseudo']) || empty($_POST['password'])) {
setAlert('Merci de remplir tous les champs', 'danger');
} else {
if (user_exist($_POST['pseudo'], $_POST['password'])) {
$_SESSION['pseudo'] = $_POST['pseudo'];
redirect();
} else {
setAlert('Mot de passe ou pseudo incorrect', 'danger');
}
}
}
render('connexion');
}
示例7: categories
public function categories($do = '', $id = '')
{
$this->data['heading'] = 'Administrasi: Kategori';
switch ($do) {
case 'form':
if (post('submit')) {
$data = ['nama' => post('nama'), 'alias' => post('alias'), 'keterangan' => post('keterangan')];
if (Category::save($data, $id)) {
if ($id) {
setAlert('success', 'Berhasil memperbarui data kategori <b>' . $data['nama'] . '</b>');
} else {
setAlert('success', 'Berhasil menambahkan kategori <b>' . $data['nama'] . '</b>');
}
return redirect('admin-shop/categories');
}
setAlert('error', 'Terjadi kesalahan dalam penyimpanan kategori <b>' . $data['nama'] . '</b>');
return redirect($this->uri->path());
} else {
if ($id) {
$this->data['data'] = Category::show([Category::primary() => $id])->fetchOne();
}
return $this->render('category-form', $this->data);
}
break;
case 'delete':
if (Category::del([Category::primary() => $id])) {
setAlert('success', 'Kategori berhasil terhapus');
} else {
setAlert('error', 'Terjadi kesalahan dalam penghapusan kategori');
}
return redirect('admin-shop/categories');
break;
default:
$this->data['data'] = Category::show();
return $this->render('category-table', $this->data);
break;
}
}
示例8: setNewPassword
/**
* New Password Method
*
* This method is called to set a new user password within the database
*
* @param int $userid
* @param string $newPassword
*/
public function setNewPassword($userid, $newPassword)
{
/** Setting the password hashing cost */
$options = ['cost' => HASH_COST];
/** Hashing the password */
$hash = password_hash($newPassword, PASSWORD_BCRYPT, $options);
/** Updating the password in the database */
$stmt = $db->prepare("UPDATE user_accounts SET password = ? WHERE userid = ?");
$stmt->execute(array($hash, $userid));
setAlert('success', LANG_PASSWORD_UPDATED, LANG_PASSWORD_UPDATED_SUBTEXT);
}
示例9: elseif
</div>
</div>
<?php
} else {
if ($user->getDirectorAccess()) {
if ($request['value_2'] == 'addfit') {
Fitting::addFitting($request['value'], $_POST['fitting_raw'], $_POST['fitting_role'], $_POST['fitting_priority'], $_POST['fitting_notes'], $user->getGroup(), $user);
} elseif ($request['value_2'] == 'deletefit') {
$stmt = $db->prepare('DELETE FROM doctrines_fittingmods WHERE fittingid = ?');
$stmt->execute(array($_POST['fitting_id']));
$stmt = $db->prepare('DELETE FROM doctrines_fits WHERE fittingid = ?');
$stmt->execute(array($_POST['fitting_id']));
} elseif ($request['value_2'] == 'editfit') {
$stmt = $db->prepare('UPDATE doctrines_fits SET fitting_name = ?, fitting_role = ?, fitting_priority = ?, fitting_notes = ? WHERE fittingid = ?');
$stmt->execute(array($_POST['fitting_name'], $_POST['fitting_role'], $_POST['fitting_priority'], $_POST['fitting_notes'], $_POST['fitting_id']));
setAlert('success', 'Fitting Updated', 'The ' . $_POST['fitting_name'] . ' fit has been successfully edited.');
} elseif ($request['value_2'] == 'editdoctrine') {
$stmt = $db->prepare('UPDATE doctrines SET doctrine_name = ?, doctrine_use = ?, doctrine_requirement = ?, doctrine_owner = ?, doctrine_staging = ? WHERE doctrineid = ?');
$stmt->execute(array($_POST['doctrine_name'], $_POST['doctrine_use'], $_POST['doctrine_requirement'], $_POST['doctrine_owner'], $_POST['doctrine_staging'], $_POST['doctrine_id']));
}
}
$fittings = array();
$fitting_prerequsites = array();
$stmt = $db->prepare('SELECT * FROM doctrines WHERE doctrineid = ? AND gid = ? LIMIT 1');
$stmt->execute(array($request['value'], $user->getGroup()));
$doctrine = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt = $db->prepare('SELECT * FROM doctrines_fits WHERE doctrineid = ? AND fitting_role = "Logistics" AND gid = ? ORDEr BY fitting_priority DESC');
$stmt->execute(array($request['value'], $user->getGroup()));
$fittings['logistics'] = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt = $db->prepare('SELECT * FROM doctrines_fits WHERE doctrineid = ? AND fitting_role = "Mainline" AND gid = ? ORDEr BY fitting_priority DESC');
$stmt->execute(array($request['value'], $user->getGroup()));
示例10: doErrorFromServer
function doErrorFromServer($message)
{
setAlert('Error from server: ' . $message);
}
示例11: showAlerts
?>
<div class="col-md-offset-3 col-md-6 col-sm-offset-2 col-sm-8 mobile-reconfig" style="padding-right: 0px">
<?php
showAlerts();
?>
<div class="col-md-12 opaque-section" style="padding: 0px">
<div class="row box-title-section">
<h3 class="eve-text" style="text-align: center; font-size: 250%"><?php
echo SITE_NAME;
?>
</h3>
</div>
<div class="row" style="padding-left: 10px; padding-right: 10px; text-align: center">
<p class="eve-text" style="font-size: 150%; text-align: center">Your account has been successfully created.</p>
<a href="/dashboard/" class="btn btn-primary eve-text" style="font-size: 125%; text-align: center; margin-bottom: 15px">Click Here To Log In</a>
</div>
</div>
</div>
<?php
} else {
// The character is being used, setting a warning and heading back to Step 1
setAlert('danger', 'Registration Failed', 'The Main Character you have selected is already in use. Please contact your recruiter for assistance.');
?>
<META http-equiv="refresh" content="0;URL=/register/1/"><?php
}
}
?>
</div>
</div>
<?php
require 'includes/footer.php';
示例12: explode
$requestURI = explode('/', $_SERVER['REQUEST_URI']);
$scriptName = explode('/', $_SERVER['SCRIPT_NAME']);
for ($i = 0; $i < sizeof($scriptName); $i++) {
if ($requestURI[$i] == $scriptName[$i]) {
unset($requestURI[$i]);
}
}
$requestURI = array_values($requestURI);
@($action = $requestURI[0]);
$params = array_slice($requestURI, 1);
if (empty($action)) {
$action = "home";
}
if (($action == 'game' || $action == 'go') && !User::isConnected()) {
//if not connected he can see only home
setAlert('warning', 'in order to play please sign in first');
header('location: /home');
exit(0);
}
//why not, i think he should be able to see home if he's connected...
if ($action == 'gameMaker') {
//it looks ugly but hey, it works
require_once "./php/gameMaker.php";
exit(0);
}
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
示例13: checkout
public function checkout()
{
if (!User::current('id')) {
redirect('login');
}
if ($items = session('cart-items')) {
$userId = User::current('id');
$userKey = User::primary();
$custKey = Customer::primary();
$pelanggan = Customer::show([$userKey => $userId])->fetchOne();
$order = [$userKey => $userId, $custKey => $pelanggan->{$custKey}, 'tanggal' => date('Y-m-d'), 'produk' => $items, 'belanja' => post('belanja'), 'kurir' => post('kurir'), 'ongkir' => post('ongkir'), 'bayar' => 0, 'kembali' => 0];
if (!$order['ongkir'] && !$order['kurir']) {
setAlert('error', 'Estimasi ongkos kirim belum ada, pastikan field kurir sudah diisi.');
return redirect('cart');
}
$order['total'] = $order['belanja'] + $order['ongkir'];
if ($return = Order::add($order)) {
session('cart-items', '');
setAlert('success', ['Terima kasih telah berbelanja di ' . conf('app.title') . '.', 'Segeralah melakukan pembayaran agar pesanan anda dapat secepatnya kami proses.']);
} else {
setAlert('error', 'Terjadi kesalahan dalam penghapusan order');
return redirect('cart');
}
}
if (User::loggedin()) {
return redirect('admin-shop/orders/form/' . $return);
}
return redirect('shop');
}
示例14: foreach
if (isset($_POST['operation_fittings'])) {
foreach ($_POST['operation_fittings'] as $fitting) {
$fittingArray[$i] = $fitting;
$i++;
}
$fittingsList = implode(',', $fittingArray);
} else {
$fittingsList = 'No fittings or doctrines requested';
}
$stmt = $db->prepare('INSERT INTO group_operations (gid,operation_name,operation_type,operation_fc,operation_rally,operation_comms,operation_timestamp,operation_fittings,operation_details) VALUES (?,?,?,?,?,?,?,?,?)');
$stmt->execute(array($user->getGroup(), $_POST['operation_name'], $_POST['operation_type'], $_POST['operation_fc'], $_POST['operation_rally'], $_POST['operation_comms'], $operationTimestamp, $fittingsList, $_POST['operation_details']));
if ($settings->getSlackIntegration()) {
sendComplexSlackNotification($settings->getSlackAuthToken(), $settings->getGroupTicker() . ' Operations Calendar', $settings->getSlackOpsChannel(), 'New Fleet Op Posted: ' . $_POST['operation_name'] . ' - ' . $_POST['operation_date'] . ' @ ' . $_POST['operation_time'] . ' FCed by ' . $_POST['operation_fc'] . '. Form up in ' . $_POST['operation_rally'] . ' on ' . $_POST['operation_comms'], 'squirrel', 'chat.postMessage');
setAlert('success', 'New Operation Created and Posted To Slack', '');
} else {
setAlert('success', 'New Operation Created', '');
}
}
$stmt = $db->prepare('SELECT * FROM group_operations WHERE gid = ? AND operation_timestamp >= ? ORDER BY operation_timestamp');
$stmt->execute(array($user->getGroup(), time()));
$operations = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="opaque-container">
<div class="row" style="width: 100%; margin-top: 20px; margin-bottom: 20px">
<div class="col-md-12 opaque-section" style="padding: 0px">
<div class="row box-title-section">
<h1 style="text-align: center">Operations Calendar<h1>
</div>
<div class="row" style="padding-left: 10px; padding-right: 10px">
<?php
示例15: getModuleSlot
public static function getModuleSlot($moduleID)
{
global $db;
$stmt = $db->prepare('SELECT * FROM dgmTypeEffects WHERE typeID = ? AND (effectID = 11 OR effectID = 12 OR effectID = 13 OR effectID = 2663 OR effectID = 3772)');
$stmt->execute(array($moduleID));
$slotID = $stmt->fetch();
switch ($slotID['effectID']) {
case 11:
$moduleSlot = 'Low';
break;
case 12:
$moduleSlot = 'High';
break;
case 13:
$moduleSlot = 'Mid';
break;
case 2663:
$moduleSlot = 'Rig';
break;
case 3772:
$moduleSlot = 'Subsystem';
break;
default:
$moduleSlot = 'Drone';
break;
}
if ($moduleSlot == NULL) {
setAlert('danger', 'Internal Server Error FC-01', 'An internal server error has occured. Please submit a bug detailing exactly what you have done or attempted to do that caused this error.');
}
return $moduleSlot;
}