当前位置: 首页>>代码示例>>PHP>>正文


PHP Alert函数代码示例

本文整理汇总了PHP中Alert函数的典型用法代码示例。如果您正苦于以下问题:PHP Alert函数的具体用法?PHP Alert怎么用?PHP Alert使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Alert函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: msg

function msg($key, $lang)
{
    $translater = array("success" => array("en" => "successful operation", "fr" => "opération réussie", "ar" => "عملية ناجحة", "al" => "erfolgreichen Betrieb", "ch" => "手术成功", "es" => "operación exitosa", "it" => "operazione riuscita", "tu" => "başarılı operasyon", "hi" => "सफल आपरेशन"));
    if (!empty($translater[$key][$lang])) {
        Alert($translater[$key][$lang], $key);
    }
}
开发者ID:marwenhlaoui,项目名称:unzipFile,代码行数:7,代码来源:init.php

示例2: Kill

function Kill($s, $t = "")
{
    if ($t == "") {
        $t = __("Error");
    }
    Alert($s, $t);
    throw new KillException();
}
开发者ID:Servault,项目名称:Blargboard,代码行数:8,代码来源:functions.php

示例3: ConfirmLeavePage

 public function ConfirmLeavePage()
 {
     //$this->driver.Keyboard.PressKey(Keys.Enter);
     //$this->mink->getSession()->getDriver();
     $this->getSession()->getDriver();
     $alert = $driver . SwitchTo . Alert();
     $alert . Accept();
 }
开发者ID:openeyes,项目名称:openeyes,代码行数:8,代码来源:Homepage.php

示例4: Kill

function Kill($s, $t = "")
{
    if ($t == "") {
        $t = __("Error");
    }
    Alert($s, $t);
    exit;
}
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:8,代码来源:feedback.php

示例5: toLogin

function toLogin($url = NULL)
{
    if (empty($url)) {
        Alert('Please Log in to Continue');
        header("location: frmlogin.php");
    } else {
        header("location: " . $url);
    }
}
开发者ID:jpbalderas17,项目名称:dms,代码行数:9,代码来源:config.php

示例6: CheckAuthority

function CheckAuthority($pos)
{
    $_MSG_NOLOGIN = "您没有登录,无权进入此页面!";
    $_MSG_NOTADMIN = "您不是管理员,无权进入此页面!";
    $_MSG_NOTAPPLY = "当前系统没有开放申请,您无权进入此页面!";
    if ($pos == "./group.php") {
        if (!Login()) {
            Alert("./", $_MSG_NOLOGIN);
        }
        if (!Admin()) {
            Alert("./", $_MSG_NOTADMIN);
        }
    }
    if ($pos == "./admin.php") {
        if (!Login()) {
            Alert("./", $_MSG_NOLOGIN);
        }
        if (!Admin()) {
            Alert("./", $_MSG_NOTADMIN);
        }
    }
    if ($pos == "./action/action_apply.php") {
        if (!Login()) {
            Alert("../", $_MSG_NOLOGIN);
        }
        if (!Apply()) {
            Alert("../", $_MSG_NOTAPPLY);
        }
    }
    if ($pos == "./action/action_alterkey.php") {
        if (!Login()) {
            Alert("../", $_MSG_NOLOGIN);
        }
    }
    if ($pos == "./page/group/action/*") {
        if (!Login()) {
            Alert("../../../", $_MSG_NOLOGIN);
        }
        if (!Admin()) {
            Alert("./", $_MSG_NOTADMIN);
        }
    }
    if ($pos == "./page/admin/action/*") {
        if (!Login()) {
            Alert("../../../", $_MSG_NOLOGIN);
        }
        if (!Admin()) {
            Alert("../../../", $_MSG_NOTADMIN);
        }
    }
}
开发者ID:jcpwfloi,项目名称:iVolunteer,代码行数:51,代码来源:check_authority.php

示例7: uploadFile

function uploadFile($file, $cattype, $cat)
{
    global $loguserid, $uploaddirs, $goodfiles, $badfiles, $userquota, $maxSize;
    $targetdir = $uploaddirs[$cattype];
    $totalsize = foldersize($targetdir);
    $filedata = $_FILES[$file];
    $c = FetchResult("SELECT COUNT(*) FROM {uploader} WHERE filename={0} AND cattype={1} AND user={2} AND deldate=0", $filedata['name'], $cattype, $loguserid);
    if ($c > 0) {
        return "You already have a file with this name. Please delete the old copy before uploading a new one.";
    }
    if ($filedata['size'] == 0) {
        if ($filedata['tmp_name'] == '') {
            return 'No file given.';
        } else {
            return 'File is empty.';
        }
    }
    if ($filedata['size'] > $maxSize) {
        return 'File is too large. Maximum size allowed is ' . BytesToSize($maxSize) . '.';
    }
    $randomid = Shake();
    $pname = $randomid . '_' . Shake();
    $fname = $_FILES['newfile']['name'];
    $temp = $_FILES['newfile']['tmp_name'];
    $size = $_FILES['size']['size'];
    $parts = explode(".", $fname);
    $extension = end($parts);
    if ($totalsize + $size > $quot) {
        Alert(format(__("Uploading \"{0}\" would break the quota."), $fname));
    } else {
        if (in_array(strtolower($extension), $badfiles) || is_array($goodfiles) && !in_array(strtolower($extension), $goodfiles)) {
            return 'Forbidden file type.';
        } else {
            $description = $_POST['description'];
            $big_descr = $cat['showindownloads'] ? $_POST['big_description'] : '';
            Query("insert into {uploader} (id, filename, description, big_description, date, user, private, category, deldate, physicalname) values ({7}, {0}, {1}, {6}, {2}, {3}, {4}, {5}, 0, {8})", $fname, $description, time(), $loguserid, $privateFlag, $_POST['cat'], $big_descr, $randomid, $pname);
            copy($temp, $targetdir . "/" . $pname);
            Report("[b]" . $loguser['name'] . "[/] uploaded file \"[b]" . $fname . "[/]\"" . ($privateFlag ? " (privately)" : ""), $privateFlag);
            die(header("Location: " . actionLink("uploaderlist", "", "cat=" . $_POST["cat"])));
        }
    }
}
开发者ID:Servault,项目名称:Blargboard,代码行数:42,代码来源:lib.php

示例8: redirect

            $page = "depreciations.php";
            break;
        case 'asl':
            $table = "asset_status_labels";
            $page = "asset_status_labels.php";
            break;
        case 'l':
            $table = "locations";
            $page = "locations.php";
            break;
        case 'man':
            $table = "manufacturers";
            $page = "manufacturers.php";
            break;
        case 'fu':
            $table = "files";
            $page = "assets.php";
            if (!empty($_GET['a'])) {
                #asset_id
                $page = "view_asset.php?id={$_GET['a']}";
            }
            break;
        default:
            redirect("index.php");
            break;
    }
    $con->myQuery("UPDATE {$table} SET is_deleted=1 WHERE id=?", array($_GET['id']));
    Alert("Delete Successful.", "success");
    redirect($page);
    die;
}
开发者ID:jpbalderas17,项目名称:ams,代码行数:31,代码来源:delete.php

示例9: makeHead

} else {
    $date_end = "";
}
makeHead("Asset Depreciation Report");
require_once "template/header.php";
require_once "template/sidebar.php";
?>
<div class='content-wrapper'>
    <div class='content-header'>
        <h1 class='page-header text-center text-green'>Asset Maintenance Report</h1>
    </div>
    <section class='content'>
        <div class="row">
                <div class='col-lg-12'>
                    <?php 
Alert();
?>
                    <div class='col-sm-12'>
                      <form method='get'>
                      <label class='col-md-2 text-right' >Start Date</label>
                      <div class='col-md-3'>
                        <input type='date' name='date_start' class='form-control' id='date_start' value='<?php 
echo !empty($_GET['date_start']) ? htmlspecialchars($_GET['date_start']) : '';
?>
'>
                      </div>
                      <label class='col-md-2 text-right' >End Date</label>
                      <div class='col-md-3'>
                        <input type='date' name='date_end' class='form-control' id='date_end' value='<?php 
echo !empty($_GET['date_end']) ? htmlspecialchars($_GET['date_end']) : '';
?>
开发者ID:jpbalderas17,项目名称:ams,代码行数:31,代码来源:report_asset_maintenance.php

示例10: array_map

            case 'login':
                $redirect = 'index.php';
                $error_redirect = "first_login.php";
                break;
            case 'form':
                $redirect = 'change_secret_password.php';
                $error_redirect = "change_secret_password.php";
                break;
        }
        $inputs = $_POST;
        $inputs = array_map('trim', $inputs);
        $errors = "";
        if (empty($inputs['password_question'])) {
            $errors .= "Enter secret question. <br/>";
        }
        if (empty($inputs['password_answer'])) {
            $errors .= "Enter answer. <br/>";
        }
        if ($errors != "") {
            Alert("You have the following errors: <br/>" . $errors, "danger");
            redirect($error_redirect);
            die;
        } else {
            $inputs['id'] = $_SESSION[WEBAPP]['user']['id'];
            $con->myQuery("UPDATE users SET password_answer=:password_answer,password_question=:password_question WHERE id=:id", $inputs);
            Alert("Secret question and answer saved.", "success");
            redirect($redirect);
        }
        die;
    }
}
开发者ID:jpbalderas17,项目名称:ams,代码行数:31,代码来源:secret_question.php

示例11: array_map

// die;
if (!empty($_POST)) {
    $errors = "";
    $inputs = $_POST;
    $inputs = array_map('trim', $inputs);
    if (empty($inputs['default_password'])) {
        $errors .= "Enter default password. <br/>";
    } else {
        $password_regex = "/^(.{0,7}|[^0-9]*|[^A-Z]*|[^a-z]*|[a-zA-Z0-9]*)\$/";
        preg_match($password_regex, $inputs['default_password'], $is_valid, PREG_OFFSET_CAPTURE);
        if (!empty($is_valid)) {
            $errors .= "Password should contain the ff:<br/>";
            $errors .= "One Integer<br>";
            $errors .= "One character<br>";
            $errors .= "One Uppercase character<br>";
            $errors .= "One Special Character<br>";
        }
        // var_dump($is_valid);
    }
    if ($errors != "") {
        Alert("You have the following errors: <br/>" . $errors, "danger");
        redirect("settings.php");
        die;
    } else {
        Alert("Update successful.", "success");
        $con->myQuery("UPDATE settings SET default_password=?", array($inputs['default_password']));
        redirect("settings.php");
        die;
    }
}
redirect("index.php");
开发者ID:jpbalderas17,项目名称:ams,代码行数:31,代码来源:save_settings.php

示例12: Fetch

             //Check for last post the user posted.
             $lastPost = Fetch(Query("SELECT p.id,p.thread,pt.text FROM {posts} p LEFT JOIN {posts_text} pt ON pt.pid=p.id AND pt.revision=p.currentrevision \n\t\t\t\tWHERE p.user={0} ORDER BY p.date DESC LIMIT 1", $loguserid));
             //If it looks similar to this one, assume the user has double-clicked the button.
             if ($lastPost['thread'] == $tid && $lastPost['text'] == $_POST['text']) {
                 $pid = $lastPost['id'];
                 die(header("Location: " . actionLink("thread", 0, "pid=" . $pid . "#" . $pid)));
             }
             $rejected = true;
             Alert(__("You're going too damn fast! Slow down a little."), __("Hold your horses."));
         }
     }
 }
 if (!$rejected) {
     $ninja = FetchResult("select id from {posts} where thread={0} order by date desc limit 0, 1", $tid);
     if (isset($_POST['ninja']) && $_POST['ninja'] != $ninja) {
         Alert(__("You got ninja'd. You might want to review the post made while you were typing before you submit yours."));
         $rejected = true;
     }
 }
 if (!$rejected) {
     $bucket = "checkPost";
     include BOARD_ROOT . "lib/pluginloader.php";
 }
 if (!$rejected) {
     $post = $_POST['text'];
     $options = 0;
     if ($_POST['nopl']) {
         $options |= 1;
     }
     if ($_POST['nosm']) {
         $options |= 2;
开发者ID:Servault,项目名称:Blargboard,代码行数:31,代码来源:newreply.php

示例13: list

    list($is_pending_to_join_team) = mysql_fetch_row($result1);
    if ($is_pending_to_join_team == "") {
        $result = mysql_query("Insert into tournament_players (team_id,player_guid,tournament_id,is_pending_to_join_team,is_pending_to_accept_team_invite,strength_points) values('{$SubscribeFor}','{$s_user_guid}','{$s_user_tournament}','1','0','" . Get_player_strength($s_user_guid) . "')", $dbi) or die("Q 200501180949" . mysql_error($dbi));
    }
}
if ($UnSubscribeFor != "") {
    $result = mysql_query("delete from tournament_players where player_guid='{$s_user_guid}' and team_id='{$UnSubscribeFor}' and tournament_id='{$s_user_tournament}'", $dbi) or die("Q 200501180949" . mysql_error($dbi));
}
if ($FullJoin != "") {
    //check if this team can have more players
    $list_sql = "select count(*) from tournament_players where team_id='{$SubscribeFor}' and tournament_id='{$s_user_tournament}' and is_pending_to_join_team=0 and is_pending_to_join_team=0";
    $result1 = mysql_query($list_sql, $dbi) or die("200901261641");
    list($team_member_count) = mysql_fetch_row($result1);
    //see the limit for this tournament
    if ($s_user_max_team_members <= $team_member_count) {
        Alert("This team is full atm. Try to negotaite ingame with them for an open spot");
    } else {
        //leave other joined teams if there is any
        $query = "delete from tournament_players where player_guid='{$s_user_guid}' and tournament_id='{$s_user_tournament}' and is_pending_to_accept_team_invite=0 and is_pending_to_join_team=0";
        $result = mysql_query($query, $dbi) or die("Q 200501180949" . mysql_error($dbi) . $query);
        //try to full join this team
        $query = "update tournament_players set is_pending_to_join_team=0,is_pending_to_accept_team_invite=0 where team_id='{$FullJoin}' and player_guid='{$s_user_guid}' and tournament_id='{$s_user_tournament}' and is_pending_to_accept_team_invite=1";
        $result = mysql_query($query, $dbi) or die("Q 200501180949" . mysql_error($dbi) . $query);
    }
}
if ($NoPendings) {
    $result = mysql_query("delete from tournament_players where player_guid='{$s_user_guid}' and tournament_id='{$s_user_tournament}' and is_pending_to_join_team=1", $dbi) or die("Q 200501180949" . mysql_error($dbi));
}
$file_name = "tournament_team_list.php";
$list_name_text = "tournament_team_settings";
$new_entry_text = " New tournament team";
开发者ID:Odiis,项目名称:Descent-Scripts,代码行数:31,代码来源:tournament_team_list.skin.php

示例14: Format

            $pl = " <span class=\"smallFonts\">[<a href=\"thread.php?id=" . $thread['id'] . "\">1</a>" . $pl . "]</span>";
        }
        $lastLink = "";
        if ($thread['lastpostid']) {
            $lastLink = " <a href=\"thread.php?pid=" . $thread['lastpostid'] . "#" . $thread['lastpostid'] . "\">&raquo;</a>";
        }
        $forumList .= Format("\n\t\t<tr class=\"cell{0}\">\n\t\t\t<td class=\"cell2 threadIcon\">{1}</td>\n\t\t\t<td class=\"threadIcon\" style=\"border-right: 0px none;\">\n\t\t\t\t{2}\n\t\t\t</td>\n\t\t\t<td style=\"border-left: 0px none;\">\n\t\t\t\t{3}\n\t\t\t\t<a href=\"thread.php?id={4}\">\n\t\t\t\t\t{5}\n\t\t\t\t</a>\n\t\t\t\t{6}\n\t\t\t\t{7}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{8}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{9}\n\t\t\t</td>\n\t\t\t<td class=\"center\">\n\t\t\t\t{10}\n\t\t\t</td>\n\t\t\t<td class=\"smallFonts center\">\n\t\t\t\t{11}<br />\n\t\t\t\t" . __("by") . " {12} {13}</td>\n\t\t</tr>\n", $cellClass, $NewIcon, $ThreadIcon, $poll, $thread['id'], strip_tags($thread['title']), $pl, $tags, UserLink($starter), $thread['replies'], $thread['views'], cdate($dateformat, $thread['lastpostdate']), UserLink($last), $lastLink);
    }
    Write("\n\t<table class=\"outline margin width100\">\n\t\t<tr class=\"header1\">\n\t\t\t<th style=\"width: 20px;\">&nbsp;</th>\n\t\t\t<th style=\"width: 16px;\">&nbsp;</th>\n\t\t\t<th style=\"width: 60%;\">" . __("Title") . "</th>\n\t\t\t<th>" . __("Started by") . "</th>\n\t\t\t<th>" . __("Replies") . "</th>\n\t\t\t<th>" . __("Views") . "</th>\n\t\t\t<th>" . __("Last post") . "</th>\n\t\t</tr>\n\t\t{0}\n\t</table>\n", $forumList);
} else {
    if ($forum['minpowerthread'] > $loguser['powerlevel']) {
        Alert(__("You cannot start any threads here."), __("Empty forum"));
    } elseif ($loguserid) {
        Alert(format(__("Would you like to {0}post something{1}?"), "<a href=\"newthread.php?id=" . $fid . "\">", "</a>"), __("Empty forum"));
    } else {
        Alert(format(__("{0}Log in{1} so you can post something."), "<a href=\"login.php\">", "</a>"), __("Empty forum"));
    }
}
if ($pagelinks) {
    Write("<div class=\"smallFonts pages\">" . __("Pages:") . " {0}</div>", $pagelinks);
}
MakeCrumbs(array(__("Main") => "./", $forum['title'] => "forum.php?id=" . $fid), $links);
ForumJump();
function ForumJump()
{
    global $fid, $loguser;
    $pl = $loguser['powerlevel'];
    if ($pl < 0) {
        $pl = 0;
    }
    $lastCatID = -1;
开发者ID:RoadrunnerWMC,项目名称:ABXD-legacy,代码行数:31,代码来源:forum.php

示例15: foreach

    if ($_POST['nosm']) {
        $previewPost['options'] |= 2;
    }
    $previewPost['mood'] = (int) $_POST['mood'];
    foreach ($user as $key => $value) {
        $previewPost["u_" . $key] = $value;
    }
    MakePost($previewPost, POST_SAMPLE, array('forcepostnum' => 1, 'metatext' => __("Preview")));
} else {
    if (isset($_POST['actionpost'])) {
        if ($_POST['key'] != $loguser['token']) {
            Kill(__("No."));
        }
        $rejected = false;
        if (!$_POST['text']) {
            Alert(__("Enter a message and try again."), __("Your post is empty."));
            $rejected = true;
        }
        if (!$rejected) {
            $bucket = "checkPost";
            include "./lib/pluginloader.php";
        }
        if (!$rejected) {
            $options = 0;
            if ($_POST['nopl']) {
                $options |= 1;
            }
            if ($_POST['nosm']) {
                $options |= 2;
            }
            $now = time();
开发者ID:knytrune,项目名称:ABXD,代码行数:31,代码来源:editpost.php


注:本文中的Alert函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。