本文整理汇总了PHP中xajaxResponse::alert方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::alert方法的具体用法?PHP xajaxResponse::alert怎么用?PHP xajaxResponse::alert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::alert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testForm
function testForm($formData)
{
$objResponse = new xajaxResponse();
$objResponse->alert("formData: " . print_r($formData, true));
$objResponse->assign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
return $objResponse;
}
示例2: myErrorRiddenFunction
function myErrorRiddenFunction()
{
$value = $silly['nuts'];
$objResponse = new xajaxResponse();
$objResponse->alert("Bad array value: {$value}");
include "file_doesnt_exist.php";
return $objResponse;
}
示例3: testForm
function testForm($strText, $formData, $arrArray)
{
global $useEncoding, $htmlEntities;
$objResponse = new xajaxResponse($useEncoding, $htmlEntities);
$data = "Text:\n" . $strText;
$data .= "\n\nFormData:\n" . print_r($formData, true);
$data .= "\n\nArray:\n" . print_r($arrArray, true);
$objResponse->alert($data);
$objResponse->assign("submittedDiv", "innerHTML", "<pre>" . $data . "</pre>");
return $objResponse;
}
示例4: editvote
function editvote($eV)
{
global $db;
$resp = new xajaxResponse();
$i = 0;
foreach ($eV['id'] as $v) {
$db->query("UPDATE `vote` SET custom1='" . m_addslashes($eV['zd1'][$i]) . "',custom2='" . m_addslashes($eV['zd2'][$i]) . "' WHERE id=" . $v . "") or error('Unable to update vote.', __FILE__, __LINE__, $db->error());
$i++;
}
$resp->alert("更新成功");
return $resp->getXML();
}
示例5: processPersonalData
function processPersonalData($aFormValues)
{
$objResponse = new xajaxResponse();
$bError = false;
if (trim($aFormValues['firstName']) == "") {
$objResponse->alert("Please enter your first name.");
$bError = true;
}
if (trim($aFormValues['lastName']) == "") {
$objResponse->alert("Please enter your last name.");
$bError = true;
}
if (!eregi("^[a-zA-Z0-9]+[_a-zA-Z0-9-]*(\\.[_a-z0-9-]+)*@[a-z??????0-9]+(-[a-z??????0-9]+)*(\\.[a-z??????0-9-]+)*(\\.[a-z]{2,4})\$", $aFormValues['email'])) {
$objResponse->alert("Please enter a valid email address.");
$bError = true;
}
if (!$bError) {
$_SESSION['newaccount']['firstname'] = $aFormValues['firstName'];
$_SESSION['newaccount']['lastname'] = $aFormValues['lastName'];
$_SESSION['newaccount']['email'] = $aFormValues['email'];
$objResponse->assign("formDiv", "style.textAlign", "center");
$sForm = "Account created.<br />Thank you.";
$objResponse->assign("formDiv", "innerHTML", $sForm);
$objResponse->assign("formWrapper", "style.backgroundColor", "rgb(67,97,149)");
$objResponse->assign("outputDiv", "innerHTML", "\$_SESSION:<pre>" . var_export($_SESSION, true) . "</pre>");
} else {
$objResponse->assign("submitButton", "value", "done");
$objResponse->assign("submitButton", "disabled", false);
}
return $objResponse;
}
示例6: saveAjax
public function saveAjax($aFormValues)
{
$oResp = new xajaxResponse();
if (empty($aFormValues['movie_id'])) {
// check if movie exists already
$oMovieResult = $this->getModel('movie')->where('name', $aFormValues['name'], '=')->where('year', $aFormValues['year'], '=');
$oMovieResult->getAll();
error_log(print_r($oMovieResult->movie_id, 1));
if (empty($oMovieResult->movie_id)) {
error_log(print_r("ok1", 1));
$oMovie = $this->getModel('movie');
$oMovie->name = $aFormValues['name'];
$oMovie->local_name = $aFormValues['local_name'];
$oMovie->year = $aFormValues['year'];
$oMovie->actors = $aFormValues['actors'];
// saving image
if ($aFormValues['img_url'] && strpos($aFormValues['img_url'], $_SERVER['SERVER_NAME']) !== false) {
$sImageRootPath = '/home/www/public/css/mediavault/images/movies/';
error_log(print_r("ok2", 1));
$sFileName = sprintf('%u.jpg', crc32($aFormValues['img_url']));
if (!file_exists($sImageRootPath . $sFileName)) {
try {
file_put_contents($sImageRootPath . $sFileName, file_get_contents($aFormValues['img_url']));
$oMovie->image_name = $sFileName;
//$this->oRouter->getFileUrl( 'mediavault/images/movies/' . $sFileName, 'css' );
} catch (Exception $oError) {
$oResp->alert('error3: ' . $oError->getMessage());
}
}
}
if ($oMovie->save()) {
$oResp->alert('Saved movie');
error_log(print_r("ok3", 1));
$iMovieId = $oMovie->getInsertId();
$oFile = $this->getModel('file', $aFormValues['file_id']);
$oFile->getAll();
$oFile->movie_id = $iMovieId;
if ($oFile->save()) {
$oResp->alert('Saved file');
} else {
$oResp->alert('error1: ' . $oFile->getLastError());
}
} else {
$oResp->alert('error2: ' . $oMovie->getLastError());
}
} else {
// TODO updating movie details
$oFile = $this->getModel('file', $aFormValues['file_id']);
$oFile->getAll();
$oFile->movie_id = $oMovieResult->movie_id;
if ($oFile->save()) {
$oResp->alert('Saved file');
} else {
$oResp->alert('error1: ' . $oFile->getLastError());
}
}
}
// if
return $oResp;
}
示例7: beforeProcessing
function beforeProcessing(&$bEndRequest)
{
$objResponse = new xajaxResponse();
$objArgumentManager =& xajaxArgumentManager::getInstance();
$args = $objArgumentManager->process();
if ($args[1] == 0) {
$get = print_r($_GET, true);
$post = print_r($_POST, true);
$objResponse->alert($this->message . ', which will now allow the request to continue:' . "\n" . $get . $post);
return $objResponse;
}
$bEndRequest = true;
$objResponse->alert($this->message . ", which will now end the request.");
return $objResponse;
}
示例8: sendConfirmCommands
function sendConfirmCommands()
{
$objResponse = new xajaxResponse();
$objResponse->confirmCommands(1, 'Do you want to see an alert next?');
$objResponse->alert("Here is the alert!");
return $objResponse;
}
示例9: test
function test()
{
$objResponse = new xajaxResponse();
$objResponse->alert("hallo");
$objResponse->assign('testButton', 'label', 'Success!');
return $objResponse;
}
示例10: AddClient
function AddClient($data)
{
$objResponse = new xajaxResponse();
require_once $_SERVER['DOCUMENT_ROOT'] . "/classes/banners.php";
session_start();
get_uid(false);
if (!hasPermissions('banners')) {
return $objResponse;
exit;
}
if (!$_SESSION['uid']) {
return $objResponse;
exit;
}
$ban_obj = new banners();
$name = trim($data['name']);
$adr = trim($data['adr']);
$phone = trim($data['phone']);
$cont = trim($data['cont']);
$email = trim($data['email']);
$notes = trim($data['notes']);
$id = trim($data['id']);
if (!$id) {
$action = 'add';
} else {
$action = 'update';
}
if ($action == "add" && $name) {
$res = $ban_obj->AddCompany($name, $adr, $phone, $cont, $email, $notes);
if (intval($res)) {
$newid = $res;
} else {
$error = $res;
}
}
if ($action == "update" && $name && $id) {
$error = $ban_obj->EditCompany($id, $name, $adr, $phone, $cont, $email, $notes);
}
if ($newid) {
$company = $ban_obj->GetCompany($newid, $error);
}
if ($error) {
$objResponse->alert($error);
return $objResponse;
}
if (!$newid) {
$objResponse->alert('Сохранить не получилось. Может что-то не заполнили?');
return $objResponse;
}
$objResponse->call('AddClient', $company);
return $objResponse;
}
示例11: move_to_next
function move_to_next()
{
global $maxseq;
global $testpos;
$response = new xajaxResponse();
if ($testpos == $maxseq) {
$response->alert("You're on the last page.");
return $response;
}
$_SESSION['testpos'] = $testpos + 1;
$response->script("document.location.reload()");
return $response;
}
示例12: insertInput
function insertInput($aInputData)
{
$sId = $aInputData['inputId'];
$sName = $aInputData['inputName'];
$sType = $aInputData['inputType'];
$sValue = $aInputData['inputValue'];
$sBefore = $aInputData['inputBefore'];
$objResponse = new xajaxResponse();
$objResponse->alert("inputData: " . print_r($aInputData, true));
$objResponse->insertInput($sBefore, $sType, $sName, $sId);
$objResponse->assign($sId, "value", $sValue);
return $objResponse;
}
示例13: testForm
function testForm($strText, $formData, $arrArray)
{
//global $useEncoding, $htmlEntities;
//$objResponse = new xajaxResponse($useEncoding, $htmlEntities);
// encoding parameters are not retreived automatically from the xajax object
$objResponse = new xajaxResponse();
$data = "Text:\n" . $strText;
$data .= "\n\nFormData:\n" . print_r($formData, true);
$data .= "\n\nArray:\n" . print_r($arrArray, true);
$objResponse->alert($data);
$objResponse->assign("submittedDiv", "innerHTML", "<pre>" . $data . "</pre>");
return $objResponse;
}
示例14: resendAcceptCode
/**
* Отправить повторно код для
* подтверждения сохранения финансов
* на текущий номер.
*
* @return \xajaxResponse
*/
function resendAcceptCode()
{
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/sms_gate_a1.php';
$objResponse = new xajaxResponse();
$uid = get_uid(false);
if ($uid > 0 && isset($_SESSION['sms_accept_phone'])) {
unset($_SESSION['sms_accept']);
$sms_gate = new sms_gate_a1($_SESSION['sms_accept_phone']);
if (!$sms_gate->isNextSend()) {
$sms_gate->sendAuthCellCode(sms_gate::TYPE_ACTIVATE);
$_SESSION['sms_accept_code'] = $sms_gate->getAuthCode();
unset($_SESSION['sms_accept_try']);
if (SMS_GATE_DEBUG) {
$objResponse->script("\$('sms_accept_code').set('value', '{$_SESSION['sms_accept_code']}')");
}
$objResponse->alert('Код выслан повторно.');
} else {
$timer = $sms_gate->next_time_send - time();
$objResponse->alert("\n Следующее сообщение можно будет послать через {$timer} " . ending($timer, 'секунду', 'секунды', 'секунд'));
}
$objResponse->script("\$('sms_accept_error').addClass('b-layout__txt_hide'); \$('sms_accept_code').getParent().removeClass('b-combo__input_error');");
}
return $objResponse;
}
示例15: showOutput
function showOutput()
{
$testResponse = new xajaxResponse();
$testResponse->alert("Hello");
$testResponse2 = new xajaxResponse();
$testResponse2->loadCommands($testResponse);
$testResponse2->replace("this", "is", "a", "replacement]]>");
$testResponseOutput = htmlspecialchars($testResponse2->getOutput());
$objResponse = new xajaxResponse();
$objResponse->assign("submittedDiv", "innerHTML", $testResponseOutput);
$aValues = array();
$aValues[] = "Yippie";
$objResponse->setReturnValue($aValues);
return $objResponse;
}