<?php global $unsent; $missing = ugApplicants::appsMissingEmail(); $unsent = ugApplicants::getPopulation('unsent_myp_invite'); function _just_pidms($row) { return $row['pidm']; } function _remove_unsent($row) { global $unsent; return in_array($row['pidm'], $GLOBALS['unsent']) == false; } // $unsent should be an array of pidms $unsent = array_map('_just_pidms', $unsent); // trim users from $missing who no longer need an invite $missing = array_filter($missing, '_remove_unsent'); // remove everyone left in $missing foreach ($missing as $row) { ugApplicants::app_missing_email_resolved($row['pidm']); } PSU::redirect($GLOBALS['BASE_URL'] . '/provisioning.html');
/** * Load various pieces of applicant data. */ protected function _load_applicant() { $args = array('pidm' => $this->person->pidm); $sql = "\n\t\t\tSELECT apdc_code, apdc_date, admt_code, stvapdc_desc apdc_desc, stvadmt_desc admt_desc\n\t\t\tFROM\n\t\t\t\tv_ug_app a LEFT JOIN\n\t\t\t\tstvapdc ON a.apdc_code = stvapdc.stvapdc_code\n\t\t\t\tLEFT JOIN stvadmt ON a.admt_code = stvadmt.stvadmt_code\n\t\t\tWHERE pidm = :pidm\n\t\t"; $row = PSU::db('banner')->GetRow($sql, $args); $this->person->data = $this->person->data + $row; if ($this->person->data['apdc_date']) { $this->person->data['apdc_date'] = strtotime($this->person->data['apdc_date']); } require_once 'ugApplicants.class.php'; $this->person->data['applicant_email'] = ugApplicants::getApplicantEmail($this->person->pidm); // has admissions flagged them for application acknowledgement? $sql = "SELECT 1 FROM v_ug_app_chkl_zack WHERE pidm = :pidm"; $this->person->data['applicant_chkl_zack'] = (bool) PSU::db('banner')->GetOne($sql, $args); // have they been flagged for a missing email? $sql = "SELECT reason FROM app_missing_email WHERE pidm = ? AND resolved = 0"; $this->person->data['applicant_provision_error'] = PSU::db('myplymouth')->GetOne($sql, $args); // does the user have a sabiden/sabnstu record? $sql = "SELECT 1 FROM sabnstu, sabiden WHERE sabiden_pidm = :pidm AND sabiden_aidm = sabnstu_aidm"; $this->person->data['applicant_missing_sabiden_sabnstu'] = !(bool) PSU::db('banner')->GetOne($sql, $args); // is user still in the invite pool? $sql = "SELECT 1 FROM v_ug_app_unsent_myp_invite WHERE pidm = :pidm"; $this->person->data['applicant_pending_invite'] = (bool) PSU::db('banner')->GetOne($sql, $args); }
<?php // role: commonapp required via common.php $pidms = $_POST['pidms']; if (empty($pidms)) { die; } $pidms = explode(',', $pidms); $pidms = array_slice($pidms, 0, 10); $users = array(); foreach ($pidms as $pidm) { $pidm = (int) $pidm; $user = ugApplicants::getApplicant($pidm); $users[$pidm] = $user; } die(json_encode($users));