当前位置: 首页>>代码示例>>PHP>>正文


PHP DBAccess::getEvents方法代码示例

本文整理汇总了PHP中DBAccess::getEvents方法的典型用法代码示例。如果您正苦于以下问题:PHP DBAccess::getEvents方法的具体用法?PHP DBAccess::getEvents怎么用?PHP DBAccess::getEvents使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DBAccess的用法示例。


在下文中一共展示了DBAccess::getEvents方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: realpath

<?php

$root = realpath($_SERVER["DOCUMENT_ROOT"]);
include_once $root . '/scripts/DBAccess.php';
$eventResult = DBAccess::getEvents(2);
$rows = count($eventResult, 0);
$title = 'School Nights';
$head = '<meta name="description" content="We cater for schools to give a fun, entertaining and educational night for grades 1 - 12">

	<script>
	 	function loadClubEvents(year)
		{
			GetDataForElement("school-events", "/includes/allEvents.php?type=2&year=" + year, "Loading school events for " + year);
		}
		
	</script>

';
$content = "\n<h1 class=\"heading\">School Field Nights</h1>\n\n<div class=\"container\">\n<h2 class=\"heading\">For Members</h2>\t\t\n<ul>\n<li>School Field Nights to be advised as they are organized. Contact Julie on 0411 047 439 or school@seqas.org</li>\n\n<li>Members with telescopes are encouraged to attend. These nights are a means of fund raising for SEQAS and a source of new members.</li>\n\n<li>In addition, these nights are recommended for members without telescopes or perhaps members considering buying one, to gain the opportunity of looking through a variety of instruments.</li>\n\n<li>Often there is a spare telescope to be operated, so why not come along.</li>\n</ul>\n<span style=\"clear: left; display: block;\"></span>\n\t</div>\n\t\n<div class=\"container\">\n<h2 class=\"heading\">For Schools</h2>\t\n\n<p>The SEQAS school night program aims to provide the school community with the opportunity of observing the wonders of the night sky. This will be achieved through the use of the society members' own telescopes and the society's Celestron Nexstar 11 telescope and Stella Cam 2 video camera showing live video images of deep sky objects on a LCD screen. We also offer daytime observing sessions of the Sun through 3 dedicated Solar Telescopes. The details of our RMS (Risk Managment Strategy) can be found <a style=\"font-weight:bold; clear:left; color:#38E6F9;\" href=\"http://seqas.org/Documents/RMS.pdf\">here</a>\n</p>\n\n<h3>SEQAS offers:</h3>\n<ul>\n    <li>Viewing for all year levels P-12.</li>\n    <li>Programme can be tailored to suit a particular year level.</li>\n    <li>An introductory talk on the night sky.</li>\n    <li>Viewing through telescopes usually around first quarter moon to observe lunar features such as craters, seas and mountains; double stars; star clusters; galaxies; visible planets etc.</li>\n    <li>Optional simple star charts.</li>\n    <li>Optional curriculum - based worksheets which can be used in conjunction with the viewing night.</li>\n    <li>Viewing for up to 200 people (depending on the number of telescopes available).</li>\n    <li>Safe daytime viewing of the Sun through dedicated Solar Telescopes.</li> \n</ul>\n<h3>Cost</h3>\n\$3 Per Person<br />\n\$10 Per Family<br />\n<p>\nWe recommend that the evening should last between 1 1/2 to 2 hours and as the evening is dependent on the weather, a back-up date should be considered.\n<br />\nSee above for contact phone numbers.\n</p>\n<span style=\"clear: left; display: block;\"></span>\n\t</div>\n\t\n<div id=\"school-events\">\n\t" . $eventContent . "\n\t</div>\n\t\n\t<script>\n\t\$( document ).ready(loadClubEvents(2014));\n\t</script>";
require $root . '/template/userTemplate.php';
开发者ID:astrix37,项目名称:seqas,代码行数:20,代码来源:school.php

示例2: count

<?php

require './security.php';
include_once '../scripts/DBAccess.php';
$eventResult = DBAccess::getEvents(1);
$rows = count($eventResult, 0);
$eventSchool = DBAccess::getEvents(2);
$rowsSchool = count($eventSchool, 0);
$title = 'Events';
$head = '';
$content = " <h1 class=\"heading\">Manage Events</h1>\t\n\n<h2 class=\"heading\">School Events</h2>\n\n<div class='container'>\n<table class=\"eventsTable\" cellspacing=\"0\">\n<tr>\n<th style=\"width:11%\">Date</th>\n<th style=\"width:12%\">Time</th>\n<th style=\"width:30%\">Event Name</th>\n<th style=\"width:47%\">Description</th>\n</tr>\n";
for ($i = 0; $i < $rowsSchool; $i++) {
    $thing = "";
    if (date('n', strtotime($eventSchool[$i]['EventDate'])) % 2 == 0) {
        //echo (date('M', strtotime($eventResult[$i]['EventDate'])));
        //$thing = "rgba(120, 120, 120, 0.5);";
    }
    $content = $content . "<tr style=\"background:" . $thing . "; color:#" . $eventSchool[$i]['EventColour'] . ";\">\n\t<td style=\"text-align:left;padding:10px;\">" . date('y (M d)', strtotime($eventSchool[$i]['EventDate'])) . "</td> \n\t<td>" . date('g:iA', strtotime($eventSchool[$i]['EventTime'])) . "</td> \n\t<td style=\"text-align:left;padding:10px;\"><a href=\"./viewEvent.php?eventID=" . $eventSchool[$i]['EventID'] . "\" class=\"link\">" . $eventSchool[$i]['EventName'] . "</a></td> \n\t<td style=\"text-align:left;padding:10px;\">" . $eventSchool[$i]['EventDescription'] . "</td> \n\t<tr /> \n\t\n\t";
}
$content = $content . "\t\n</table></div>\n<h2 class=\"heading\">Club Events</h2>\t\n\n<div class='container'>\n<table class=\"eventsTable\" cellspacing=\"0\">\n<tr>\n<th style=\"width:11%\">Date</th>\n<th style=\"width:12%\">Time</th>\n<th style=\"width:30%\">Event Name</th>\n<th style=\"width:47%\">Description</th>\n</tr>\n";
for ($i = 0; $i < $rows; $i++) {
    $thing = "";
    if (date('n', strtotime($eventResult[$i]['EventDate'])) % 2 == 0) {
        //echo (date('M', strtotime($eventResult[$i]['EventDate'])));
        //$thing = "rgba(120, 120, 120, 0.5);";
    }
    $content = $content . "<tr style=\"background:" . $thing . "; color:#" . $eventResult[$i]['EventColour'] . ";\">\n\t<td style=\"text-align:left;padding:10px;\">" . date('y (M d)', strtotime($eventResult[$i]['EventDate'])) . "</td> \n\t<td>" . date('g:iA', strtotime($eventResult[$i]['EventTime'])) . "</td> \n\t<td style=\"text-align:left;padding:10px;\"><a href=\"./viewEvent.php?eventID=" . $eventResult[$i]['EventID'] . "\" class=\"link\">" . $eventResult[$i]['EventName'] . "</a></td> \n\t<td style=\"text-align:left;padding:10px;\">" . $eventResult[$i]['EventDescription'] . "</td> \n\t<tr /> \n\t\n\t";
}
$content = $content . "</table></div>";
require '../template/adminTemplate.php';
开发者ID:astrix37,项目名称:seqas,代码行数:30,代码来源:manageEvent.php


注:本文中的DBAccess::getEvents方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。