-
Notifications
You must be signed in to change notification settings - Fork 0
/
single-course.php
143 lines (121 loc) · 7.28 KB
/
single-course.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php get_header(); ?>
<!-- start content container -->
<div id="content">
<div class="row">
<?php //get_template_part('template-part', 'search'); ?>
<div class="main-content">
<!-- the loop -->
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<div <?php post_class(); ?>>
<?php if ($_SERVER['HTTP_REFERER']) { ?>
<p class='search-return'><a href='javascript:history.go(-1)'><< Return to Search Results</a></p>
<?php } ?>
<div class="page-header">
<h2 class="course-title"><?php the_title() ;?></h2>
<?php if (get_field('provided_by')) { ?>
<h2 class="course-provider"><?php echo get_field("provided_by"); ?></h2>
<?php } ?>
</div>
<div class="sidebar col-lg-4">
<div class="course-credential center-block">
<?php
if(in_category('fmp')){
echo '<img src="http://cdn.ifma.org/sfcdn/education/fmp-logo_color_med836DBD92634D.jpg?sfvrsn=2" alt="FMP Logo">';
}
if(in_category('sfp')){
echo '<img src="http://cdn.ifma.org/sfcdn/education/sfp-logo_color_medF85909A67844.jpg?sfvrsn=2" alt="SFP Logo">';
}
if(in_category('cfm')){
echo '<img src="http://cdn.ifma.org/sfcdn/education/cfm-logo_color_med182CC468D797.jpg?sfvrsn=2" alt="CFM Logo">';
}
?>
</div>
<div class="course-contact">
<h3>Contact:</h3>
<?php $contact = get_field('contact'); ?>
<p><?php echo get_field('contact_fname',$contact[0]->ID)." ".get_field('contact_lname',$contact[0]->ID); ?></p>
<p><?php echo get_field('email',$contact[0]->ID); ?></p>
<p><?php echo get_field('phone_number',$contact[0]->ID); ?></p>
</div>
<div class="course-location">
<?php
//map stuff
$location = get_field('map_location');
if ($location) {
$place = get_field('map_location', $location[0]->ID);
?>
<h3> Location: </h3>
<?php
echo "<p>".$place['address']."</p>";
echo "<p><img src='http://maps.googleapis.com/maps/api/staticmap?markers=".$place['lat'].",".$place['lng']."&zoom=13&size=375x375&sensor=false' alt='map location'></p>";
} ?>
</div>
</div>
<div class="course-details">
<?php if (get_field('start_date')){ ?>
<?php if (get_field('end_date') > get_field('start_date')){ ?>
<p><i class="fa fa-calendar"></i> <?php echo date('M d, y',strtotime(get_field('start_date')))." - ".date('M d, y',strtotime(get_field('end_date'))); ?></p>
<?php } else { ?>
<p><i class="fa fa-calendar"></i> <?php echo date('M d, Y',strtotime(get_field('start_date'))); ?></p>
<?php } ?>
<?php } else { ?>
<p><i class="fa fa-calendar"></i> Anytime</p>
<?php } ?>
<p><i class="fa fa-road"></i>
<?php if (is_array(get_field('delivery_method'))) {
array_walk(get_field('delivery_method'),'walk_delivery_method');
} else {
echo get_field('delivery_method');
}
?></p>
<?php if (get_field("accredited")=="Yes") { ?>
<p><i class="fa fa-check"></i> IFMA Accredited</p>
<?php } else { ?>
<p><i class="fa fa-ban"></i> IFMA Accredited</p>
<?php }
if (get_field("college_accredited")=="Yes") { ?>
<p><i class="fa fa-check"></i> College Accredited</p>
<?php } else { ?>
<p><i class="fa fa-ban"></i> College Accredited</p>
<?php } ?>
<p><i class="fa fa-globe"></i> <a href="<?php echo get_field("website_url"); ?>">Website</a></p>
</div>
<div class="col-lg-8 course-info">
<?php $instructor = get_field('instructor');
if ($instructor) {
$name = get_field('first_name',$instructor[0])." ".get_field('last_name',$instructor[0]);?>
<p>Instructor: <?php echo $name; ?></p>
<?php } ?>
<?php if (get_field('level')) { ?>
<p>Course Level: <?php echo get_field("level"); ?></p>
<?php }?>
<?php if (get_field('college_credits')) { ?>
<p>College Credit Hours: <?php echo get_field('college_credits') ?></p>
<?php } ?>
<?php if (get_field('number_of_ceu')) { ?>
<p>Number of CEU: <?php echo get_field('number_of_ceu'); ?> </p>
<?php } ?>
<?php if (get_field("registration_url") != ""){ ?>
<p><a class="btn btn-action pull-right" href="<?php echo get_field('registration_url'); ?>">Register Now</a></p>
<?php } ?>
</div>
<div class=" col-lg-8 course-content">
<h3>Course Description/Syllabus</h3>
<?php the_content();
if(get_field("registration_url") != ""){
?>
<a class="btn btn-action pull-right" href="<?php echo get_field('registration_url'); ?>">Register Now</a>
<?php }?>
</div>
<?php wp_link_pages(); ?>
<?php get_template_part('template-part', 'postmeta'); ?>
</div>
<?php endwhile; ?>
<?php posts_nav_link(); ?>
<?php else: ?>
<?php get_404_template(); ?>
<?php endif; ?>
</div>
</div>
</div>
<?php get_footer(); ?>