本文整理汇总了PHP中render_ajax函数的典型用法代码示例。如果您正苦于以下问题:PHP render_ajax函数的具体用法?PHP render_ajax怎么用?PHP render_ajax使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了render_ajax函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: isset
$tournament = $discipline->get_tournament();
$season = $tournament->get_season();
$player = null;
$player_club = null;
$partner = null;
$partner_club = null;
if (!empty($_POST['player'])) {
$player = $season->get_player_by_input($_POST['player']);
if (!empty($_POST['player_club'])) {
$player_club = $season->get_club_by_input($_POST['player_club']);
}
}
if (!empty($_POST['partner'])) {
$partner = $season->get_player_by_input($_POST['partner']);
if (!empty($_POST['partner_club'])) {
$partner_club = $season->get_club_by_input($_POST['partner_club']);
}
}
$email = isset($_POST['email']) ? $_POST['email'] : null;
$seeding = isset($_POST['seeding']) ? $_POST['seeding'] : null;
$memo = isset($_POST['memo']) ? $_POST['memo'] : null;
try {
$discipline->check_entry($player, $partner);
} catch (utils\InvalidEntryException $iee) {
render_ajax_error('Meldung kann nicht angenommen werden: ' . $iee->getMessage());
exit;
}
$entry = Entry::create($discipline, $player, $player_club, $partner, $partner_club, $email, $seeding, $memo);
$entry->save();
render_ajax('d/' . $discipline->id . '/', ['entry' => $entry]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:30,代码来源:entry_add.php
示例2: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_post_params(['name', 'season_id']);
$season = Season::by_id($_POST['season_id']);
try {
$tournament = Tournament::create($season, $_POST['name']);
$tournament->save();
} catch (utils\DuplicateEntryException $e) {
render_ajax_error('Ein Turnier mit dem Namen "' . $_POST['name'] . '" existiert bereits');
exit;
}
render_ajax('t/' . $tournament->id . '/', ['season' => $season, 'tournament' => $tournament]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:18,代码来源:tournament_create.php
示例3: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
require_once dirname(__DIR__) . '/src/sftp.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['publication_id']);
utils\require_post_params(['type']);
$publication_type = $_POST['type'];
$tournament = Tournament::by_id($_GET['tournament_id']);
$season = $tournament->get_season();
switch ($publication_type) {
case 'sftp':
utils\require_post_params(['server', 'port', 'user', 'path']);
$publication = sftp\SFTPPublication::sftp_create($tournament, $_POST['server'], \intval($_POST['port']), $_POST['user'], $_POST['path']);
$publication->save();
render_ajax('t/' . $tournament->id . '/publication/' . $publication->id . '/', ['publication' => $publication]);
break;
default:
throw new \Exception('Invalid publication type');
}
开发者ID:nishad,项目名称:bmtmgr,代码行数:24,代码来源:publication_edit.php
示例4: User
$imported_clubs = [];
$not_found_since = 0;
Model::beginTransaction();
for ($i = 1; $i < 100000; $i++) {
$url = \sprintf($url_pattern, $i);
$page = \file_get_contents($url);
$r = \preg_match('/
<label>ClubID:<\\/label><div>(?P<id>[0-9-]+)<\\/div>.*
<label>Vereinsname:<\\/label><div>(?P<name>[^<]+)<\\/div>.*
<label>Email:<\\/label><div><a.*?>(?P<email>[^<]+)<\\/a>
/xs', $page, $m);
if (!$r) {
$not_found_since++;
if ($not_found_since > 100) {
break;
}
continue;
}
$id = \html_entity_decode($m['id'], ENT_QUOTES | ENT_HTML5, 'utf-8');
$name = \html_entity_decode($m['name'], ENT_QUOTES | ENT_HTML5, 'utf-8');
$email = \html_entity_decode($m['email'], ENT_QUOTES | ENT_HTML5, 'utf-8');
$c = User::by_id_optional($id);
if (!$c) {
$c = new User($id, $name, $email, ['register']);
$c->save();
\array_push($imported_clubs, $c);
}
}
Model::commit();
render_ajax('club/', ['imported_clubs' => $imported_clubs]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:30,代码来源:club_import.php
示例5: gettext
{
global $config;
if (!isset($config['hast']['enable'])) {
return gettext("HAST disabled");
}
$cmd = "/sbin/hastctl status";
if (isset($_GET['name'])) {
$cmd .= " {$_GET['name']}";
}
$cmd .= " 2>&1";
mwexec2($cmd, $rawdata);
return implode("\n", $rawdata);
}
if (is_ajax()) {
$status = hast_get_status();
render_ajax($status);
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
var gui = new GUI;
gui.recall(0, 5000, 'services_hast_info.php', null, function(data) {
$('#hast_status').text(data.data);
});
});
//]]>
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabnavtbl">
开发者ID:sdoney,项目名称:nas4free,代码行数:31,代码来源:services_hast_info.php
示例6: get_conf_all_disks_list_filtered
$cfdevice = "/dev/{$cfdevice}";
// Get list of all configured disks (physical and virtual).
$a_disk = get_conf_all_disks_list_filtered();
function get_fs_type($devicespecialfile)
{
global $a_disk;
$index = array_search_ex($devicespecialfile, $a_disk, "devicespecialfile");
if (false === $index) {
return "";
}
return $a_disk[$index]['fstype'];
}
if (is_ajax()) {
$devfile = $_GET['devfile'];
$fstype = get_fs_type($devfile);
render_ajax($fstype);
}
function filter_disk($array)
{
return array_filter($array, function ($diskv) {
if (0 != strcmp($diskv['size'], "NA") && 1 != disks_exists($diskv['devicespecialfile'])) {
return $diskv;
}
});
}
// Advanced Format
$pconfig['aft4k'] = $aft4k = false;
$do_format = array();
$disks = array();
$type = 'zfs';
$minspace = '';
开发者ID:BillTheBest,项目名称:OpenNAS,代码行数:31,代码来源:disks_init.php
示例7: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['id', 'action']);
$season = Season::by_id($_GET['id']);
switch ($_GET['action']) {
case 'hide':
case 'show':
$season->visible = $_GET['action'] == 'show';
$season->save();
render_ajax('season/' . $season->id . '/', ['season' => $season]);
break;
default:
header('HTTP/1.1 404 Not Found');
render('error', ['title' => 'Unbekannte Aktion', 'msg' => 'Entschuldigung, wir haben eine Adresse falsch eingetragen. Die Aktion "' . $_GET['action'] . '" ist nicht implementiert.']);
}
开发者ID:nishad,项目名称:bmtmgr,代码行数:21,代码来源:season_actions.php
示例8: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['player_id']);
$player = Player::by_id($_GET['player_id']);
utils\require_post_params(['email']);
$player->email = $_POST['email'];
$player->save();
render_ajax('player/' . $player->id . '/', ['player' => $player]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:14,代码来源:player_edit.php
示例9: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['discipline_id']);
utils\require_post_params(['note', 'capacity']);
$discipline = Discipline::by_id($_GET['discipline_id']);
$discipline->capacity = $_POST['capacity'] !== '' ? \intval($_POST['capacity']) : null;
$discipline->note = $_POST['note'];
$discipline->save();
render_ajax('d/' . $discipline->id . '/', ['discipline' => $discipline]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:15,代码来源:discipline_update.php
示例10: User
if (!$club) {
$club = new User($m['id'], $m['name'], null, ['register']);
$club->save();
}
$players_url = $base_url . 'clubplayers.aspx' . $m['club_path'] . '&cid=' . $m['club_num'];
$players_page = \file_get_contents($players_url);
$genders = ['Männer' => 'm', 'Frauen' => 'f'];
if (!\preg_match_all('#<caption>\\s*(?<gender_str>Männer|Frauen)\\s*</caption><thead>(?P<table>.*?)</tbody>#s', $players_page, $player_table_m, \PREG_SET_ORDER)) {
continue;
// Some clubs don't have any players associated with them (because of merger etc.)
}
foreach ($player_table_m as $table_m) {
$g = $genders[$table_m['gender_str']];
$table = $table_m['table'];
preg_match_all('#
<td\\s+id="playercell"><a\\s+href="[^"]+">(?P<name>[^<]+)</a></td>
<td\\s+class="flagcell">(?:<img.*?/><span[^>]*>\\[(?P<nationality>[A-Z]+)\\]\\s*</span>)?</td>
<td>(?P<textid>[^>]+)</td>
<td>(?P<birth_year>[0-9]{4})</td>#xs', $table, $matches, \PREG_SET_ORDER);
foreach ($matches as $m) {
if (Player::exists($season, $m['textid'])) {
continue;
}
$p = new Player(['id' => null, 'season_id' => $season->id, 'club_id' => $club->id, 'textid' => $m['textid'], 'name' => $m['name'], 'gender' => $g, 'birth_year' => \intval($m['birth_year']), 'nationality' => $m['nationality'], 'email' => null, 'phone' => null], true);
$p->save();
}
}
}
Model::commit();
render_ajax('season/' . urlencode($season->id) . '/', ['season' => $season]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:30,代码来源:season_import.php
示例11: render_web
render_web($error, 'info');
}
} catch (\Lazyphp\Core\RestException $e) {
$class_array = explode('\\', get_class($e));
$class = t(end($class_array));
$prefix = strtoupper(rremove($class, 'Exception'));
$error = get_error($prefix);
$error['message'] = $error['message'] . '- ' . $e->getMessage();
$error['created'] = date("Y-m-d H:i:s");
if (is_json_request() || c('api_server_only')) {
send_json($error);
} elseif (is_ajax_request()) {
render_ajax($error, 'info');
} else {
render_web($error, 'info');
}
} catch (\Exception $e) {
$class_array = explode('\\', get_class($e));
$class = t(end($class_array));
$prefix = strtoupper(rremove($class, 'Exception'));
$error = get_error($prefix);
$error['message'] = $error['message'] . '- ' . $e->getMessage();
$error['created'] = date("Y-m-d H:i:s");
if (is_json_request() || c('api_server_only')) {
send_json($error);
} elseif (is_ajax_request()) {
render_ajax($error, 'info');
} else {
render_web($error, 'info');
}
}
开发者ID:pingmalu,项目名称:LazyPHP4,代码行数:31,代码来源:lp.init.php
示例12: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['tournament_id']);
utils\require_post_params(['name', 'dtype']);
$tournament = Tournament::by_id($_GET['tournament_id']);
if ($_POST['dtype'] == 'all') {
$specs = [['name' => 'HE' . $_POST['name'], 'dtype' => 'MS'], ['name' => 'DE' . $_POST['name'], 'dtype' => 'WS'], ['name' => 'HD' . $_POST['name'], 'dtype' => 'MD'], ['name' => 'DD' . $_POST['name'], 'dtype' => 'WD'], ['name' => 'MX' . $_POST['name'], 'dtype' => 'MX']];
} else {
$specs = [['name' => $_POST['name'], 'dtype' => $_POST['dtype']]];
}
Model::beginTransaction();
foreach ($specs as $spec) {
try {
$discipline = Discipline::create($tournament, $spec['name'], $spec['dtype']);
$discipline->save();
} catch (utils\DuplicateEntryException $e) {
render_ajax_error(sprintf('Disziplin "%s" existiert bereits!', $spec['name']));
exit;
}
}
Model::commit();
render_ajax('d/' . $discipline->id . '/', ['tournament' => $tournament, 'disciplines' => $disciplines]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:28,代码来源:discipline_create.php
示例13: send_error
function send_error($type, $info = null, $force_json = false)
{
if ($error = get_error($type)) {
if ($info != null) {
$error['message'] = $error['message'] . ' -' . $info;
}
} else {
$error['message'] = $info;
}
//print_r( $error );
//send_json($error);
if (is_json_request() || $force_json) {
return send_json($error);
} elseif (is_ajax_request()) {
return render_ajax($error, 'info');
} else {
return render_web($error, 'info');
}
}
开发者ID:Rongya,项目名称:LazyPHP4,代码行数:19,代码来源:functions.php
示例14: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
require_once dirname(__DIR__) . '/src/sftp.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['tournament_id']);
utils\require_post_params(['type']);
$publication_type = $_POST['type'];
$tournament = Tournament::by_id($_GET['tournament_id']);
$season = $tournament->get_season();
switch ($publication_type) {
case 'sftp':
utils\require_post_params(['server', 'port', 'username', 'path']);
$publication = sftp\SFTPPublication::sftp_create($tournament, $_POST['server'], \intval($_POST['port']), $_POST['path'], $_POST['username']);
$publication->save();
render_ajax('publication/' . $publication->id . '/', ['publication' => $publication]);
break;
default:
throw new \Exception('Invalid publication type');
}
开发者ID:nishad,项目名称:bmtmgr,代码行数:24,代码来源:publication_create.php
示例15: render_ajax
$age_group = '';
break;
case 'U19':
if ($line['league'] == 'Mini') {
$age_group = 'U19-';
} else {
$age_group = 'J';
}
break;
}
$l = $age_group . $line['league'];
if (!\array_key_exists($l, $games_in_league)) {
$games_in_league[$l] = 0;
$wins_in_league[$l] = 0;
}
$games_in_league[$l]++;
if (\array_key_exists('won', $line)) {
$wins_in_league[$l]++;
}
$days[$line['date']] = $l;
}
if (\count($games_in_league) > 0) {
// For now, pick the league with the most games
$league = \bmtmgr\utils\array_max_key($games_in_league);
$player->league = $league;
$player->winrate = $wins_in_league[$league] / $games_in_league[$league];
$player->save();
}
}
render_ajax('t/' . $tournament->id . '/', ['tournament' => $tournament]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:30,代码来源:lookup_leagues.php
示例16: array
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Status"), gettext("Processes"));
function get_process_info()
{
exec("top -b", $result);
return implode("\n", $result);
}
if (is_ajax()) {
$procinfo = get_process_info();
render_ajax($procinfo);
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
var gui = new GUI;
gui.recall(0, 5000, 'status_process.php', null, function(data) {
$('#procinfo').val(data.data);
});
});
//]]>
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabcont">
开发者ID:rterbush,项目名称:nas4free,代码行数:30,代码来源:status_process.php
示例17: array
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("ZFS"), gettext("Pools"), gettext("I/O statistics"));
function zfs_zpool_get_iostat()
{
// Get zpool I/O statistic informations
$cmd = "zpool iostat -v 2>&1";
if (isset($_GET['pool'])) {
$cmd .= " {$_GET['pool']}";
}
mwexec2($cmd, $rawdata);
return implode("\n", $rawdata);
}
if (is_ajax()) {
$iostat = zfs_zpool_get_iostat();
render_ajax($iostat);
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
var gui = new GUI;
gui.recall(0, 5000, 'disks_zfs_zpool_io.php', null, function(data) {
$('#zfs_zpool_iostat').text(data.data);
});
});
//]]>
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="tabnavtbl">
开发者ID:rterbush,项目名称:nas4free,代码行数:31,代码来源:disks_zfs_zpool_io.php
示例18: array
The views and conclusions contained in the software and documentation are those
of the authors and should not be interpreted as representing official policies,
either expressed or implied, of the NAS4Free Project.
*/
require "auth.inc";
require "guiconfig.inc";
$pgtitle = array(gettext("Disks"), gettext("Software RAID"), gettext("RAID5"), gettext("Information"));
function get_raidinfo()
{
exec("/sbin/graid5 list", $rawdata);
return implode("\n", $rawdata);
}
if (is_ajax()) {
$raidinfo = get_raidinfo();
render_ajax($raidinfo);
}
include "fbegin.inc";
?>
<script type="text/javascript">//<![CDATA[
$(document).ready(function(){
var gui = new GUI;
gui.recall(0, 5000, 'disks_raid_graid5_info.php', null, function(data) {
$('#raidinfo').text(data.data);
});
});
//]]>
</script>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr><td class="tabnavtbl">
<ul id="tabnav">
开发者ID:sdoney,项目名称:nas4free,代码行数:30,代码来源:disks_raid_graid5_info.php
示例19: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['publication_id']);
$publication = Publication::by_id($_GET['publication_id']);
$tournament = $publication->get_tournament();
$publication->delete();
render_ajax('t/' . $tournament->id . '/', []);
开发者ID:nishad,项目名称:bmtmgr,代码行数:12,代码来源:publication_delete.php
示例20: dirname
<?php
namespace bmtmgr;
require_once dirname(__DIR__) . '/src/common.php';
utils\csrf_protect();
$u = user\check_current();
$u->require_perm('admin');
utils\require_get_params(['club_id', 'season_id']);
utils\require_post_params(['firstname', 'lastname', 'gender']);
$season = Season::by_id($_GET['season_id']);
$club = User::by_id($_GET['club_id']);
$name = \sprintf('%s, %s', $_POST['lastname'], $_POST['firstname']);
$textid = \str_replace(' ', '_', $club->name . '-' . $_POST['firstname'] . ' ' . $_POST['lastname']);
try {
$player = Player::create($season->id, $club->id, $textid, $name, $_POST['gender']);
$player->save();
} catch (utils\DuplicateEntryException $e) {
render_ajax_error(sprintf('Ein Spieler mit der Id "%s" existiert bereits', $textid));
exit;
}
render_ajax('season/' . $season->id . '/club/' . $club->id . '/', ['player' => $player]);
开发者ID:nishad,项目名称:bmtmgr,代码行数:22,代码来源:player_create.php
注:本文中的render_ajax函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论