#!/usr/bin/php <?php /** * Command-line script to set the freshmen housing waiver on * a freshmen's housing application in Banner. * * @author Jeremy Booker <jbooker at tux dot appstate dot edu> */ require_once 'SOAP.php'; require_once 'cliCommon.php'; $args = array('username' => '', 'term' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $result = $soap->setHousingWaiver($args['username'], $args['term']); var_dump($result);
#!/usr/bin/php <?php /** * Returns a student's housing assignment, meal plan, and application status * @author Jeremy Booker <jbooker at tux dot appstate dot edu> */ require_once 'SOAP.php'; require_once 'cliCommon.php'; $args = array('username' => '', 'term' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $result = $soap->getHousMealRegister($args['username'], $args['term'], 'All'); print_r($result); echo "\n";
#!/usr/bin/php <?php /** * Command-line script to remove an assignment * @author Jeremy Booker <jbooker at tux dot appstate dot edu> */ require_once 'SOAP.php'; require_once 'cliCommon.php'; $args = array('username' => '', 'term' => '', 'building' => '', 'room' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $result = $soap->removeRoomAssignment($args['username'], $args['term'], $args['building'], $args['room']); print_r($result); echo "\n";
#!/usr/bin/php <?php require_once 'SOAP.php'; require_once 'cliCommon.php'; require_once '../db_config.php.inc'; $args = array('output_file' => '', 'term' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $csvout = fopen($args['output_file'], 'w'); # Header line $line = array('User Name', 'Banner Id', 'Residence Hall', 'Room Number', 'Assignment Term', 'Application Term', 'Class'); fputcsv($csvout, $line, ','); $db = pg_connect("host={$host} dbname={$database} user={$dbuser} password={$dbpasswd}"); $sql = "SELECT asu_username, hall_name, room_number, hms_assignment.term FROM hms_assignment JOIN hms_bed ON hms_assignment.bed_id = hms_bed.id JOIN hms_room ON hms_bed.room_id = hms_room.id JOIN hms_floor ON hms_room.floor_id = hms_floor.id JOIN hms_residence_hall ON hms_floor.residence_hall_id = hms_residence_hall.id WHERE hms_assignment.term = {$args['term']} ORDER BY banner_building_code"; $result = pg_query($sql); while ($row = pg_fetch_assoc($result)) { echo "Getting soap date for: {$row['asu_username']}\n"; try { $student = $soap->getStudentInfo($row['asu_username'], $row['term']); $class = $student->projected_class; if (empty($class) || is_null($class)) { $class = 'unknown'; } $applicationTerm = $student->application_term; if (empty($applicationTerm) || is_null($applicationTerm)) { $applicationTerm = 'unknown'; } if ($student->honors == '1') { $line = array($row['asu_username'], $student->banner_id, $row['hall_name'], $row['room_number'], $row['term'], $applicationTerm, $class); fputcsv($csvout, $line, ',');
$dbuser = trim(readline("User name: ")); // A bit of hackery here to avoid echoing the password echo "Database Password: "******"\n"; // Connect to the database //$db = pg_connect("host=$host dbname=$database user=$dbuser password=$dbpasswd"); $db = pg_connect("user={$dbuser} password={$dbpasswd} dbname={$dbname}"); if (!$db) { die('Could not connect to database.\\n'); } // Get an instance of SOAP $soap = new PhpSOAP('jb67803', 'A'); foreach ($inputFile as $line) { $bannerId = trim($line); if ($line == '') { continue; } //$username = '******'; //$gender = 'M'; $username = $soap->getUsername($bannerId); $student = $soap->getStudentProfile($bannerId, $args['term']); $gender = $student->gender; if ($gender == 'M') { $gender = 1; } else { if ($gender == 'F') { $gender = 0;
#!/usr/bin/php <?php /** * Command-line script to get the BannerId of the student assigned to a given bed * @author Jeremy Booker <jbooker at tux dot appstate dot edu> */ require_once 'SOAP.php'; require_once 'cliCommon.php'; $args = array('hallCode' => '', 'bedCode' => '', 'term' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $result = $soap->getBannerIdByBuildingRoom($args['hallCode'], $args['bedCode'], $args['term']); echo print_r($result, true); echo "\n";
* * Input: List of student Banner IDs, one per line * Output: CSV list of student Banner IDs and a column * indicating if the student is flagged as honors in Banner */ require_once 'SOAP.php'; require_once 'cliCommon.php'; ini_set('display_errors', 1); ini_set('ERROR_REPORTING', E_WARNING); error_reporting(E_ALL); $args = array('term' => '', 'input_file' => '', 'output_file' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $term = $args['term']; // Get an instance of SOAP $soap = new PhpSOAP(); // Open input and output files //$students = fopen($args['input_file'], 'r'); $csvout = fopen($args['output_file'], 'w'); fputcsv($csvout, array('Banner ID', 'Honors?'), ','); // pull list of Banner IDs from input file into an array $bannerIds = file($args['input_file']); foreach ($bannerIds as $id) { $banId = trim($id); $student = null; try { $username = $soap->getUsername($banId); $student = $soap->getStudentInfo($username, $term); } catch (Exception $e) { echo "Missing student: {$banId}!!!!!\n"; continue;
#!/usr/bin/php <?php /* * Gets a list of all the new freshmen housing applications that are withdrawn, then double checks the student type of all those students. * This double-checks that we don't accidentally withrawn an application for a student who's not really withdrawn. */ require_once 'SOAP.php'; require_once 'cliCommon.php'; require_once '../db_config.php.inc'; $args = array('term' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $db = pg_connect("host={$host} dbname={$database} user={$dbuser} password={$dbpasswd}"); $sql = "select username from hms_new_application where term = {$args['term']} and (withdrawn = 1 OR student_type = 'W') and application_type = 'fall'"; $result = pg_query($sql); while ($row = pg_fetch_assoc($result)) { echo "Checking {$row['username']}: "; try { $soapResult = $soap->getStudentInfo($row['username'], $args['term']); if ($soapResult->student_type != 'W') { echo "Application withdrawn but student type is not W!!!!!!!!!!!1\n"; } else { echo "\n"; } } catch (Exception $e) { echo "Unknown student. Ahh!!!\n"; } }
#!/usr/bin/php <?php /** * Manually creates a room assignment and meal plan in Banner * @author Jeff Tickle <jtickle at tux dot appstate dot edu> */ require_once 'SOAP.php'; require_once 'cliCommon.php'; $args = array('username' => '', 'term' => '', 'building' => '', 'room' => '', 'plan' => '', 'meal' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); if ($args['meal'] == 'NULL') { $args['meal'] = null; } $result = $soap->reportRoomAssignment($args['username'], $args['term'], $args['building'], $args['room'], $args['plan'], $args['meal']); print_r($result); echo "\n"; echo "Type is: " . gettype($result) . "\n"; if ($result == "0") { echo "Success!\n"; } else { echo "Not a success\n"; } if ($result != "0") { echo "Failure!\n"; } else { echo "Not a failure\n"; }
#!/usr/bin/php <?php /** * Returns a student's username, given a banner ID * @author Jeremy Booker <jbooker at tux dot appstate dot edu> */ require_once 'SOAP.php'; require_once 'cliCommon.php'; $args = array('bannerid' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $result = $soap->getUsername($args['bannerid']); print_r($result); echo "\n";
#!/usr/bin/php <?php /** * Gets all assignments from HMS and compares them to Banner PROD * @author Jeff Tickle <jtickle at tux dot appstate dot edu> */ require_once 'SOAP.php'; require_once 'cliCommon.php'; require_once '../db_config.php.inc'; $args = array('term' => ''); $switches = array(); check_args($argc, $argv, $args, $switches); $soap = new PhpSOAP(); $db = pg_connect("host={$host} dbname={$database} user={$dbuser} password={$dbpasswd}"); $results = pg_query("\n SELECT\n hms_assignment.asu_username,\n hms_bed.banner_id,\n hms_residence_hall.banner_building_code\n FROM hms_assignment\n JOIN hms_bed ON\n hms_assignment.bed_id = hms_bed.id\n JOIN hms_room ON\n hms_bed.room_id = hms_room.id\n JOIN hms_floor ON\n hms_room.floor_id = hms_floor.id\n JOIN hms_residence_hall ON\n hms_floor.residence_hall_id = hms_residence_hall.id\n WHERE\n hms_room.is_online = 1 AND\n hms_floor.is_online = 1 AND\n hms_residence_hall.is_online = 1 AND\n hms_assignment.term = {$args['term']}\n ORDER BY\n hms_residence_hall.banner_building_code,\n hms_bed.banner_id\n"); while ($row = pg_fetch_assoc($results)) { $banner = $soap->getHousMealRegister($row['asu_username'], $args['term'], 'All'); echo "{$row['asu_username']}:\t"; echo "{$row['banner_building_code']} {$row['banner_id']}"; echo " <=> "; if (!isset($banner->room_assign) || !is_object($banner->room_assign)) { echo "No room assignment! *************************** \n"; continue; } echo "{$banner->room_assign->bldg_code} {$banner->room_assign->room_code}"; if ($row['banner_building_code'] != $banner->room_assign->bldg_code || $row['banner_id'] != $banner->room_assign->room_code) { echo "\t*********************"; } echo "\n"; }