This repository has been archived by the owner. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Sticky Footer and Pre-Advising Portal
- Loading branch information
briandunnigan
authored and
briandunnigan
committed
Jun 17, 2015
1 parent
bf97b82
commit fe3d4b4
Showing
6 changed files
with
408 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,79 +1,79 @@ | ||
<?php | ||
|
||
function ece_scripts() { | ||
wp_enqueue_style( 'ece-style', get_stylesheet_directory_uri() . '/css/ece.css'); | ||
wp_enqueue_script('ece-custom', get_stylesheet_directory_uri().'/js/custom.js', array('jquery')); | ||
wp_localize_script( 'ece-custom', 'ece_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'siteurl' => site_url() ) ); | ||
} | ||
add_action( 'wp_enqueue_scripts', 'ece_scripts'); | ||
|
||
function ece_get_courses( $discipline ){ | ||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php"); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, 'discipline='.$discipline); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
$courses = curl_exec($ch); | ||
curl_close ($ch); | ||
|
||
return json_decode($courses); | ||
} | ||
|
||
function ajax_ece_discipline_courses(){ | ||
$discipline = $_POST['discipline']; | ||
|
||
$courses = ece_get_courses( urlencode($discipline) ); | ||
|
||
echo wp_json_encode( $courses ); | ||
wp_die(); | ||
} | ||
add_action( 'wp_ajax_ece_discipline_courses', 'ajax_ece_discipline_courses' ); | ||
add_action('wp_ajax_nopriv_ece_discipline_courses', 'ajax_ece_discipline_courses'); | ||
|
||
function ece_get_course_info( $discipline, $course ){ | ||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php"); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, 'course='.$course.'&discipline='.$discipline); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
$courses = curl_exec($ch); | ||
curl_close ($ch); | ||
|
||
return json_decode($courses); | ||
} | ||
|
||
function ajax_ece_course_info(){ | ||
$discipline = $_POST['discipline']; | ||
$course = $_POST['course']; | ||
|
||
$courseInfo = ece_get_course_info( urlencode($discipline), urlencode($course) ); | ||
|
||
echo wp_json_encode( $courseInfo ); | ||
wp_die(); | ||
} | ||
add_action( 'wp_ajax_ece_course_info', 'ajax_ece_course_info' ); | ||
add_action('wp_ajax_nopriv_ece_course_info', 'ajax_ece_course_info'); | ||
|
||
function ece_get_major_info( $major ){ | ||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_major.php"); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, 'major='.$major); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
$info = curl_exec($ch); | ||
curl_close ($ch); | ||
|
||
return json_decode($info); | ||
} | ||
|
||
function ajax_ece_major_info(){ | ||
$major = $_POST['major']; | ||
|
||
$majorInfo = ece_get_major_info( urlencode($major) ); | ||
|
||
echo wp_json_encode( $majorInfo ); | ||
wp_die(); | ||
} | ||
add_action( 'wp_ajax_ece_major_info', 'ajax_ece_major_info' ); | ||
add_action('wp_ajax_nopriv_ece_major_info', 'ajax_ece_major_info'); | ||
<?php | ||
|
||
function ece_scripts() { | ||
wp_enqueue_style( 'ece-style', get_stylesheet_directory_uri() . '/css/ece.css'); | ||
wp_enqueue_script('ece-custom', get_stylesheet_directory_uri().'/js/custom.js', array('jquery', 'cs')); | ||
wp_localize_script( 'ece-custom', 'ece_object', array( 'ajaxurl' => admin_url( 'admin-ajax.php' ), 'siteurl' => site_url() ) ); | ||
} | ||
add_action( 'wp_enqueue_scripts', 'ece_scripts'); | ||
|
||
function ece_get_courses( $discipline ){ | ||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php"); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, 'discipline='.$discipline); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
$courses = curl_exec($ch); | ||
curl_close ($ch); | ||
|
||
return json_decode($courses); | ||
} | ||
|
||
function ajax_ece_discipline_courses(){ | ||
$discipline = $_POST['discipline']; | ||
|
||
$courses = ece_get_courses( urlencode($discipline) ); | ||
|
||
echo wp_json_encode( $courses ); | ||
wp_die(); | ||
} | ||
add_action( 'wp_ajax_ece_discipline_courses', 'ajax_ece_discipline_courses' ); | ||
add_action('wp_ajax_nopriv_ece_discipline_courses', 'ajax_ece_discipline_courses'); | ||
|
||
function ece_get_course_info( $discipline, $course ){ | ||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_course.php"); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, 'course='.$course.'&discipline='.$discipline); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
$courses = curl_exec($ch); | ||
curl_close ($ch); | ||
|
||
return json_decode($courses); | ||
} | ||
|
||
function ajax_ece_course_info(){ | ||
$discipline = $_POST['discipline']; | ||
$course = $_POST['course']; | ||
|
||
$courseInfo = ece_get_course_info( urlencode($discipline), urlencode($course) ); | ||
|
||
echo wp_json_encode( $courseInfo ); | ||
wp_die(); | ||
} | ||
add_action( 'wp_ajax_ece_course_info', 'ajax_ece_course_info' ); | ||
add_action('wp_ajax_nopriv_ece_course_info', 'ajax_ece_course_info'); | ||
|
||
function ece_get_major_info( $major ){ | ||
$ch = curl_init(); | ||
curl_setopt($ch, CURLOPT_URL,"http://web2.uconn.edu/ece/preadvising/pread_major.php"); | ||
curl_setopt($ch, CURLOPT_POST, 1); | ||
curl_setopt($ch, CURLOPT_POSTFIELDS, 'major='.$major); | ||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | ||
$info = curl_exec($ch); | ||
curl_close ($ch); | ||
|
||
return json_decode($info); | ||
} | ||
|
||
function ajax_ece_major_info(){ | ||
$major = $_POST['major']; | ||
$majorInfo = ece_get_major_info( urlencode($major) ); | ||
echo wp_json_encode( $majorInfo ); | ||
wp_die(); | ||
} | ||
add_action( 'wp_ajax_ece_major_info', 'ajax_ece_major_info' ); | ||
add_action('wp_ajax_nopriv_ece_major_info', 'ajax_ece_major_info'); | ||
?> |
Oops, something went wrong.