Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
master
Go to file
 
 
Cannot retrieve contributors at this time
263 lines (244 sloc) 12.1 KB
<?php
/**
* Template for Program
*/
$terraid = get_post_meta( get_the_ID(), 'apply-link', true );
$terraid = explode('Program_ID=',$terraid);
$terraid = explode('&',$terraid[1]);
$terraid = $terraid[0];
$api = 'http://app.studyabroad.uconn.edu/piapi/index.cfm?callName=getProgramBrochure&Program_ID='.$terraid.'&ResponseEncoding=JSON&callBack=false';
if(is_numeric($terraid) && $terraid > 0){
$response = wp_remote_get( $api );
//print_r($response['response']);
if( is_array($response) && isset($response['body']) && strlen($response['body']) > 0 ) {
$terradata = json_decode($response['body']);
}
else{
$terradata = false;
}
}
else{
$terradata = false;
}
//print_r($terradata);
get_header(); ?>
<?php if ( has_post_thumbnail() && ! post_password_required() ) : ?>
<div class="entry-thumbnail">
<?php the_post_thumbnail(); ?>
</div>
<?php endif; ?>
<div class="container">
<div class="holdit clearfix ">
<section class="single-program content">
<div class="row-fluid">
<div class="col-sm-10">
<!--- Start --->
<?php /* The loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<header class="entry-header">
<h1 class="entry-title">
<?php the_title(); ?>
</h1>
</header>
<!-- .entry-header -->
<div class="entry-content">
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#program">Program</a></li>
<li><a data-toggle="tab" href="#academics">Academics</a></li>
<li><a data-toggle="tab" href="#experience">Experience</a></li>
<li><a data-toggle="tab" href="#finances">Finances</a></li>
<li><a data-toggle="tab" href="#details">Details</a></li>
</ul>
<div class="tab-content">
<div id="program" class="tab-pane fade in active">
<?php the_content(); ?>
</div>
<div id="academics" class="tab-pane fade">
<?php the_field( 'academics', get_the_ID() ); ?>
</div>
<div id="experience" class="tab-pane fade">
<?php the_field( 'experience', get_the_ID() ); ?>
</div>
<div id="finances" class="tab-pane fade">
<?php the_field( 'finances', get_the_ID() ); ?>
<span class="budgetsheets"><strong>Budget Sheets:</strong> <?php
$budgetsheets = array();
if(isset($terradata->DETAILS->BUDGETSHEETS->BUDGET->BUDGET_TERM)) $budgetsheets[] = '<a href="http://app.studyabroad.uconn.edu/'.$terradata->DETAILS->BUDGETSHEETS->BUDGET->BUDGET_TERM->LINK->HREF.'" target="_blank">'.$terradata->DETAILS->BUDGETSHEETS->BUDGET->BUDGET_TITLE.'</a>';
else{
foreach($terradata->DETAILS->BUDGETSHEETS->BUDGET as $budgetsheet){
$budgetsheets[] = '<a href="http://app.studyabroad.uconn.edu/'.$budgetsheet->BUDGET_TERM->LINK->HREF.'" target="_blank">'.$budgetsheet->BUDGET_TITLE.'</a>';
}
}
echo implode(', ', $budgetsheets);
?></span>
</div>
<div id="details" class="tab-pane fade">
<strong>The Details</strong><br /><br />
<ul>
<li><strong>Location:</strong> <?php echo $terradata->DETAILS->LOCATIONS->LOCATION->PROGRAM_CITY.', '.$terradata->DETAILS->LOCATIONS->LOCATION->PROGRAM_COUNTRY; ?></li>
<li><strong>Terms:</strong> <?php
$terms = array();
if(isset($terradata->DETAILS->TERMS->TERM->PROGRAM_TERM)) $terms[] = $terradata->DETAILS->TERMS->TERM->PROGRAM_TERM;
else{
foreach($terradata->DETAILS->TERMS->TERM as $term){
$terms[] = $term->PROGRAM_TERM;
}
}
echo implode(', ', $terms);
?></li>
<li><strong>Homepage:</strong> <?php if(isset($terradata->DETAILS->PROGRAM_HOME_PAGE) && strlen($terradata->DETAILS->PROGRAM_HOME_PAGE) > 0) echo '<a href="'.$terradata->DETAILS->PROGRAM_HOME_PAGE.'" target="_blank">Click to visit</a>'; ?></li>
</ul>
<h3 class="dates-deadlines">Dates / Deadlines:</h3>
<div class="table-responsive">
<table>
<thead>
<tr>
<th>Term</th>
<th>Year</th>
<th>App Deadline</th>
<th>Decision Date</th>
<th>Start Date</th>
<th>End Date</th>
</tr>
</thead>
<tbody>
<?php
if(isset($terradata->DETAILS->DATES->DATE->APP_TERM)) {
?>
<tr>
<td><?php echo $terradata->DETAILS->DATES->DATE->APP_TERM; ?></td>
<td><?php echo $terradata->DETAILS->DATES->DATE->APP_YEAR; ?></td>
<td><?php echo date('m/d/Y',strtotime($terradata->DETAILS->DATES->DATE->OVERRIDE)); ?></td>
<td><?php echo date('m/d/Y',strtotime($terradata->DETAILS->DATES->DATE->OVERRIDE2)); ?></td>
<td><?php echo strlen($terradata->DETAILS->DATES->DATE->TERM_START) > 0?date('m/d/Y',strtotime($terradata->DETAILS->DATES->DATE->TERM_START)):'TBD'; ?></td>
<td><?php echo strlen($terradata->DETAILS->DATES->DATE->TERM_END) > 0?date('m/d/Y',strtotime($terradata->DETAILS->DATES->DATE->TERM_END)):'TBD'; ?></td>
</tr>
<?php
}
else{
foreach($terradata->DETAILS->DATES->DATE as $date){
?>
<tr>
<td><?php echo $date->APP_TERM; ?></td>
<td><?php echo $date->APP_YEAR; ?></td>
<td><?php echo date('m/d/Y',strtotime($date->OVERRIDE)); ?></td>
<td><?php echo date('m/d/Y',strtotime($date->OVERRIDE2)); ?></td>
<td><?php echo strlen($date->TERM_START) > 0?date('m/d/Y',strtotime($date->TERM_START)):'TBD'; ?></td>
<td><?php echo strlen($date->TERM_END) > 0?date('m/d/Y',strtotime($date->TERM_END)):'TBD'; ?></td>
</tr>
<?php }
}?>
</tbody>
</table>
</div>
<?php
$classstatuses = array();
$academicareas = array();
$language = '';
$priorlanguage = '';
$nonuconn = '';
$requiredgpa = '';
foreach($terradata->DETAILS->PARAMETERS->PARAMETER as $parameters){
if($parameters->PROGRAM_PARAM_TEXT == 'Class status'){
$classstatuses[] = $parameters->PARAM_VALUE;
}
elseif($parameters->PROGRAM_PARAM_TEXT == 'Academic area'){
$academicareas[] = $parameters->PARAM_VALUE;
}
elseif($parameters->PROGRAM_PARAM_TEXT == 'Language of instruction'){
$language = $parameters->PARAM_VALUE;
}
elseif($parameters->PROGRAM_PARAM_TEXT == 'Prior language study required'){
$priorlanguage = $parameters->PARAM_VALUE;
}
elseif($parameters->PROGRAM_PARAM_TEXT == 'Open to non-UConn students'){
$nonuconn = $parameters->PARAM_VALUE;
}
elseif($parameters->PROGRAM_PARAM_TEXT == 'Required GPA'){
$requiredgpa = $parameters->PARAM_VALUE;
}
}
?>
<h3 class="dates-deadlines">Fact Sheet:</h3>
<div class="table-responsive">
<table>
<tbody>
<tr>
<td><strong>Class status:</strong></td>
<td><?php echo implode(', ',$classstatuses); ?></td>
<td><strong>Academic area:</strong></td>
<td><?php echo implode(', ',$academicareas); ?></td>
</tr>
<tr>
<td><strong>Language of instruction:</strong></td>
<td><?php echo $language; ?></td>
<td><strong>Prior language study required</strong>:</td>
<td><?php echo $priorlanguage; ?></td>
</tr>
<tr>
<td><strong>Open to non-UConn students:</strong></td>
<td><?php echo $nonuconn; ?></td>
<td><strong>Required GPA:</strong></td>
<td><?php echo $requiredgpa; ?></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- .entry-content -->
</article>
<!-- #post -->
<?php endwhile; ?>
</div>
<!--- End --->
<!--- Start --->
<div class="filterbuttons col-sm-2">
<!-- Filter Buttons --->
<div style="margin-bottom:8px;"> <a class="btn btn-primary btn-block" target="_blank" href="https://app.studyabroad.uconn.edu/<?php echo $terradata->DETAILS->APPLY_NOW->LINK->HREF; ?>">Apply Now</a> </div>
<div class=""> <a class="btn btn-success btn-block" target="_blank" href="http://abroad.uconn.edu/our-team/">Request Advising</a> </div>
</div>
<!--- End ---->
<!--- Start --->
<!-- #row -->
<hr />
<!-- ============= STUDENT TESTIMONIALS =============== -->
<!--<div class="row">
<div class="col-sm-12 testimonial-wrap">
<h1>Student Testimonials</h1>
<div class="testimonials">
<ul class="test-grid">
<?php
$cat = get_category_by_slug('testimonials');
$catid = $cat->term_id;
$args = array( 'posts_per_page' => 4, 'orderby' => 'rand', 'category' => $catid );
$rand_posts = get_posts( $args );
foreach ( $rand_posts as $post ) :
setup_postdata( $post ); ?>
<li class="test-box"> <a href="<?php the_permalink() ?>">
<figure class="test-img-box">
<?php the_post_thumbnail('large');?>
</figure>
<h4 class="test-name">
<?php the_title(); ?>
</h4>
<div class="test-content">
<?php the_excerpt(); ?>
</div>
<!-- .entry-content -->
<!-- </a> </li>
<?php endforeach;
wp_reset_postdata(); ?>
</ul>
</div>
</div>
</div> -->
<!-- ============= END - STUDENT TESTIMONIALS =============== -->
<!--- End ---->
</div>
</section>
</div>
</div>
<?php get_footer(); ?>
You can’t perform that action at this time.