当前位置: 首页>>代码示例>>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;未经允许,请勿转载。