本文整理汇总了PHP中DBAccess::getEventRange方法的典型用法代码示例。如果您正苦于以下问题:PHP DBAccess::getEventRange方法的具体用法?PHP DBAccess::getEventRange怎么用?PHP DBAccess::getEventRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBAccess
的用法示例。
在下文中一共展示了DBAccess::getEventRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: date
<?php
include_once '../scripts/DBAccess.php';
$month = date('m');
$year = date('Y');
$endmonth = $month + 1;
$endyear = $year;
$endmonth2 = $month + 2;
$endyear2 = $year;
if ($endmonth > 12) {
$endmonth = 1;
$endyear = $endyear + 1;
}
if ($endmonth2 > 12) {
$endmonth2 = 2;
$endyear2 = $endyear2 + 1;
}
$eventResult = DBAccess::getEventRange(1, $year . "-" . $month . "-01", $endyear . "-" . $endmonth . '-01');
$rows = count($eventResult, 0);
echo "<table class=\"eventsTable\" style=\"text-align:left;\">";
for ($i = 0; $i < $rows; $i++) {
echo "<tr style=\"color:#" . $eventResult[$i]['EventColour'] . ";\">\n\t<td>" . $eventResult[$i]['EventName'] . ", ";
if (ord($eventResult[$i]['Active']) == 1) {
echo date('D j', strtotime($eventResult[$i]['EventDate'])) . ",\n\t\t\t " . date('g:iA', strtotime($eventResult[$i]['EventTime'])) . "";
} else {
echo ", TBC";
}
echo "</tr>";
}
echo "</table>";
示例2: count
<?php
include_once '../scripts/DBAccess.php';
$year = $_GET['year'];
$eventType = $_GET['type'];
$content = "";
if (is_numeric($year) && is_numeric($eventType)) {
$eventResult = DBAccess::getEventRange($eventType, $year . "-01-01", $year . "-12-31");
$rows = count($eventResult, 0);
if ($rows == 0) {
$content = "<h3>No events have been found</h3>";
} else {
$content = "\n\t\t\n\t\t\n\t\t<div class='container2'>\n\t\t<table class=\"eventsTable\" cellspacing=\"0\">\n\t\t<tr>\n\t\t<th style=\"width:11%\">Date</th>\n\t\t<th style=\"width:12%\">Time</th>\n\t\t<th style=\"width:30%\">Event Name</th>\n\t\t<th style=\"width:47%\">Description</th>\n\t\t</tr>\n\t\t";
for ($i = 0; $i < $rows; $i++) {
$thing = "";
if (date('n', strtotime($eventResult[$i]['EventDate'])) % 2 == 0) {
//echo (date('M', strtotime($eventResult[$i]['EventDate'])));
$thing = "background:rgba(120, 120, 120, 0.5);";
}
$content = $content . "<tr style=\"" . $thing . "; color:#" . $eventResult[$i]['EventColour'] . ";\">";
echo $eventResult[$i]['Active'];
if (ord($eventResult[$i]['Active']) == 1) {
$content .= "<td style=\"text-align:left;padding:10px;\">" . date('M, D j', strtotime($eventResult[$i]['EventDate'])) . "</td>\n\t\t\t\t\t <td>" . date('g:iA', strtotime($eventResult[$i]['EventTime'])) . "</td>";
} else {
$content .= "<td style=\"text-align:left;padding:10px;\">TBC</td><td>TBC</td>";
}
$content .= "<td style=\"text-align:left;padding:10px;\">" . $eventResult[$i]['EventName'] . "</td>\n\t\t\t\t <td>" . $eventResult[$i]['EventDescription'] . "</td> </tr>";
}
$content = $content . "</table></div>";
}
} else {