當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Ajax::output方法代碼示例

本文整理匯總了PHP中Ajax::output方法的典型用法代碼示例。如果您正苦於以下問題:PHP Ajax::output方法的具體用法?PHP Ajax::output怎麽用?PHP Ajax::output使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Ajax的用法示例。


在下文中一共展示了Ajax::output方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: foreach

        }
    }
} else {
    foreach ($templateData as $k => $i){
        $newTemplateData[$k] = $templateData[$k];
    }
}
*/
if (!($update = $saved->update_JSON($template, $templateData))) {
    Ajax::outputError('JSON file couldn\'t be updated');
}
//!copy original messages
$savedJSON = $saved->getJSONContent();
$savedData = json_decode($savedJSON, true);
$savedData['configs']['notify'] = $initialData['configs']['notify'];
$savedData['configs']['displayRulesFlag'] = $initialData['configs']['displayRulesFlag'];
$savedData['display_rules'] = $initialData['display_rules'];
//$savedData['configs']['notify']['message'] = $initialData['configs']['notify']['message'];
if (!$saved->updateJSON_Data($savedData)) {
    Ajax::outputError('JSON file couldn\'t be updated');
}
//!end
$notif = Notify::getByHash($hash);
if (!($reload = $notif->getJSONContent())) {
    Ajax::output('Can\'t reload json data!');
}
if ($xmlTemplate) {
    Ajax::output($customize->getHtml($xmlTemplate, $reload));
} else {
    Ajax::outputError('Internal server error. Try again later');
}
開發者ID:robertpop,項目名稱:NS,代碼行數:31,代碼來源:choose-template.php

示例2: isset

<?php

$filterId = isset($_GET['filter']) ? intval($_GET['filter']) : null;
$filter = new Filter($filterId);
if (empty($filter->id)) {
    Ajax::outputError('Invalid report');
}
$quiz = new Quiz($filter->quiz_id);
if (!$quiz->hasAccess()) {
    Ajax::outputError('Invalid report');
}
$filter->delete();
Ajax::output($filterId);
開發者ID:robertpop,項目名稱:NS,代碼行數:13,代碼來源:delete-filter.php

示例3: isset

<?php

Ajax::requireLoggedIn();
$hash = isset($_POST['hash']) ? $_POST['hash'] : $_GET['hash'];
$notify = Notify::getByHash($hash);
if (empty($notify->id) || !$notify->hasAccess()) {
    Ajax::outputError('You don\'t have access to this notification!');
}
Ajax::output($notify->name);
開發者ID:robertpop,項目名稱:NS,代碼行數:9,代碼來源:get-item-name.php

示例4: isset

<?php

$id = isset($_GET['item']) ? $_GET['item'] : null;
$snackws = isset($_GET['snackws']) ? $_GET['snackws'] : null;
//$premium = isset($_GET['premium']) && ($_GET['premium'] != 'false') ? true : false;
$notify = new Notify($id);
if (empty($notify->id)) {
    Ajax::outputError('Invalid notification');
}
Ajax::output($notify->getEmbedBarJs($snackws));
開發者ID:robertpop,項目名稱:NS,代碼行數:10,代碼來源:get-embed.php

示例5:

<?php

Ajax::requireLoggedIn();
Ajax::output(Notify::getItemsFlags($_GET['items'], User::getLogged()->id));
開發者ID:robertpop,項目名稱:NS,代碼行數:4,代碼來源:get-items-flags.php

示例6: actionAjax

 public function actionAjax()
 {
     if (isset($_REQUEST['tbl'])) {
         $data = $_REQUEST;
     } else {
         $data = $_POST;
     }
     if (isset($data['debug'])) {
         dump($data);
     }
     $class = new AjaxAdmin();
     $class->data = $data;
     if (method_exists($class, $data['action'])) {
         $class->{$data}['action']();
         echo $class->output();
     } else {
         $class = new Ajax();
         $class->data = $data;
         $class->{$data}['action']();
         echo $class->output();
     }
     yii::app()->end();
 }
開發者ID:ashishvazirani,項目名稱:food,代碼行數:23,代碼來源:AdminController.php

示例7:

<?php

$sessionId = $_GET['sessionId'];
Ajax::output(SnacktoolsUserApi::login($sessionId));
開發者ID:robertpop,項目名稱:NS,代碼行數:4,代碼來源:login.php

示例8: date

$res['labels'][$i] = date('M. j', $i);
$statsData = SnacktoolsStatsApi::getItemStats($notify->hash, $res['date1'], $res['date2']);
$res['views'] = isset($statsData) ? $statsData['totalViews'] : 0;
$res['avg'] = round($res['views'] / $days);
$d1 = date('d', strtotime($res['date1']));
$m1 = date('m', strtotime($res['date1']));
$y1 = date('Y', strtotime($res['date1']));
$d2 = date('d', strtotime($res['date2']));
$m2 = date('m', strtotime($res['date2']));
$y2 = date('Y', strtotime($res['date2']));
while (mktime(0, 0, 0, $m1, $d1, $y1) <= mktime(0, 0, 0, $m2, $d2, $y2)) {
    $t = mktime(0, 0, 0, $m1, $d1, $y1);
    $res['chart'][$t] = 0;
    $d1++;
}
if ($statsData && isset($statsData['stats'])) {
    foreach ($statsData['stats'] as &$stat) {
        $res['chart'][strtotime($stat['date'])] = $stat['views'];
    }
}
$max = max($res['chart']);
if ($max <= 1) {
    $res['indexY'] = 2;
} else {
    if ($max <= 4) {
        $res['indexY'] = $max + 1;
    }
}
$res['maxY'] = $max;
Ajax::output($res);
開發者ID:robertpop,項目名稱:NS,代碼行數:30,代碼來源:get_item_stats.php

示例9: isset

<?php

Ajax::requireLoggedIn();
$request = isset($_POST) ? $_POST : $_GET;
$quizId = isset($request['quiz']) ? $request['quiz'] : null;
$quiz = new Quiz($quizId);
if (empty($quiz->id) || !$quiz->hasAccess()) {
    Ajax::outputError('You don\'t have access to this quiz');
}
if (!isset($request['data']) || empty($request['data'])) {
    Ajax::outputError('Invalid data');
}
ignore_user_abort(true);
set_time_limit(120);
parse_str($request['data'], $data);
#$quiz->customize($data);
$template = new Templates($quiz->template_id);
$xmlTemplate = gzdecode(file_get_contents($template->getXmlLink()));
if (empty($xmlTemplate)) {
    Ajax::outputError('Internal error: Cannot load template xml');
}
$customize = new Customize($quiz);
$xmlTemplate = $customize->parsePost($xmlTemplate, $data);
if ($quiz->actualizeParams($xmlTemplate)) {
    Ajax::output($quiz);
} else {
    Ajax::outputError('Internal server error: Cannot save your quiz');
}
開發者ID:robertpop,項目名稱:NS,代碼行數:28,代碼來源:save_xml.php

示例10: isset

<?php

$filterId = isset($_GET['filter']) ? intval($_GET['filter']) : null;
$filter = new Filter($filterId);
if (empty($filter->id)) {
    Ajax::outputError('Invalid report');
}
Ajax::output($filter->getData());
開發者ID:robertpop,項目名稱:NS,代碼行數:8,代碼來源:load-filter.php

示例11: isset

<?php

Ajax::requireLoggedIn();
$hash = isset($_POST['hash']) ? trim($_POST['hash']) : trim($_GET['hash']);
$notify = Notify::getByHash($hash);
if (empty($notify->id) || !$notify->hasAccess()) {
    Ajax::outputError('You don\'t have access to this notification');
}
$template = new Templates($notify->template_id);
$customize = new Customize($notify);
// template
if (!($xmlTemplate = $template->getXmlContent())) {
    Ajax::outputError('Can\'t read template xml');
}
$jsonData = null;
// notification item data
if (!($json = $notify->getJSONContent())) {
    $jsonData = $json;
}
if ($xmlTemplate) {
    if ($jsonData) {
        Ajax::output($customize->getHtml($xmlTemplate, $jsonData));
    } else {
        Ajax::output($customize->getHtml($xmlTemplate, null));
    }
} else {
    Ajax::outputError('Internal server error. Try again later');
}
開發者ID:robertpop,項目名稱:NS,代碼行數:28,代碼來源:get-controls.php

示例12: Ajax

require '../include/constants.php';
require INCLUDE_PATH . '/class/varproperties.php';
require INCLUDE_PATH . '/class/ajax.php';
$ajax = new Ajax();
$ajax->requireLogin(1);
URL::decode($_GET['token']);
switch (URL::getNext()) {
    case 'microblog':
        $ajax->setFunction('microblog');
        break;
    case 'accounts':
        $ajax->setFunction('accounts');
        break;
    case 'sensoren':
        $ajax->setFunction('sensoren');
        break;
    case 'conditions':
        $ajax->setFunction('conditions');
        break;
    case 'dashboard':
        $ajax->setFunction('dashboard');
        break;
    case 'logs':
        $ajax->setFunction('logs');
        break;
    case 'connections':
        $ajax->setFunction('connections');
        break;
}
$ajax->output();
開發者ID:richyguitar,項目名稱:mosd,代碼行數:30,代碼來源:ajaxindex.php

示例13: ignore_user_abort

<?php

ignore_user_abort(true);
set_time_limit(90);
$id = isset($_GET['id']) ? $_GET['id'] : null;
$state = isset($_GET['state']) ? $_GET['state'] : null;
$notify = new Notify($id);
if (!$notify->hasAccess()) {
    Ajax::outputError('You don\'t have access to this notification');
}
if (!($json = $notify->getJSONContent())) {
    Ajax::output('Could not generate default json params!');
}
//doar pe ON se mai poate pune
$params = json_decode($json, true);
$params['configs']['state'] = 'ON';
if (!$notify->updateJSON_Data($params)) {
    Ajax::outputError('Could not update json params.');
}
//doar pe ON se mai poate pune
$notify->id = $id;
$notify->state = $state == 'ON';
$notify->save();
開發者ID:robertpop,項目名稱:NS,代碼行數:23,代碼來源:enable-notification.php

示例14: isset

<?php

Ajax::requireLoggedIn();
$hash = isset($_POST['hash']) ? trim($_POST['hash']) : trim($_GET['hash']);
$field = isset($_POST['field']) ? trim($_POST['field']) : trim($_GET['field']);
$value = isset($_POST['value']) ? trim($_POST['value']) : trim($_GET['value']);
$notify = Notify::getByHash($hash);
if (empty($notify->id) || !$notify->hasAccess()) {
    Ajax::outputError('You don\'t have access to this notification');
}
$content = json_decode($notify->getJSONContent(), true);
$content['configs']['params'][$field] = $value;
$notifyJSON = $notify->updateJSON_Data($content);
if ($notifyJSON) {
    Ajax::output($notifyJSON);
} else {
    Ajax::outputError('Internal server error. Try again later');
}
開發者ID:robertpop,項目名稱:NS,代碼行數:18,代碼來源:update-value.php

示例15:

<?php

SnacktoolsUserApi::logout();
Ajax::output('Success');
開發者ID:robertpop,項目名稱:NS,代碼行數:4,代碼來源:logout.php


注:本文中的Ajax::output方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。