本文整理汇总了PHP中Course::fetchRaw方法的典型用法代码示例。如果您正苦于以下问题:PHP Course::fetchRaw方法的具体用法?PHP Course::fetchRaw怎么用?PHP Course::fetchRaw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Course
的用法示例。
在下文中一共展示了Course::fetchRaw方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _showDay
/**
* create the li element for ul
*/
private function _showDay($cellNumber)
{
if ($this->currentDay == 0) {
$firstDayOfTheWeek = date('N', strtotime($this->currentYear . '-' . $this->currentMonth . '-01'));
if (intval($cellNumber) == intval($firstDayOfTheWeek)) {
$this->currentDay = 1;
}
}
if ($this->currentDay != 0 && $this->currentDay <= $this->daysInMonth) {
$this->currentDate = date('Y-m-d', strtotime($this->currentYear . '-' . $this->currentMonth . '-' . $this->currentDay));
$cellContent = $this->currentDay;
$this->currentDay++;
} else {
$this->currentDate = null;
$cellContent = null;
}
$now = new DateTime();
$realToday = $now->format('Y-m-d');
$styledVal = '';
if ($this->currentDate == $realToday) {
$styledVal = "text-decoration:underline;";
}
$thisReturnVal = '<li style="' . $styledVal . '" id="li-' . $this->currentDate . '" class="' . ($cellNumber % 7 == 1 ? ' start ' : ($cellNumber % 7 == 0 ? ' end ' : ' ')) . ($cellContent == null ? 'mask' : '') . '">' . $cellContent . '</li>';
$calCourseObj = new Course(self::$dbObj);
$calCourseToday = $calCourseObj->fetchRaw("*", " status = 1 AND start_date = '{$this->currentDate}' ", " id LIMIT 1");
if (count($calCourseToday) > 0) {
foreach ($calCourseToday as $calCourseTod) {
$thisReturnVal = '<li style="' . $styledVal . '" id="li-' . $this->currentDate . '" class="' . ($cellNumber % 7 == 1 ? ' start ' : ($cellNumber % 7 == 0 ? ' end ' : ' ')) . ($cellContent == null ? 'mask' : '') . '"><a title="' . $calCourseTod['name'] . '" href="' . SITE_URL . 'course/' . $calCourseTod['id'] . '/' . StringManipulator::slugify($calCourseTod['name']) . '/' . '">' . $cellContent . '</a></li>';
}
}
return $thisReturnVal;
}
示例2: item
<div class="page_content_wrap">
<div class="content_wrap">
<div class="content">
<article class="itemscope post_item post_item_single post_featured_default post_format_standard post-176 page type-page status-publish hentry" itemscope itemtype="http://schema.org/Article">
<section class="post_content" itemprop="articleBody">
<div class="vc_row wpb_row vc_row-fluid">
<div class="wpb_column vc_column_container vc_col-sm-12">
<div class="wpb_wrapper">
<div class="content-pad" style="margin-bottom:10px"><em>Below are the item(s) that match your search:</em> <strong style="color:green"><?php
echo $searchParam;
?>
</strong></div>
<div class="sc_section" data-animation="animated fadeInUp normal">
<div class="sc_accordion sc_accordion_style_1" data-active="0">
<?php
foreach ($courseObj->fetchRaw("*", "status=1 AND (name LIKE '%{$searchParam}%' OR start_date LIKE '%{$searchParam}%' OR description LIKE '%{$searchParam}%' OR amount LIKE '%{$searchParam}%') ", " RAND() ") as $course) {
$courseData = array('id' => 'id', 'name' => 'name', 'code' => 'code', 'image' => 'image', 'media' => 'media', 'amount' => 'amount', 'shortName' => 'short_name', 'category' => 'category', 'startDate' => 'start_date', 'endDate' => 'end_date', 'description' => 'description', 'status' => 'status', 'featured' => 'featured', 'currency' => 'currency');
foreach ($courseData as $key => $value) {
switch ($key) {
case 'image':
$courseObj->{$key} = MEDIA_FILES_PATH1 . 'course-image/' . $course[$value];
break;
case 'media':
$courseObj->{$key} = $course[$value];
break;
case 'startDate':
$dateParam = explode('-', $course[$value]);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
$courseObj->{$key} = $dateParam[2] . ' ' . $dateObj->format('F') . ', ' . $dateParam[0] . '.';
break;
case 'endDate':
示例3: Course
search">
<div>
<label class="screen-reader-text" for="s">Search for:</label>
<input type="text" placeholder="SEARCH" name="s" id="s" required="required"/>
<input type="submit" id="searchsubmit" value="Search" />
</div>
</form>
</div>
</div>
<div id="advanced-latest-event-3" class=" col-md-12 widget event_listing_widget">
<div class=" widget-inner">
<div class="uni-lastest">
<h2 class="widget-title maincolor2">Courses Overview</h2>
<?php
$sideCourseObj = new Course($dbObj);
foreach ($sideCourseObj->fetchRaw("*", " status =1 ", " RAND() LIMIT 6 ") as $sideCourse) {
$courseData = array('id' => 'id', 'name' => 'name', 'code' => 'code', 'image' => 'image', 'media' => 'media', 'amount' => 'amount', 'shortName' => 'short_name', 'category' => 'category', 'startDate' => 'start_date', 'endDate' => 'end_date', 'description' => 'description', 'status' => 'status');
foreach ($courseData as $key => $value) {
switch ($key) {
case 'image':
$sideCourseObj->{$key} = MEDIA_FILES_PATH1 . 'course-image/' . $sideCourse[$value];
break;
case 'media':
$sideCourseObj->{$key} = MEDIA_FILES_PATH1 . 'course/' . $sideCourse[$value];
break;
case 'startDate':
$dateParam = explode('-', $sideCourse[$value]);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
$sideCourseObj->{$key} = '<i class="fa fa-calendar"></i> ' . $dateParam[2] . ' ' . substr($dateObj->format('F'), 0, 3) . ', ' . $dateParam[0] . '.';
break;
case 'endDate':
示例4: RAND
<div class="container">
<div data-vc-parallax="1.5" class="vc_row wpb_row vc_row-fluid vc_custom_1446382855269 vc_general vc_parallax vc_parallax-content-moving">
<div class="wpb_column vc_column_container vc_col-sm-12">
<div class="wpb_wrapper">
<div class="wpb_text_column wpb_content_element vc_custom_1446471785681 wpb_animate_when_almost_visible wpb_left-to-right">
<div class="wpb_wrapper">
<h1 style="text-align: center;">Upcoming Training Courses</h1>
<h4 style="text-align: center;">Our solutions and training help clients improve performance and delivers excellent business result.</h4>
</div>
</div>
<section class="un-post-carousel un-post-carousel-1429 wpb_bottom-to-top wpb_animate_when_almost_visible" data-delay=1.0>
<div class="section-inner">
<div class="post-carousel-wrap">
<div class="is-carousel carousel-has-control " data-items=4 data-navigation=1>
<?php
foreach ($courseObj->fetchRaw("*", "status=1 AND featured = 1 ", " RAND() LIMIT 10") as $course) {
$dateParam = explode('-', $course['start_date']);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
?>
<div class="post-carousel-item grid-item">
<div class="grid-item-inner">
<div class="grid-item-content event-item dark-div">
<div class="event-thumbnail">
<a href="course/<?php
echo $course['id'] . "/" . StringManipulator::slugify($course['name']);
?>
/" title="<?php
echo $course['name'];
?>
">
<img src="<?php
示例5: RAND
</div>
</div>
</div>
</div>
<div class="vc_row wpb_row vc_row-fluid">
<div class="wpb_column vc_column_container vc_col-sm-12">
<div class="wpb_wrapper">
<div class="sc_section accent_top rounded_large bg_tint_light" data-animation="animated zoomIn normal" style="background-color:#f4f7f9;">
<div class="sc_section_overlay" style="">
<div class="sc_section_content">
<div class="sc_content content_wrap" style="margin-top:2.5em !important;margin-bottom:2.5em !important;">
<h2 class="sc_title sc_title_regular sc_align_center" style="margin-top:0px;margin-bottom:0.85em;text-align:center;">Courses Starting Soon</h2>
<div id="sc_blogger_1219813813" class="sc_blogger layout_courses_3 template_portfolio sc_blogger_horizontal no_description">
<div class="isotope_wrap" data-columns="3">
<?php
foreach ($courseObj->fetchRaw("*", " status = 1 AND CURRENT_DATE <= start_date ", " RAND() LIMIT 6") as $course) {
$courseData = array('id' => 'id', 'name' => 'name', 'code' => 'code', 'image' => 'image', 'media' => 'media', 'amount' => 'amount', 'shortName' => 'short_name', 'category' => 'category', 'startDate' => 'start_date', 'endDate' => 'end_date', 'description' => 'description', 'status' => 'status', 'currency' => 'currency');
foreach ($courseData as $key => $value) {
switch ($key) {
case 'image':
$courseObj->{$key} = MEDIA_FILES_PATH1 . 'course-image/' . $course[$value];
break;
case 'media':
$courseObj->{$key} = MEDIA_FILES_PATH1 . 'course/' . $course[$value];
break;
case 'startDate':
$dateParam = explode('-', $course[$value]);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
$courseObj->{$key} = $dateParam[2] . ' ' . $dateObj->format('F') . ', ' . $dateParam[0] . '.';
break;
case 'endDate':
示例6: array
include 'includes/header.php';
?>
<?php
include 'includes/bread-crumb.php';
?>
<div class="page_content_wrap">
<div class="content_wrap">
<div class="content">
<div id="testBox"></div>
<div class="isotope_filters"></div>
<div class="isotope_wrap " data-columns="3">
<?php
$courseNos = 0;
foreach ($courseObj->fetchRaw("*", " status = 1 AND CURRENT_DATE <= start_date {$classVal} ", " start_date LIMIT {$recordPerPage} OFFSET {$offset}") as $course) {
$courseData = array('id' => 'id', 'name' => 'name', 'code' => 'code', 'image' => 'image', 'media' => 'media', 'amount' => 'amount', 'shortName' => 'short_name', 'category' => 'category', 'startDate' => 'start_date', 'endDate' => 'end_date', 'description' => 'description', 'status' => 'status', 'featured' => 'featured', 'currency' => 'currency');
foreach ($courseData as $key => $value) {
switch ($key) {
case 'image':
$courseObj->{$key} = MEDIA_FILES_PATH1 . 'course-image/' . $course[$value];
break;
case 'media':
$courseObj->{$key} = $course[$value];
break;
case 'startDate':
$dateParam = explode('-', $course[$value]);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
$courseObj->{$key} = $dateParam[2] . ' ' . $dateObj->format('F') . ', ' . $dateParam[0] . '.';
break;
case 'endDate':
示例7: Course
<p><em>No additional course media found for this course!</em></p>
<?php
}
?>
</div>
<div class="clear"></div>
</div>
</div>
</div>
<div class="related products">
<h2>Related Courses</h2>
<ul class="products">
<?php
$relCourseObj = new Course($dbObj);
foreach ($relCourseObj->fetchRaw("*", " status = 1 AND category = {$courseObj->category} AND id != {$courseObj->id} ", " RAND() LIMIT 2") as $course) {
$courseData = array('id' => 'id', 'name' => 'name', 'code' => 'code', 'image' => 'image', 'media' => 'media', 'amount' => 'amount', 'shortName' => 'short_name', 'category' => 'category', 'startDate' => 'start_date', 'endDate' => 'end_date', 'description' => 'description', 'status' => 'status', 'currency' => 'currency', 'featured' => 'featured');
foreach ($courseData as $key => $value) {
switch ($key) {
case 'image':
$relCourseObj->{$key} = MEDIA_FILES_PATH1 . 'course-image/' . $course[$value];
break;
case 'media':
$relCourseObj->{$key} = MEDIA_FILES_PATH1 . 'course/' . $course[$value];
break;
case 'startDate':
$dateParam = explode('-', $course[$value]);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
$relCourseObj->{$key} = $dateParam[2] . ' ' . $dateObj->format('F') . ', ' . $dateParam[0] . '.';
break;
case 'endDate':
示例8: foreach
/"><?php
echo $category['name'];
?>
</a>
</span>
<span class="un-heading-line un-heading-after"><span></span></span>
</div>
<div class="clearfix"></div>
</div>
<section class="un-post-carousel un-post-carousel-6327 " data-delay=0>
<div class="section-inner">
<div class="post-carousel-wrap">
<div class="is-carousel carousel-has-control " data-items=4 data-navigation=1>
<?php
foreach ($courseObj->fetchRaw("*", "status=1 AND category=" . $category['id'], " RAND() ") as $course) {
$dateParam = explode('-', $course['start_date']);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
?>
<div class="post-carousel-item grid-item">
<div class="grid-item-inner">
<div class="grid-item-content event-item dark-div">
<div class="event-thumbnail">
<a href="<?php
echo SITE_URL;
?>
course/<?php
echo $course['id'] . "/" . StringManipulator::slugify($course['name']);
?>
/" title="<?php
echo $course['name'];
示例9: Course
<p><a href="mailto:<?php
echo COMPANY_EMAIL;
?>
"><?php
echo COMPANY_EMAIL;
?>
</a></p>
</div>
<div class="event-cta"> </div>
<div class="related-event ">
<h3>Related Courses</h3>
<div class="ev-content">
<div class="row">
<?php
$relatedCourseObj = new Course($dbObj);
foreach ($relatedCourseObj->fetchRaw("*", " category = {$courseObj->category} AND id != {$courseObj->id} ", " RAND() LIMIT 2 ") as $relatedCourse) {
$courseData = array('id' => 'id', 'name' => 'name', 'code' => 'code', 'image' => 'image', 'media' => 'media', 'amount' => 'amount', 'shortName' => 'short_name', 'category' => 'category', 'startDate' => 'start_date', 'endDate' => 'end_date', 'description' => 'description', 'status' => 'status');
foreach ($courseData as $key => $value) {
switch ($key) {
case 'image':
$relatedCourseObj->{$key} = MEDIA_FILES_PATH1 . 'course-image/' . $relatedCourse[$value];
break;
case 'media':
$relatedCourseObj->{$key} = MEDIA_FILES_PATH1 . 'course/' . $relatedCourse[$value];
break;
case 'startDate':
$dateParam = explode('-', $relatedCourse[$value]);
$dateObj = DateTime::createFromFormat('!m', $dateParam[1]);
$relatedCourseObj->{$key} = $dateParam[2] . ' ' . $dateObj->format('F') . ', ' . $dateParam[0] . '.';
break;
case 'endDate':