本文整理汇总了PHP中isAjaxRequest函数的典型用法代码示例。如果您正苦于以下问题:PHP isAjaxRequest函数的具体用法?PHP isAjaxRequest怎么用?PHP isAjaxRequest使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了isAjaxRequest函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: daemons_servers_delete
function daemons_servers_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$server_id = intval(params('server_id'));
$daemon_id = intval(params('daemon_id'));
$arrService = $db->select("SELECT id\n FROM {$cfg['tblService']}\n WHERE server_id='{$server_id}'\n AND daemon_id='{$daemon_id}'");
if (!$arrService) {
halt(SERVER_ERROR);
return;
}
$id = $arrService[0]['id'];
$result = $db->delete("DELETE FROM {$cfg['tblService']}\n WHERE id='{$id}'\n LIMIT 1");
$resultForeign = $db->delete("DELETE FROM {$cfg['tblAccess']}\n WHERE dienst_id='{$id}'");
if (!$result || !$resultForeign) {
halt(SERVER_ERROR);
return;
}
set('server', array('id' => $server_id));
set('daemon', array('id' => $daemon_id));
if (isAjaxRequest()) {
return js('daemons_servers/delete.js.php', null);
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
示例2: dump
function dump($msg)
{
if (Config::Get('sys.logs.hacker_console') && !isAjaxRequest()) {
call_user_func(array('Debug_HackerConsole_Main', 'out'), $msg);
} else {
//var_dump($msg);
}
}
示例3: after
function after($output, $route)
{
if (!isAjaxRequest()) {
$time = number_format((double) substr(microtime(), 0, 10) - LIM_START_MICROTIME, 6);
$output .= "\n<!-- page rendered in {$time} sec., on " . date("D M j G:i:s T Y") . " -->\n";
$output .= "<!-- for route\n";
$output .= print_r($route, true);
$output .= "-->";
}
return $output;
}
示例4: dump
/**
* функция вывода отладочных сообщений через "хакерскую" консоль Дмитрия Котерова
*/
function dump($msg)
{
if (Config::Get('sys.logs.hacker_console') && !isAjaxRequest()) {
if (!class_exists('Debug_HackerConsole_Main')) {
require_once Config::Get('path.root.server') . "/engine/lib/external/HackerConsole/Main.php";
new Debug_HackerConsole_Main(true);
}
call_user_func(array('Debug_HackerConsole_Main', 'out'), $msg);
} else {
//var_dump($msg);
}
}
示例5: ports_delete
function ports_delete()
{
$id = intval(params('id'));
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$result = $db->delete("DELETE FROM {$cfg['tblPort']}\n WHERE id={$id}\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
set('port', array('id' => $id));
if (isAjaxRequest()) {
return js('ports/delete.js.php', null);
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
示例6: access_delete
function access_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$role_id = intval(params('role_id'));
$dienst_id = intval(params('service_id'));
$result = $db->delete("DELETE FROM {$cfg['tblAccess']}\n WHERE rolle_id='{$role_id}'\n AND dienst_id='{$dienst_id}'\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
set('role', array('id' => $role_id));
set('service', array('id' => $dienst_id));
if (isAjaxRequest()) {
return js('access/delete.js.php', null);
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
示例7: roles_services_delete
function roles_services_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$role_id = intval($_POST['role_id']);
$service_id = intval($_POST['service_id']);
$connect = isset($_POST['connect']) ? true : false;
$result = $db->delete("DELETE FROM {$cfg['tblAccess']}\n WHERE rolle_id='{$role_id}'\n AND dienst_id='{$service_id}'\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
if (isAjaxRequest() && $connect) {
$arrRoles = fetchRolesServices("WHERE {$cfg['tblRole']}.id = {$role_id}");
return js('roles_services/role.js.php', null, array('role' => array_pop($arrRoles)));
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
示例8: people_delete
function people_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$id = intval(params('id'));
$result = $db->delete("DELETE FROM {$cfg['tblPerson']}\n WHERE id={$id}\n LIMIT 1");
$resClientForeign = $db->delete("DELETE FROM {$cfg['tblClient']}\n WHERE person_id={$id}");
$resHasRolleForeign = $db->delete("DELETE FROM {$cfg['tblPersonHasRole']}\n WHERE person_id={$id}");
if ($result && $resClientForeign && $resHasRolleForeign) {
set('person', array('id' => $id));
if (isAjaxRequest()) {
return js('people/delete.js.php', null);
} else {
redirect_to('people');
}
} else {
halt(SERVER_ERROR);
}
}
示例9: isAjaxPost
function isAjaxPost()
{
return isPost() && isAjaxRequest() ? true : false;
}
示例10: people_roles_delete
function people_roles_delete()
{
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$role_id = intval(params('role_id'));
$person_id = intval(params('person_id'));
$connect = isset($_POST['connect']) ? true : false;
if ($connect) {
$role_id = intval($_POST['role_id']);
$person_id = intval($_POST['person_id']);
}
$result = $db->delete("DELETE FROM {$cfg['tblPersonHasRole']}\n WHERE rolle_id='{$role_id}'\n AND person_id='{$person_id}'\n LIMIT 1");
if (!$result) {
halt(SERVER_ERROR);
return;
}
if (isAjaxRequest()) {
if ($connect) {
$arrRoles = fetchRoles("WHERE {$cfg['tblRole']}.id = {$role_id}");
return js('people_roles/role.js.php', null, array('role' => array_pop($arrRoles)));
} else {
set('role', array('id' => $role_id));
set('person', array('id' => $person_id));
return js('people_roles/delete.js.php', null);
}
} else {
halt(HTTP_NOT_IMPLEMENTED);
}
}
示例11: Connection
require_once 'main.php';
require_once 'Connection.class.php';
require_once 'CustomerPaginator.class.php';
$c = new Connection();
$conn = $c->getConnection();
$limit = from_get('limit', 10);
$page = from_get('page', 1);
$links = from_get('links', 7);
$expanded = from_get('expanded', 'on');
$search_name = from_get('search_name', '');
$search_participants = from_get('search_participants', '');
$query = "SELECT DISTINCT A.id, A.name, A.email, A.phone, A.participants, A.observations, A.timestamp FROM wp_musicteach_customer A ";
$conn->set_charset("utf8");
$Paginator = new CustomerPaginator($conn, $query, $search_name, $search_participants);
$results = $Paginator->getData($limit, $page);
if (isAjaxRequest()) {
include 'include_list_customers.php';
} else {
include 'head.php';
?>
<h1 class="text-center">Cercador de famílies</h1>
<div id="form-list" class="form-list" data-model="customer">
<?php
include 'include_search_customers.php';
include 'include_list_customers.php';
?>
</div>
<?php
include 'foot.php';
}
?>
示例12: clients_delete
function clients_delete()
{
$id = intval(params('id'));
$cfg = $GLOBALS['cfg'];
$db = $GLOBALS['db'];
$result = $db->delete("DELETE FROM {$cfg['tblClient']}\n WHERE id={$id}\n LIMIT 1");
if ($result) {
set('client', array('id' => $id));
if (isAjaxRequest()) {
return js('clients/delete.js.php', null);
} else {
redirect_to('clients');
}
} else {
halt(SERVER_ERROR);
}
}
示例13: error_reporting
<?php
include 'access.php';
error_reporting(E_ALL);
ini_set("display_errors", 1);
require_once 'main.php';
require_once 'Connection.class.php';
require_once 'GroupDAO.class.php';
$response = array('status' => '1', 'message' => '');
$isAjax = isAjaxRequest();
$action = from_post_or_get('action', '');
if (!isset($action)) {
die('accio no informada');
exit;
}
$id = -1;
if ($action !== 'new' && $action !== 'update' && $action !== 'delete') {
die('accio incorrecta: ' . $action);
}
switch ($action) {
case 'delete':
$id = $_GET['id'] or die('id de grup no informat');
break;
case 'update':
$id = $_POST['id'] or die('id de grup no informat');
case 'new':
$name = $_POST['name'] or die('nom de grup no informat');
$age = $_POST['age'] or die('edat no informada');
$date_start = $_POST['date_start'] or die('data inici informada');
$date_end = $_POST['date_end'] or die('data fi informada');
$location = $_POST['location'] or die('ubicació no informada');
示例14: flag
function flag()
{
loggedInSection();
// urika_helper.php
if (isAjaxRequest()) {
$image = $this->image_model->getImage($this->input->xss_clean($_POST["image_id"]));
$image = $image->row();
$this->load->model("flag_model");
if ($this->flag_model->flagExists($this->session->userdata("user_id"), $image->image_id) == true) {
echo "false";
} else {
// need to add a new favourite
$insert_data = array("fl_upload_id" => $image->image_id, "fl_flagger_id" => $this->session->userdata("user_id"));
$insert = $this->flag_model->createNewFlag($insert_data);
if ($insert !== false) {
echo "true";
} else {
echo "false";
}
}
} else {
$data = array("errorTitle" => "Request Denied", "content" => "An error has occurred: you cannot access this page from the browser.");
$this->template->write_view("content", "general/error", $data, TRUE);
//now render templates
$this->template->render();
}
}
示例15: delete
function delete()
{
loggedInSection();
// urika_helper.php
if (isAjaxRequest()) {
if (isset($_POST["delete_id"]) && is_numeric($_POST["delete_id"])) {
// check this post belongs to the user
$comment = $this->comment_model->getComment($this->input->xss_clean($_POST["delete_id"]));
if ($comment != false) {
$comment = $comment->row();
if ($comment->c_poster_id == $this->session->userdata("user_id")) {
// now delete the comment
if ($this->comment_model->deleteComment($_POST["delete_id"]) == true) {
echo "true";
} else {
echo "false";
}
} else {
echo "false";
}
} else {
echo "false";
}
} else {
echo "false";
}
} else {
$data = array("errorTitle" => "Request Denied", "content" => "An error has occurred: you cannot access this page from the browser.");
$this->template->write_view("content", "general/error", $data, TRUE);
//now render templates
$this->template->render();
}
}