本文整理汇总了PHP中getHolidays函数的典型用法代码示例。如果您正苦于以下问题:PHP getHolidays函数的具体用法?PHP getHolidays怎么用?PHP getHolidays使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了getHolidays函数的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
function __construct($ynr, $nr)
{
if ($nr > 0 && $nr < 13) {
$this->monthNr = $nr;
$this->month = CswMonths::mon($nr);
}
if ($ynr > 10 && $ynr <= 30) {
$this->year = $ynr;
//calculate hollidays for current year
$h = getHolidays("20" . $ynr);
foreach ($h as $hday) {
$this->holidays[] = date("y-m-d", $hday->getDate());
$this->holidaysDesc[] = $hday->getDesc()['sv'];
}
}
}
示例2: grr_sql_free
grr_sql_free($res);
} else {
echo '<div class="row">' . PHP_EOL;
include "menu_gauche.php";
if ($_GET['pview'] != 1) {
echo '<div class="col-lg-9 col-md-12 col-xs-12">' . PHP_EOL;
echo '<div id="planning">' . PHP_EOL;
} else {
echo '<div id="print_planning">' . PHP_EOL;
}
include "chargement.php";
$ferie_true = 0;
$class = "";
$title = "";
if ($settings->get("show_holidays") == "Oui") {
$ferie = getHolidays($year);
$tt = mktime(0, 0, 0, $month, $day, $year);
foreach ($ferie as $key => $value) {
if ($tt == $value) {
$ferie_true = 1;
break;
}
}
$sh = getSchoolHolidays($tt, $year);
if ($sh['0'] == true) {
$class .= "vacance ";
$title = " " . $sh['1'];
}
if ($ferie_true) {
$class .= "ferie ";
}
示例3: mktime
for ($i = 0; $i < ConfigHelper::getConfig('phpui.timetable_days_forward'); $i++) {
$dt = mktime(0, 0, 0, $month, $day + $i, $year);
$daylist[$i] = $dt;
}
$date = mktime(0, 0, 0, $month, $day, $year);
$daysnum = date('t', $date);
for ($i = 1; $i < $daysnum + 1; $i++) {
$date = mktime(0, 0, 0, $month, $i, $year);
$days['day'][] = date('j', $date);
$days['dow'][] = date('w', $date);
$days['sel'][] = $i == $day;
}
$SESSION->save('backto', $_SERVER['QUERY_STRING']);
$SESSION->save('edate', sprintf('%04d/%02d/%02d', $year, $month, $day));
$today = mktime(0, 0, 0, date('n'), date('j'), date('Y'));
$SMARTY->assign('today', $today);
$SMARTY->assign('period', $DB->GetRow('SELECT MIN(date) AS fromdate, MAX(date) AS todate FROM events'));
$SMARTY->assign('eventlist', $eventlist);
$SMARTY->assign('listdata', $listdata);
$SMARTY->assign('days', $days);
$SMARTY->assign('day', $day);
$SMARTY->assign('daylist', $daylist);
$SMARTY->assign('month', $month);
$SMARTY->assign('year', $year);
$SMARTY->assign('date', $date);
$SMARTY->assign('userlist', $LMS->GetUserNames());
if (!ConfigHelper::checkConfig('phpui.big_networks')) {
$SMARTY->assign('customerlist', $LMS->GetCustomerNames());
}
$SMARTY->assign('getHolidays', getHolidays($year));
$SMARTY->display('event/eventlist.html');
示例4: array_push
$cur_day = $row[2];
$new_day = $row[3];
// echo $date." ".$new_day."<br>";
array_push($swap_days, [$date, $new_day]);
}
}
fclose($file);
return $swap_days;
}
//getHolidays("time_tables/holidays.csv");
//getSwapDays("time_tables/daySwap.csv");
function loadHolidays($holidays)
{
// $timezone = 'Asia/Kolkata';
date_default_timezone_set('Asia/Kolkata');
$conn = dbConnect();
foreach ($holidays as $holiday) {
$date = explode("-", $holiday[0]);
$day = $date[2];
$month = $date[1];
$year = $date[0];
$timestamp = mktime(12, 0, 0, $month, $day, $year);
$des = str_replace("'", "\\'", $holiday[1]);
echo $holiday[0] . ", " . date('d-m-y', $timestamp) . ", " . date('l dS \\o\\f F Y h:i:s A', $timestamp) . "<br>";
$sql = "INSERT INTO `mrbs_holidays`(`date`,`description`) VALUES('{$timestamp}','{$des}')";
$query = $conn->query($sql);
}
$conn->close();
}
loadHolidays(getHolidays("time_tables/holidays.csv"));
示例5: show_holidays
function show_holidays($year, $fromyear, $toyear, $flagdays = false, $lang = 'sv')
{
if ($fromyear != 0 and $toyear != 0) {
$hdays = array();
for ($yr = $fromyear; $yr <= $toyear; $yr++) {
$hd = getHolidays($yr, $flagdays);
$hdays = array_merge($hdays, $hd);
}
} else {
$hdays = getHolidays($year, $flagdays);
}
// Hämta helgdagarna
$rows = array();
$hasbad = false;
foreach ($hdays as $hd) {
$rows[] = $hd->mkrow($flagdays, $lang);
if ($hd->date <= 0) {
$hasbad = true;
break;
}
}
if ($hasbad) {
$last = getdate((1 << 30) + (1 << 29) + ((1 << 29) - 1));
// 2^31-1
$lyear = $last['year'] - 1;
if ($lang == 'sv') {
return '<p style="color: blue">Kanske har du angivit ett för sent
eller för tidigt årtal för detta datorsystem? Prova mellan
' . date("Y", 0) . ' och ' . $lyear . '.</p>';
} else {
return '<p style="color: blue">Perhaps you have a too late or too early year for this computer system? Try one between ' . date("Y", 0) . ' and ' . $lyear . '.</p>';
}
} else {
return '<table border="1" class="nobg">' . "<tr><th class=\"nobg\">" . ($lang == 'sv' ? $flagdays ? "Dag" : "Helgdag" : ($flagdays ? 'Day' : 'Holiday')) . "</th><th\nclass=\"nobg\">" . ($lang == 'sv' ? "Datum" : 'Date') . "</th>" . ($flagdays ? $lang == 'sv' ? "<th>Flaggdag</th>" : '<th>Flag day</th>' : "") . "</tr>\n" . implode("\n", $rows) . "\n</table>\n";
}
}
示例6: getStafflyWorkHoursList
function getStafflyWorkHoursList()
{
$query = "\n\t\t\tSELECT staff.name AS staff_name,SUM(IF(hours_checked IS NULL,hours_own,hours_checked)) AS sum,\n\t\t\t\tROUND(SUM(IF(hours_checked IS NULL,hours_own,hours_checked))/" . getWorkingDays(option('date_range/from'), option('date_range/to'), getHolidays(), getOvertimedays(), false) . ",2) AS avg\n\t\t\tFROM schedule INNER JOIN people staff ON staff.id=schedule.uid\n\t\t\tWHERE completed=1 AND schedule.display=1\n\t\t";
$query = $this->dateRange($query, 'start', true);
$query .= "\tGROUP BY schedule.uid\n\t\t";
$query = $this->orderBy($query, 'sum', 'DESC');
return $this->db->query($query)->result_array();
}
示例7: date
*
*/
if (!defined('e107_INIT')) {
exit;
}
require_once e_PLUGIN . 'dateplus/_class.php';
$pref = e107::pref('dateplus');
$tp = e107::getParser();
$sc = e107::getScBatch('dateplus', true);
$template = e107::getTemplate('dateplus');
$curMonth = date('n');
$curDay = date('j');
$hs = hanukkahStart();
$he = hanukkahStart() + 691200;
$text = "";
$holidays = getHolidays($curMonth, $curDay);
foreach ($holidays as $holiday) {
$holiray[] = array($holiday[0], $holiday[1], $holiday[2]);
}
if ($pref['enableUserdays'] == true) {
$userdays = getUserdays($curMonth, $curDay);
foreach ($userdays as $userday) {
$holiray[] = array($userday[0], $userday[1], $userday[2]);
}
}
if (date('j/n/Y', $hs) == date('j/n/Y')) {
$holiray[] = array('Hanukkah starts', date('n', $hs), date('j', $hs));
}
if (date('j/n/Y', $he) == date('j/n/Y')) {
$holiray[] = array('Hanukkah ends', date('n', $he), date('j', $he));
}
示例8: array
$day_counter = 0;
$dates_array = array();
$calendar .= '
</tr>
</thead>
<tbody>
<tr>';
for ($x = 0; $x < $running_day; $x++) {
$calendar .= '
<td style="height: 200px;"></td>';
$days_in_this_week++;
}
for ($list_day = 1; $list_day <= $days_in_month; $list_day++) {
$style = $list_day == date('j') ? 'primary' : 'default';
$ec = 0;
$holidays = getHolidays($month, $list_day);
foreach ($holidays as $holiday) {
$event .= '<p class="small">' . $holiday[0] . '</p>';
$ec++;
}
if ($pref['enableUserdays'] == true) {
$userdays = getUserdays($month, $list_day);
foreach ($userdays as $userday) {
$event .= '<p class="small">' . $userday[0] . '</p>';
$ec++;
}
}
$hs = hanukkahStart();
$he = hanukkahStart() + 691200;
if (date('j/n/Y', $hs) == $list_day . '/' . $month . '/' . $year) {
$event .= '<p class="small">Hanukkah starts</p>';
示例9: storeTT
function storeTT($TimeTable, $start, $end)
{
$conn = dbConnect();
$holidays = getHolidays();
$RoomIds = loadRoomIds();
$date = $start;
$swaps = getSwapDays("time_tables/daySwap.csv");
// print "End: ".$end."<br>";
while ($end >= $date) {
if (in_array($date, $holidays)) {
echo "Holiday: " . $date . "<br>";
// continue;
} else {
if (in_array($date, $swaps[0])) {
$i = array_search($date, $swaps[0]);
$day = $swaps[1][$i];
print "DaySwap: " . $date . "<br>";
} else {
$day = date("D", strtotime($date));
}
$daySchedule = $TimeTable[$day];
// print "<br> Before: ".$date.", ".$day."<br>";
foreach ($daySchedule as $values) {
$room = $values[0];
$roomId = $RoomIds[$room];
// print count($values[1])."<br>";
foreach ($values[1] as $value) {
// print "here..";
$course = trim($value[0], " \t\n\r\v");
$start_hour = date('H', strtotime($value[1]));
$start_min = date('i', strtotime($value[1]));
$end_hour = date('H', strtotime($value[2]));
$end_min = date('i', strtotime($value[2])) + date("i", strtotime('00:10:00'));
$s = mktime($start_hour, $start_min, 0, date("n", strtotime($date)), date("j", strtotime($date)), date("Y", strtotime($date)));
$e = mktime($end_hour, $end_min, 0, date("n", strtotime($date)), date("j", strtotime($date)), date("Y", strtotime($date)));
$sql = "INSERT INTO `mrbs_entry`(`start_time`, `end_time`,`room_id`,`name`, `type`, `description`)\n\t\t\t\t\t\t\tVALUES ('{$s}','{$e}','{$roomId}','{$course}','I','Regular Class')";
$conn->query($sql);
}
}
}
$date = date("Y-m-d", strtotime("+1 day", strtotime($date)));
// print "After: ".$date."<br>";
}
$conn->close();
}