本文整理汇总了PHP中getCalendar函数的典型用法代码示例。如果您正苦于以下问题:PHP getCalendar函数的具体用法?PHP getCalendar怎么用?PHP getCalendar使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getCalendar函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: printCalendarContents
function printCalendarContents($client)
{
putTitle('These are you events for ' . getCalendar($client, $_GET['showThisCalendar'])['summary'] . ' calendar:');
foreach (retrieveEvents($client, $_GET['showThisCalendar']) as $event) {
print '<div style="font-size:10px;color:grey;">' . date('Y-m-d H:m', strtotime($event['created']));
putLink('?showThisEvent=' . htmlentities($event['id']) . '&calendarId=' . htmlentities($_GET['showThisCalendar']), $event['summary']);
print '</div>';
print '<br>';
}
}
示例2: getBlockCode_Results
function getBlockCode_Results($iBlockID)
{
$sAction = strip_tags($_GET['action']);
switch ($sAction) {
case 'browse':
$sCode = getProfilesByDate($_GET['date']);
break;
default:
$sCode = getCalendar();
}
return $sCode;
}
示例3: XAJAX_showCalendar
function XAJAX_showCalendar($m, $j, $f)
{
if (empty($m)) {
$m = date('n');
}
if (empty($j)) {
$j = date('Y');
}
$objResponse = new xajaxResponse();
$content = '<table border="0" cellpadding="1" cellspacing="1" class="border"><tr><td class="Cnorm"><a href="javascript:close' . $f . '();">schliessen</a></td></tr></table>';
$content .= getCalendar($m, $j, 'javascript:void(0);" onclick="set' . $f . '(\'{jahr}-{mon}-{tag}\')', 'javascript:void(0);" onclick="xajax_XAJAX_showCalendar({mon},{jahr},\'' . $f . '\')', '');
$objResponse->assign('skalender' . $f, 'style.display', 'block');
$objResponse->assign('skalender' . $f, 'innerHTML', $content);
// return object
return $objResponse;
}
示例4: getBlogContentForCoverPage
function getBlogContentForCoverPage()
{
global $blogid, $blog, $service, $stats, $skinSetting;
global $pd_category, $pd_categoryXhtml, $pd_archive, $pd_calendar, $pd_tags, $pd_notices, $pd_recentEntry;
global $pd_recentComment, $pd_recentTrackback, $pd_link, $pd_authorList;
$categories = getCategories($blogid);
$totalPosts = getEntriesTotalCount($blogid);
$pd_category = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true);
$pd_categoryXhtml = getCategoriesView($totalPosts, $categories, isset($category) ? $category : true, true);
$pd_archive = getArchives($blogid);
$pd_calendar = getCalendarView(getCalendar($blogid, true));
$pd_tags = getRandomTags($blogid);
$pd_notices = getNotices($blogid);
$pd_recentEntry = getRecentEntries($blogid);
$pd_recentComment = getRecentComments($blogid);
$pd_recentTrackback = getRecentTrackbacks($blogid);
$pd_link = getLinks($blogid);
$pd_authorList = User::getUserNamesOfBlog($blogid);
}
示例5: while
}
}
$result = $conn->query($sql);
while ($r = $result->fetch_assoc()) {
$rows[] = array('data' => $r);
}
}
$conn->close();
return $rows;
}
if (isset($_GET["action"])) {
switch ($_GET["action"]) {
case "search":
$rows = searchEvent($_GET["criteria"]);
break;
case "sort":
$rows = sortEvent($_GET["criteria"], $_GET["order"]);
break;
case "filter":
$rows = filterEvent($_GET["year"], $_GET["month"], $_GET["target"], $_GET["location"]);
break;
case "calendar":
$rows = getCalendar($_GET["year"], $_GET["month"]);
break;
}
exit(json_encode($rows));
} else {
$rows = putCSV($_FILES['csv']['tmp_name']);
header("Location: " . $_SERVER['HTTP_REFERER']);
exit;
}
示例6: isset
if ($_SERVER["REQUEST_METHOD"] == "GET" && isset($_GET['origin']) && isset($_GET['destination'])) {
require_once "../as/aviasales.php";
$origin = $_GET['origin'];
$dest = $_GET['destination'];
$compare = isset($_GET['compare']) ? (100 - $_GET['compare']) / 100 : 0.85;
echo 'Highlighted <span class="highlighted">' . (1 - $compare) * 100 . '%+</span> below average<br><br>';
$originIata = getCityCode($origin);
$destIata = getCityCode($dest);
$dates = array('2015-09', '2015-10', '2015-11', '2015-12', '2016-01', '2016-02', '2016-03', '2016-03');
//$dates = array('2016-02');
echo 'From: ' . $origin . '</br> To: ' . $dest . '</br></br>';
//Table header
echo '<table>';
echo '<tr><th>Date</th><th>Price</th><th>Average</th><th>Transfers</th><th>Return at</th><th>Link</th></tr>';
foreach ($dates as $date) {
$calendar = getCalendar($originIata, $destIata, $date);
$average = getAverage($originIata, $destIata, $date);
if (array_key_exists('success', $calendar) && $calendar['success'] == 1 && array_key_exists('data', $calendar)) {
$color = false;
foreach ($calendar['data'] as $day => $data) {
if ($color) {
echo '<tr class="colored">';
} else {
echo '<tr>';
}
$color = !$color;
$tdHighlited = $data['price'] / $average < $compare ? '<td class="highlighted">' : '<td>';
$link = getSearchLink($originIata, $destIata, $day, substr($data['return_at'], 0, 10));
echo '<td>' . $day . '</td>' . $tdHighlited . $data['price'] . '</td>';
echo '<td>' . round($average) . '</td>';
echo '<td>' . $data['transfers'] . '</td><td>' . $data['return_at'] . '</td>';
示例7: json_encode
echo json_encode($result);
});
$app->post('/huolto', function () {
$result = updateHuolto($_POST["id"], $_POST["username"], $_POST["password"], $_POST["tekija"], $_POST["pvm"], $_POST["huom"], $_POST["huoltotarve"]);
echo json_encode($result);
});
$app->post('/kompoedit', function () {
$result = editKompo($_POST["id"], $_POST["malli"], $_POST["tyyppi"], $_POST["valmistaja"], $_POST["myyja"], $_POST["tarkvali"], $_POST["selite"]);
echo json_encode($result);
});
$app->get('/getcalendar/:month', function ($month) {
$result = getCalendar($month);
echo json_encode($result);
});
$app->get('/getcalendar/:month/pretty', function ($month) {
$result = getCalendar($month);
echo "<pre>";
echo json_encode($result, JSON_PRETTY_PRINT);
echo "</pre>";
});
$app->get('/daymodal/:date', function ($date) {
$result = getDayView($date);
echo json_encode($result);
});
$app->get('/daymodal/:date/pretty', function ($date) {
$result = getDayView($date);
echo "<pre>";
echo json_encode($result, JSON_PRETTY_PRINT);
echo "</pre>";
});
$app->get('/huoltodata/:huoltoid', function ($huoltoid) {
示例8: getEntriesTotalCount
$totalPosts = getEntriesTotalCount($blogid);
$categories = getCategories($blogid);
if (preg_match("@\\[##_category_##\\]@iU", $view)) {
dress('category', getCategoriesView($totalPosts, $categories, isset($category) ? $category : true), $view, false, true);
}
if (preg_match("@\\[##_category_list_##\\]@iU", $view)) {
dress('category_list', getCategoriesView($totalPosts, $categories, isset($category) ? $category : true, true), $view, false, true);
}
dress('count_total', $stats['total'], $view);
dress('count_today', $stats['today'], $view);
dress('count_yesterday', $stats['yesterday'], $view);
if (preg_match("@\\[##_archive_rep_##\\]@iU", $view)) {
dress('archive_rep', getArchivesView(getArchives($blogid), $skin->archive), $view, false, true);
}
if (preg_match("@\\[##_calendar_##\\]@iU", $view)) {
dress('calendar', getCalendarView(getCalendar($blogid, isset($period) ? $period : true)), $view, false, true);
}
if (preg_match("@\\[##_random_tags_##\\]@iU", $view)) {
dress('random_tags', getRandomTagsView(getRandomTags($blogid), $skin->randomTags), $view, false, true);
}
if (preg_match("@\\[##_rct_notice_##\\]@iU", $view)) {
$noticeView = getRecentNoticesView(getRecentNotices($blogid), $skin->recentNotice, $skin->recentNoticeItem);
dress('rct_notice', $noticeView, $view, false, true);
}
if (preg_match("@\\[##_rct_page_##\\]@iU", $view)) {
$pageView = getRecentPagesView(getPages($blogid), $skin->recentPage, $skin->recentPageItem);
dress('rct_page', $pageView, $view, false, true);
}
if (preg_match("@\\[##_author_rep_##\\]@iU", $view)) {
dress('author_rep', getAuthorListView(User::getUserNamesOfBlog($blogid), $skin->authorList), $view, false, true);
}
示例9: foreach
echo '<table>';
echo '<tr><th>Origin</th><th>Destination</th><th>Date</th><th>Days</th><th>Return at</th><th>Price</th><th>Average</th><th>Link</th></tr>';
$month = '';
foreach ($origins as $origin) {
foreach ($destinations as $destination) {
foreach ($weekends as $weekend) {
foreach (array('Friday', 'Saturday') as $day) {
//Get IATA codes
$originIata = getCityCode($origin);
$destIata = getCityCode($destination['destination_name']);
if ($originIata && $destIata) {
//Define average rate for dest/month
$curMonth = date('Y-m', strtotime($weekend['Friday']));
if ($month != $curMonth) {
$month = $curMonth;
$calendar = getCalendar($originIata, $destIata, $curMonth);
$average = round(getAverageFromCalendar($calendar));
}
$cheap = getCheap($originIata, $destIata, $weekend[$day], $weekend['Sunday']);
if (array_key_exists('success', $cheap) && true == $cheap['success'] && array_key_exists('data', $cheap) && array_key_exists($destIata, $cheap['data'])) {
//loop through variants
foreach ($cheap['data'][$destIata] as $variant) {
$departure_at = date('Y-m-d H:i', strtotime($variant['departure_at']));
$return_at = date('Y-m-d H:i', strtotime($variant['return_at']));
$expires_at = $variant['expires_at'];
$airline = $variant['airline'];
$flight_number = $variant['flight_number'];
$price = $variant['price'];
$dest = $destination['destination_name'];
//Count trip duration
$day1 = new DateTime($weekend[$day]);
示例10: getCalendar
<?php
// Insert calendar
if (isset($_POST["formsub"])) {
$day = $_POST["day"];
$calendar_id = $_POST['calendar_name'];
// get holiday list
$result = getCalendar($calendar_id, $db);
// get calendar year
$year = getCalendarYear($calendar_id, $db);
// check if given year is leap year or not
if (calLeapYear($year)) {
$dayspermonth[1] = 29;
}
// build holiday list
for ($c = 0; $c < count($result); $c++) {
$mm[] = $result[$c]['caltp_month'] . "." . $result[$c]['caltp_day'] . ":" . $result[$c]['caltp_holiday'];
}
// loop month
for ($m = 1; $m <= $month; $m++) {
// loop days of the month
for ($d = 1; $d <= $dayspermonth[$m - 1]; $d++) {
// add holiday
$event = "nothing special";
$status = $day == 1 || $day == 2 ? "0" : "1";
#determind date is 1:saturday or 2:sunday
// add special holiday
for ($e = 0; $e < count($mm); $e++) {
$holidays = explode(":", $mm[$e]);
if ($holidays[0] == $m . "." . $d) {
$status = 0;
示例11: getCalendar
}
}
</style>
</head>
<body>
<div id="wrapper">
<?php
$startMonth = 8;
$endMonth = 12;
for ($s = $startMonth; $s <= $endMonth; $s++) {
echo getCalendar($s, '2015');
}
?>
</div>
<script src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script>
$('<div />')
.append('<p>Width: '+ $(document.body).outerWidth() +' height: '+ $(document.body).outerHeight() +'</p>')
.prependTo(document.body);
</script>
</body>
</html>
示例12: defined
<?php
# Copyright by Manuel
# Support www.ilch.de
defined('main') or die('no direct access');
$m = date('n');
$j = date('Y');
$where1 = mktime(0, 0, 0, $m, 1, $j);
$where2 = mktime(24, 0, 0, $m, date('t', $where1), $j);
$data = array();
$result = db_query('SELECT *
FROM prefix_kalender
WHERE (time > ' . $where1 . ' AND time < ' . $where2 . ')
AND ' . $_SESSION['authright'] . ' <= recht
ORDER BY time LIMIT 50');
while ($row = db_fetch_assoc($result)) {
$t_id = $row['id'];
$t_d = date('j', $row['time']);
$t_m = date('n', $row['time']);
$t_y = date('Y', $row['time']);
$date = mktime(0, 0, 0, $t_m, $t_d, $t_y);
$data[$date][] = $row;
}
echo getCalendar($m, $j, '?kalender-v1-m{mon}-y{jahr}-d{tag}', '?kalender-v0-m{mon}-y{jahr}', $data, 1);
示例13: elseif
}
//Ganze Liste
} elseif (isset($data)) {
$i = 1;
foreach ($data as $date => $data1) {
$text = '';
foreach ($data1 as $info) {
$text .= '<a href="?kalender-v' . $view . '-e' . $info['id'] . '">' . $info['title'] . '</a>; ';
}
$aus['LIST_I'] = date('d.m.Y', $date);
$aus['LIST_D'] = $arr_day[date('w', $date)];
$aus['LIST_T'] = $text;
$class = $i % 2 ? 'Cnorm' : 'Cmite';
$aus['LIST_CLASS'] = $i + 1 == date('j') && $month == date('n') && $year == date('Y') ? 'Cdark' : $class;
$tpl->set_ar_out($aus, 1);
unset($aus);
$i++;
}
} else {
$aus['LIST_I'] = '-';
$aus['LIST_D'] = '-';
$aus['LIST_T'] = '-';
$aus['LIST_CLASS'] = 'Cnorm';
$tpl->set_ar_out($aus, 1);
unset($aus);
}
}
# kalender
$tpl->set('calender', getCalendar($month, $year, 'index.php?kalender-v1-m{mon}-y{jahr}-d{tag}', 'index.php?kalender-v' . $view . '-m{mon}-y{jahr}', $data));
$tpl->out(3);
$design->footer();
示例14: getAverage
function getAverage($origin, $destination, $departDate)
{
return getAverageFromCalendar(getCalendar($origin, $destination, $departDate));
}
示例15: sec_session_start
include_once "../lib/ini.setting.php";
include_once "ini.config.php";
include_once "ini.dbstring.php";
include_once "ini.functions.php";
sec_session_start();
include_once "mod.login.php";
// check user role and authentication
checkSession($_SESSION['sess_user_role']);
checkLogin("admin", $_SESSION['sess_user_role']);
include_once "mod.admin.php";
include_once "mod.calendar.php";
include_once "ctrl.checklogin.php";
include_once "ctrl.admin.php";
include_once "ctrl.calendar.php";
if (isset($_GET['cid'])) {
$tmpl = getCalendar($_GET['cid'], $db);
}
?>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Kinntai system</title>
<link href="<?php
echo CSS;
?>
/import.css" rel="stylesheet" type="text/css"/>
<script src="<?php
echo JS;
?>
/jquery.min.js"></script>
</head>