本文整理汇总了PHP中xajaxResponse::addAlert方法的典型用法代码示例。如果您正苦于以下问题:PHP xajaxResponse::addAlert方法的具体用法?PHP xajaxResponse::addAlert怎么用?PHP xajaxResponse::addAlert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类xajaxResponse
的用法示例。
在下文中一共展示了xajaxResponse::addAlert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: empty
function get_pasien_check($val) {
$val[tgl_periksa_tgl_start] = empty($val[tgl_periksa_tgl_start])?1:$val[tgl_periksa_tgl_start];
$val[tgl_periksa_bln_start] = empty($val[tgl_periksa_bln_start])?1:$val[tgl_periksa_bln_start];
$val[tgl_periksa_tgl_end] = empty($val[tgl_periksa_tgl_end])?1:$val[tgl_periksa_tgl_end];
$val[tgl_periksa_bln_end] = empty($val[tgl_periksa_bln_end])?1:$val[tgl_periksa_bln_end];
$objResponse = new xajaxResponse;
$tgl_start = strtotime($val[tgl_periksa_thn_start] . "-" . $val[tgl_periksa_bln_start] . "-" . $val[tgl_periksa_tgl_start]);
$tgl_end = strtotime($val[tgl_periksa_thn_end] . "-" . $val[tgl_periksa_bln_end] . "-" . $val[tgl_periksa_tgl_end]);
if(!checkdate($val[tgl_periksa_bln_start], $val[tgl_periksa_tgl_start], $val[tgl_periksa_thn_start])) {
$objResponse->addAlert("Tanggal Awal Tidak Valid");
$objResponse->addScriptCall("fokus", "tgl_periksa_tgl_start");
} elseif(!checkdate($val[tgl_periksa_bln_end], $val[tgl_periksa_tgl_end], $val[tgl_periksa_thn_end])) {
$objResponse->addAlert("Tanggal Akhir Tidak Valid");
$objResponse->addScriptCall("fokus", "tgl_periksa_tgl_start");
} elseif($tgl_start > $tgl_end) {
$objResponse->addAlert("Tanggal Awal Harus Kurang Dari Tanggal Akhir");
$objResponse->addScriptCall("fokus", "tgl_periksa_tgl_start");
} else {
$objResponse->addScriptCall("xajax_get_pasien", $val);
}
return $objResponse;
}
示例2: processPersonalData
function processPersonalData($aFormValues)
{
$objResponse = new xajaxResponse();
$bError = false;
if (trim($aFormValues['firstName']) == "") {
$objResponse->addAlert("Please enter your first name.");
$bError = true;
}
if (trim($aFormValues['lastName']) == "") {
$objResponse->addAlert("Please enter your last name.");
$bError = true;
}
if (!preg_match("/^[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})\$/i", $aFormValues['email'])) {
$objResponse->addAlert("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->addAssign("formDiv", "style.textAlign", "center");
$sForm = "Account created.<br />Thank you.";
$objResponse->addAssign("formDiv", "innerHTML", $sForm);
$objResponse->addAssign("formWrapper", "style.backgroundColor", "rgb(67,97,149)");
$objResponse->addAssign("outputDiv", "innerHTML", "\$_SESSION:<pre>" . var_export($_SESSION, true) . "</pre>");
} else {
$objResponse->addAssign("submitButton", "value", "done");
$objResponse->addAssign("submitButton", "disabled", false);
}
return $objResponse;
}
示例3: testAjax
/**
* OpenX Schema Management Utility
*
* @author Monique Szpak <monique.szpak@openx.org>
*
* $Id$
*
*/
function testAjax($form)
{
$objResponse = new xajaxResponse();
$objResponse->addAlert('testing ajax');
$objResponse->addAlert(print_r($form, true));
return $objResponse;
}
示例4: testClassMethod
function testClassMethod($formData)
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("This is a class method.");
$objResponse->addAlert("formData: " . print_r($formData, true));
$objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)));
return $objResponse->getXML();
}
示例5: elseif
function simpan_tracer_check($value) {
$cleaner = new FormCleaner;
$cleaner->setValue($value);
$cleaner->clean();
$val = $cleaner->getValue();
$objResponse = new xajaxResponse;
if(!$val[no_rm]) {
$objResponse->addAlert("Silakan Isi Nomor Rekam Medis");
$objResponse->addScriptCall("fokus", "no_rm");
} elseif(!$val[peminjam]) {
$objResponse->addAlert("Silakan Isi Peminjam");
$objResponse->addScriptCall("fokus", "peminjam");
} else {
$kon = new Konek;
$arr_no_rm = explode("\n", $val[no_rm]);
$str_no_rm = str_replace("\n", ", ", $val[no_rm]);
//$objResponse->addAlert($str_no_rm);
$kon->sql = "
SELECT
CONCAT_WS('-', SUBSTRING(trc.pasien_id, 1,2), SUBSTRING(trc.pasien_id, 3,2), SUBSTRING(trc.pasien_id, 5,2), SUBSTRING(trc.pasien_id, 7,2)) as no_rm,
kmr.nama as nama_kamar,
trc.peminjam as peminjam,
DATE_FORMAT(trc.tgl_keluar, '%d/%m/%y') as tgl_keluar,
p.nama as nama
FROM
tracer trc
LEFT JOIN kunjungan_kamar kk ON (kk.id = trc.kunjungan_kamar_id)
LEFT JOIN kamar kmr ON (kmr.id = kk.kamar_id)
JOIN pasien p ON (p.id = trc.pasien_id)
WHERE
trc.pasien_id IN (".$str_no_rm.")
AND trc.tgl_kembali IS NULL
";
$kon->execute();
$data = $kon->getAll();
if(!empty($data)) {
$str = "\n";
for($i=0;$i<sizeof($data);$i++) {
$str .= "---------------------------------------\n";
$str .= "No RM : " . $data[$i][no_rm] . "\n";
$str .= "Pasien : " . $data[$i][nama] . "\n";
$str .= "Tgl Keluar : " . $data[$i][tgl_keluar] . "\n";
if( $data[$i][peminjam]) $str .= "Peminjam : " . $data[$i][peminjam] . "\n";
if( $data[$i][nama_kamar]) $str .= "Pelayanan : " . $data[$i][nama_kamar] . "\n";
$str .= "---------------------------------------\n";
}
$objResponse->addAlert("Data Tidak Dapat Disimpan.\nNomor Rekam Medis Berikut Belum Kembali Ke Rak Penyimpanan :\n" . $str);
$objResponse->addScriptCall("fokus", "no_rm");
} else {
$objResponse->addScriptCall("xajax_simpan_tracer", $val, $arr_no_rm);
}
}
return $objResponse;
}
示例6: preMethod
function preMethod($funcName, $args)
{
$objResponse = new xajaxResponse();
if ($args[1] == 0) {
$objResponse->addAlert($this->message . ", which will now call " . $funcName);
return $objResponse;
}
$objResponse->addAlert($this->message . ", which will now end the request.");
return array(false, $objResponse);
}
示例7: confirmTest
function confirmTest()
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("Here is an alert.");
$objResponse->addConfirmCommands(2, "Are you sure you want to show two (2) more alerts?");
$objResponse->addAlert("This will only happen if the user presses OK.");
$objResponse->addAlert("This also will only happen if the user presses OK.");
$objResponse->addAlert("This will always happen.");
return $objResponse->getXML();
}
示例8: nuevaCuenta
function nuevaCuenta($datos)
{
$objResponse = new xajaxResponse();
$controlCuenta = new ManejadorCuenta();
$resultado = $controlCuenta->registrarNuevaCuenta($datos[select], $datos[nombre], $datos[des]);
if ($resultado) {
$objResponse->addAlert("Nueva Cuenta registrada con exito");
} else {
$objResponse->addAlert("Error: La cuenta ya existe");
}
return $objResponse;
}
示例9: sendmail
function sendmail($formValues, $mailbody)
{
$resp = new xajaxResponse();
$resp->addAssign("state", "innerHTML", "<img src=\"images/loading.gif\">正在发送...");
if (send_mail($formValues['mailto'], $formValues['subject'], $mailbody)) {
$resp->addAssign("state", "innerHTML", "");
$resp->addAlert("send ok");
} else {
$resp->addAlert($mailbody);
}
return $resp;
}
示例10: enviar_mail
function enviar_mail($formulario)
{
$respuesta = new xajaxResponse('utf-8');
if ($formulario['nombre'] == "") {
$error = "Por favor dinos tu nombre";
} elseif ($formulario['email'] == "") {
$error = "Por favor escribe un correo electrónico para comunicarnos";
} elseif ($formulario['telefono'] == "") {
$error = "Necesitamos un número telefónico para comunicarnos";
} elseif ($formulario['mensaje'] == "") {
$error = "Cual es tu mensaje ?";
} else {
$error = "";
}
if ($error != "") {
$respuesta->addAlert("{$error}");
return $respuesta;
}
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: NuestraRed.org <correo@nuestrared.org>\r\n";
$headers .= "Reply-To: correo@nuestrared.org\r\n";
$headers .= "Return-path: correo@nuestrared.org\r\n";
$headers .= "Cc: correo@nuestrared.org" . "\r\n";
$asunto = "Mensaje de Nuestra Red ";
$cuerpo = "\n<img src='http://nuestrared.org/images/logo.png' style='width:100%'>\nGracias <strong>{$formulario['nombre']}</strong> por comunicarse con <a href='NuestraRed.org'>NuestraRed.org</a>\n<div>\n<h3>{$asunto}</h3>\n<li><strong>Nombre</strong> {$formulario['nombre']}</li>\n<li><strong>Email</strong> {$formulario['email']}</li>\n<li><strong>Teléfono</strong> {$formulario['telefono']}</li>\n<li><strong>Mensaje</strong> {$formulario['mensaje']}</li>\n</div> \n<p>Sigue en contacto con <a href='NuestraRed.org'>NuestraRed.org</a></p>\n\n";
if (mail("{$formulario['email']}", "{$asunto}", "{$cuerpo}", "{$headers}")) {
$mensaje = "{$cuerpo}";
} else {
$mensaje = "<div class='alert alert-danger'><h2>Error enviando correo </h2>";
}
$respuesta->addAssign("div_contacto", "innerHTML", "{$mensaje}");
//$respuesta->addAlert("Hola Mundo");
return $respuesta;
}
示例11: test
function test()
{
$objResponse = new xajaxResponse();
$objResponse->addAlert("hallo");
$objResponse->addAssign('testButton', 'label', 'Success!');
return $objResponse->getXML();
}
示例12: myErrorRiddenFunction
function myErrorRiddenFunction()
{
$value = $silly['nuts'];
$objResponse = new xajaxResponse();
$objResponse->addAlert("Bad array value: {$value}");
include "file_doesnt_exist.php";
return $objResponse->getXML();
}
示例13: testForm
function testForm($formData, $strText)
{
global $useEncoding, $htmlEntities;
$objResponse = new xajaxResponse($useEncoding, $htmlEntities);
$objResponse->addAlert("formData: " . print_r($formData, true) . $strText);
$objResponse->addAssign("submittedDiv", "innerHTML", nl2br(print_r($formData, true)) . '<br /><br />' . $strText);
return $objResponse->getXML();
}
示例14: asigna
function asigna($ultimo)
{
$respuesta = new xajaxResponse();
javascript:
alert("funciona");
$MSG = "Datos asignados con exito";
$respuesta->addAlert($MSG);
return $respuesta;
}
示例15: xajaxResponse
function simpan_perujuk_check($value) {
$objResponse = new xajaxResponse();
$value[nama] = addslashes(trim($value[nama]));
if(!$value[nama])
$objResponse->addAlert("Silakan Isi Nama Perujuk.");
else
$objResponse->addScriptCall("xajax_simpan_perujuk", $value);
return $objResponse;
}