{extends 'Layout'} {block 'content'} {set $today = '' | date : 'Y-m-d'}
Training Category
Course Levels
Competencies {set $categories = 'pdoResources' | snippet : [ 'class' => 'lmcukCvs', 'loadModels' => 'lmcuk', 'limit' => 0, 'where' => [ 'type' => 'S', 'active' => 1, 'category:<>' => '', ], 'sortby' => [ 'category' => 'asc', ], 'groupby' => 'category', 'return' => 'json', ] | json_decode}
Keywords:
Location:
    {set $cacheKey = 'course-finder/venues/' ~ $today} {set $venues = $_modx->cacheManager->get($cacheKey)} {if !$venues} {set $venues = '!pdoResources' | snippet : [ 'class' => 'lmcukCvs', 'loadModels' => 'lmcuk', 'limit' => 0, 'where' => [ 'type' => 'V', 'active' => 1, 'Dates.course_start_date:>=' => $today, ], 'innerJoin' => [ 'lmcukCourseDate' => [ 'alias' => 'Dates', 'on' => 'lmcukCvs.id = Dates.course_venue', ], ], 'sortby' => [ 'name' => 'asc', ], 'groupby' => 'lmcukCvs.id', 'tpl' => '@INLINE
  • ', ]} {set $null = $_modx->cacheManager->set($cacheKey, $venues)} {/if} {$venues}
Dates:  
{set $cacheKey = 'course-finder/dates/' ~ $today} {set $dates = $_modx->cacheManager->get($cacheKey)} {if !$dates} {set $dates = '!pdoResources' | snippet : [ 'class' => 'lmcukCourseDate', 'loadModels' => 'lmcuk', 'limit' => 0, 'where' => [ 'course_start_date:>=' => $today, ], 'select' => [ 'course_start_date AS s', 'course_end_date AS e', ], 'sortby' => [ 'course_start_date' => 'asc', 'course_end_date' => 'asc', ], 'groupby' => 'course_start_date, course_end_date', 'return' => 'json', ]} {set $null = $_modx->cacheManager->set($cacheKey, $dates)} {/if}
Duration:
    {set $cacheKey = 'course-finder/durations/' ~ $today} {set $durations = $_modx->cacheManager->get($cacheKey)} {if !$durations} {set $durations = 'pdoResources' | snippet : [ 'loadModels' => 'lmcuk', 'parents' => 0, 'limit' => 0, 'where' => [ 'class_key' => 'Course', 'Duration.id IS NOT NULL', ], 'includeTVs' => 'course_duration', 'tvPrefix' => '', 'innerJoin' => [ 'Dates' => [ 'class' => 'lmcukCourseDate', 'on' => 'Dates.resource_id = modResource.id AND Dates.course_start_date >= "' ~ $today ~ '"', ], ], 'leftJoin' => [ 'lmcukDurations' => [ 'alias' => 'Duration', 'on' => 'Duration.id = TVcourse_duration.value', ], ], 'sortby' => [ 'FIELD(unit, "day", "week", "month")' => 'asc', 'duration' => 'asc', ], 'select' => [ 'Duration' => '*', ], 'groupby' => 'Duration.id', 'tpl' => '@INLINE
  • ', ]} {set $null = $_modx->cacheManager->set($cacheKey, $durations)} {/if} {$durations}
{set $output = '!pdoPage' | snippet : [ 'element' => 'CourseFinderResults', 'totalVar' => 'resultsCount', 'pageNavVar' => 'resultsPagination', 'tpl' => 'CourseFinderResultItem', 'tplPageWrapper' => '@INLINE {$pages}', 'tplPage' => '@INLINE {$pageNo} ', 'tplPageActive' => '@INLINE {$pageNo} ', ]} {$output} {if !$output?}

No courses found

{/if}
{/block}