public function __construct($args = array())
 {
     $args = PSU::params($args);
     $args['type'] = 'radio';
     parent::__construct($args);
     $this->selected = array();
 }
Ejemplo n.º 2
0
 public function handleParams($property, $key = null, $value = null, $defaults = array())
 {
     if ($defaults) {
         $this->handleParams($property, $defaults);
     }
     //end if
     if (is_object($key) && $key instanceof PSUGraphObject) {
         $this->{$property}[$key->id] = $key;
     } elseif (is_array($key) || strpos($key, '=') !== false) {
         $values = PSU::params($key, $defaults);
         foreach ($values as $k => $v) {
             if ($property == 'options') {
                 $this->{$property}[$k] = new PSUGraphOption($k, $v);
             } else {
                 $this->{$property}[$k] = $v;
             }
             //end else
         }
         //end foreach
         return true;
     } elseif ($key && $value) {
         $this->{$property}[$key] = $value instanceof PSUGraphOption ? $value : new PSUGraphOption($k, $v);
         return true;
     } elseif ($key) {
         return $this->{$property}[$key];
     } else {
         return $this->{$property};
     }
     //end else
 }
 /**
  * get all card access actions
  * @param $args \b can include filter, start_date, end_date, id
  * @return array 
  */
 public static function actions($args = '')
 {
     $args = PSU::params($args);
     $where = '';
     if ($args['start_date']) {
         $where .= " AND x_timestamp >= ?";
         $bind['start_date'] = PSU::db('pegasys')->BindTimeStamp(CardAccess::timeStamp($args['start_date']));
     }
     // end if
     if ($args['end_date']) {
         $where .= " AND x_timestamp <= ?";
         $bind['end_date'] = PSU::db('pegasys')->BindTimeStamp(CardAccess::timeStamp($args['end_date'], false));
     }
     // end if
     if ($args['filter']) {
         $where .= " AND x_term_name LIKE '%'+?+'%'";
         $bind['filter'] = $args['filter'];
     }
     // end if
     if ($args['id']) {
         $args['id'] = (int) $args['id'];
         $where .= " AND x_badge_number={$args['id']}";
     }
     // end if
     $sql = "SELECT x_timestamp, x_badge_number, x_fname, x_lname, x_hist_type, x_item_name, x_term_name FROM xaction WHERE 1=1 {$where} ORDER BY x_timestamp DESC";
     return PSU::db('pegasys')->GetAll($sql, $bind);
 }
Ejemplo n.º 4
0
 /**
  * Filter the ticket list.
  *
  * Valid $args:
  *
  * @li $q \b string match text in call history
  * @li $group \b int the assigned group
  */
 public static function search_tickets($args)
 {
     $args = PSU::params($args);
     extract($args);
     $where = array();
     $sql_args = array();
     if ($q) {
         $where[] = 'MATCH (comments) AGAINST (?)';
         $sql_args[] = $q;
     }
     if ($group) {
         $where[] = 'its_assigned_group = ?';
         $sql_args[] = $group;
     }
     if ($call_status) {
         $where[] = 'call_status = ?';
         $sql_args[] = $call_status;
     }
     if ($current) {
         $where[] = 'current = ?';
         $sql_args[] = $current;
     }
     $where_sql = implode(' AND ', $where);
     $sql = "\n\t\t\tSELECT *\n\t\t\tFROM call_history\n\t\t\tWHERE\n\t\t\t\t{$where_sql}\n\t\t\tORDER BY\n\t\t\t\tdate_assigned DESC,\n\t\t\t\ttime_assigned DESC\n\t\t";
     return PSU::db('calllog')->GetAll($sql, $sql_args);
 }
Ejemplo n.º 5
0
 public function query($args = array())
 {
     $args = \PSU::params($args, $defaults);
     $sql = "\n\t\t\tSELECT DISTINCT pidm\n\t\t\t  FROM v_account\n\t\t";
     $results = \PSU::db('banner')->GetCol($sql, $args);
     return $results;
 }
 /**
  * instantiates a group of PSURotation objects and returns them
  */
 public static function get_collection($dir, $params = array())
 {
     $params = PSU::params($params, self::$defaults);
     if ($params['type'] == 'image') {
         $files = PSUFiles::getImageArray($dir, 0, $params['depth']);
     } else {
         $files = PSUFiles::getImageArray($dir, 0, $params['depth'], array('txt', 'html'));
     }
     //end if
     foreach ((array) $files as $key => $file) {
         if (strpos($file, '/thumbs/') !== false) {
             unset($files[$key]);
         }
         //end if
     }
     //end foreach
     sort($files);
     $num_files = count($files);
     $collection = array();
     $collection_count = 0;
     while ($collection_count < $num_files && $collection_count < 4) {
         $random_index = rand(0, count($files) - 1);
         $params['set'] = $files[$random_index];
         $collection[] = new self($dir, $params);
         unset($files[$random_index]);
         sort($files);
         $collection_count = count($collection);
     }
     //end while
     return $collection;
 }
Ejemplo n.º 7
0
 /**
  * constructor
  *
  * @param $person \b PSUPerson object
  * @param $level_or_data \b This can be 1 of two things:
  *                          - if a string, it is the Level code of student data (e.g. ug, gr, etc)
  *                          - if an array, it is an array of sgbstdn data
  * @param $term_code \b Effective term code
  */
 public function __construct($student, $level_or_data, $max_term_code = null, $term_code_eff = null)
 {
     parent::__construct();
     $data_loaders = array();
     $this->data_loaders = \PSU::params($data_loaders, $this->data_loaders);
     // make sure this object can access its associated PSU_Student
     if ($student instanceof \PSU\Student) {
         $this->student = $student;
     } else {
         $this->student = $person->student;
     }
     //end if
     // store the pidm globally to shorten the bind variables in queries :)
     $this->pidm = $this->student->person->pidm;
     if (is_array($level_or_data)) {
         $this->parse($level_or_data);
         $this->term_code = $max_term_code ? $max_term_code : \PSU\Student::getCurrentTerm($this->level_code);
     } else {
         $this->level_code = $level_or_data;
         $this->term_code = $max_term_code ? $max_term_code : \PSU\Student::getCurrentTerm($this->level_code);
         $this->term_code_eff = $term_code_eff;
         $this->load();
     }
     //end else
 }
Ejemplo n.º 8
0
 public function query($args = array())
 {
     $defaults = array('full_part' => $this->full_part, 'residential_code' => $this->residential_code, 'rate_code' => $this->rate_code);
     $args = \PSU::params($args, $defaults);
     $sql = "\n\t\t\tSELECT pidm\n\t\t\t  FROM v_prebilling_candidates\n\t\t\t WHERE full_part_ind = :full_part\n\t\t\t\t AND resd_code = :residential_code\n\t\t\t\t AND rate_code = :rate_code\n\t\t";
     $results = \PSU::db('banner')->GetCol($sql, $args);
     return $results;
 }
Ejemplo n.º 9
0
 public function query($args = array())
 {
     $defaults = array('type_id' => $this->type, 'attribute' => $this->attribute);
     $args = \PSU::params($args, $defaults);
     $sql = "\n\t\t\tSELECT distinct wp_id\n\t\t\t  FROM (\n\t\t\t\t\t\tSELECT wp_id\n\t\t\t\t\t\t\tFROM v_idm_attributes\n\t\t\t\t\t\t WHERE attribute = :attribute\n\t\t\t\t\t\t\t AND type_id = :type_id\n\t\t\t\t\t\t ORDER BY lower(last_name), \n\t\t\t\t\t\t\t\t\t lower(first_name), \n\t\t\t\t\t\t\t\t\t lower(middle_name)\n\t\t\t\t\t\t\t)\n\t\t";
     $results = \PSU::db('banner')->GetCol($sql, $args);
     return $results;
 }
Ejemplo n.º 10
0
 public function query($args = array())
 {
     $defaults = array('identifier' => 'sourced_id');
     $args = PSU::params($args, $defaults);
     $sql = "\n\t\t\tSELECT DISTINCT idnt." . $args['identifier'] . " \n\t\t\tFROM psu_identity.person_identifiers idnt,\n\t\t\t\t psu.v_hr_psu_employee_active act \n\t\t\tWHERE idnt.pid = act.pidm\n\t\t";
     $matches = PSU::db('banner')->GetCol($sql);
     return $matches;
 }
Ejemplo n.º 11
0
 public function __construct($args = array())
 {
     $args = PSU::params($args);
     $this->fileid = 0;
     $this->adodb_type = 'N';
     parent::__construct($args);
     $this->type->value = 'file';
 }
Ejemplo n.º 12
0
 public function __construct($id, $procedure, $in = array(), $out = array(), $date_fields = array())
 {
     $this->id = $id;
     $this->procedure = $procedure;
     $this->in = PSU::params($in);
     $this->out = $out;
     $this->date_fields = PSU::params($date_fields);
     return $this;
 }
 /**
  *
  */
 public function __construct($args = array())
 {
     $args = PSU::params($args);
     $args['type'] = 'submit';
     // text by default
     $args['class'] = 'signoff';
     $args['maxlength'] = 75;
     parent::__construct($args);
 }
Ejemplo n.º 14
0
 public function __construct($args = array())
 {
     $args = PSU::params($args, array('type' => 'text'));
     $this->adodb_type = "C";
     $this->maxlength = new HTMLAttribute();
     $this->size = new HTMLAttribute(20);
     $this->value = new HTMLAttribute();
     parent::__construct($args);
 }
Ejemplo n.º 15
0
 function __construct($args = array())
 {
     $args = \PSU::params($args);
     if (!isset($args['size'])) {
         // MM/DD/YYYY HH:MM:SS
         $args['size'] = 19;
     }
     parent::__construct($args);
     $this->formatting = array($this, 'convert_datetimestring');
 }
 public function query($args = array())
 {
     $defaults = array('term_code' => null, 'level_code' => 'UG');
     $args = PSU::params($args, $defaults);
     if (!isset($args['term_code'])) {
         $args['term_code'] = \PSU\Student::getCurrentTerm($args['level_code']);
     }
     $sql = "\n\t\t\tSELECT DISTINCT gobsrid_sourced_id\n\t\t\tFROM gobsrid, baninst1.as_student_enrollment_summary \n\t\t\tWHERE gobsrid_pidm = pidm_key \n\t\t\tAND majr_code1 = '0000' \n\t\t\tAND ests_code = 'EL' \n\t\t\tAND stst_code = 'AS' \n\t\t\tAND term_code_key = :term_code \n\t\t\tAND styp_code = 'N' \n\t\t\tAND levl_code = :level_code\n\t\t";
     return PSU::db('banner')->GetCol($sql, $args);
 }
Ejemplo n.º 17
0
 public function query($args = array())
 {
     $defaults = array('identifier' => 'sourced_id');
     $args = PSU::params($args, $defaults);
     $sql = "\n\t\t\tSELECT DISTINCT b." . $args['identifier'] . "\n\t\t\t  FROM PSU.v_student_account_active_terms a\n\t\t\t  JOIN PSU_IDENTITY.person_identifiers b\n\t\t\t\tON a.pidm = b.pid\n\t\t\t WHERE a.degc_code <> '000000'\n\t\t\t   AND a.levl_code = 'GR'\n\t\t";
     unset($args['identifier']);
     \PSU::db('banner')->debug = true;
     $matches = PSU::db('banner')->GetCol($sql, $args);
     return $matches;
 }
Ejemplo n.º 18
0
 function __construct($args = array())
 {
     $args = PSU::params($args);
     $this->formatting = 'FormDate::convert_datestring';
     if (!isset($args['size'])) {
         $args['size'] = 11;
     }
     parent::__construct($args);
     $this->addClass('datepicker');
     $this->adodb_type = 'D';
 }
 public function __construct($args = array())
 {
     $args = PSU::params($args);
     $this->size = new HTMLAttribute();
     $this->multiple = new HTMLAttribute();
     $this->options = array();
     $this->selected = array();
     $this->tag_name = 'select';
     $this->hasBlank = true;
     parent::__construct($args);
 }
 public function query($args = array())
 {
     $defaults = array('term_code' => null, 'level_code' => 'UG');
     $args = PSU::params($args, $defaults);
     if (!isset($args['term_code'])) {
         $args['term_code'] = \PSU\Student::getCurrentTerm($args['level_code']);
     }
     $sql = "\n\t\t\tSELECT sgbstdn_pidm FROM sgbstdn WHERE\n\t\t\tsgbstdn_stst_code = 'AS' AND\n\t\t\tsgbstdn_styp_code IN ('I', 'N', 'T') AND\n\t\t\tsgbstdn_term_code_admit = :term_code AND\n\t\t\tsgbstdn_levl_code = :level_code\n\t\t";
     $matches = PSU::db('banner')->GetCol($sql, $args);
     return $matches;
 }
Ejemplo n.º 21
0
 public function __construct($args = array())
 {
     $args = PSU::params($args);
     if (!isset($args['size'])) {
         $args['size'] = 20;
     }
     if (!isset($args['maxlength'])) {
         $args['maxlength'] = 90;
     }
     parent::__construct($args);
 }
 public function __construct($args = array())
 {
     $args = PSU::params($args);
     $this->rows = new HTMLAttribute(10);
     $this->cols = new HTMLAttribute(40);
     parent::__construct($args);
     $this->adodb_type = "XL";
     unset($this->value);
     $this->value = '';
     unset($this->size);
     $this->tag_name = 'textarea';
 }
Ejemplo n.º 23
0
 public function __construct($pidm, $term_code = null)
 {
     parent::__construct();
     $data_loaders = array('primary_spouse' => 'spouse', 'spouse_category' => 'spouse', 'income' => 'constituent_information', 'college' => 'constituent_information', 'occupation' => 'constituent_information', 'category' => 'constituent_information', 'recent_gift_date' => 'gift_summary', 'recent_gift_amount' => 'gift_summary', 'recent_designation' => 'gift_summary', 'recent_gift_year' => 'gift_summary', 'high_gift_date' => 'gift_summary', 'high_gift_amount' => 'gift_summary', 'high_designation' => 'gift_summary', 'number_gifts' => 'gift_summary', 'hard_credit' => 'gift_summary', 'pledge_payments' => 'gift_summary', 'outright_gifts' => 'gift_summary');
     $this->data_loaders = \PSU::params($data_loaders, $this->data_loaders);
     if (is_array($pidm)) {
         $this->parse($pidm);
     } else {
         $this->pidm = $pidm;
         $this->load($pidm);
     }
     //end else
 }
 public function query($args = array())
 {
     $defaults = array();
     $matches = array();
     $args = \PSU::params($args, $defaults);
     $active_sql = "SELECT * FROM v_rave_eligible_phones";
     $active_users = \PSU::db('banner')->GetAll($active_sql);
     foreach ($active_users as $user) {
         $matches[$user['wp_id']] = $user;
     }
     //end foreach
     return $matches;
 }
 public function __construct($args = array())
 {
     $args = PSU::params($args);
     $args['type'] = 'checkbox';
     if (!isset($args['options'])) {
         $args['options'] = array('Yes');
         $args['maxlength'] = 3;
     }
     parent::__construct($args);
     if (!$this->selected) {
         $this->selected = array();
     }
 }
Ejemplo n.º 26
0
 public function query($args = array())
 {
     $args = \PSU::params($args, $defaults);
     $where_sql = array('1=1');
     $where_sql[] = 'gate_id = :gate_id';
     $where_sql = implode(' AND ', $where_sql);
     if (!key_exists('gate_id', $args)) {
         $args['gate_id'] = $this->gate_id;
     }
     //end if
     $sql = "\n\t\t\tSELECT DISTINCT pi.pid pidm, pi.first_name, pi.last_name, sgc.*\n\t\t\tFROM\n\t\t\t\tpsu_teacher_cert.v_student_gate_systems sgc\n\t\t\t\tJOIN gorirol g\n\t\t\t\t\tON g.gorirol_pidm = sgc.pidm\n\t\t\t\t AND g.gorirol_role_group = 'INTCOMP'\n\t\t\t\t AND g.gorirol_role = 'STUDENT_ACCOUNT_ACTIVE'\n\t\t\t\tJOIN psu_identity.person_identifiers pi \n\t\t\t\t\tON pi.pid = sgc.pidm\n\t\t\t\tJOIN spriden \n\t\t\t\t\tON spriden.spriden_pidm = pi.pid\n\t\t\tWHERE {$where_sql}\n\t\t\tORDER BY upper(pi.last_name), upper(pi.first_name)\n\t\t";
     return \PSU::db('banner')->GetAll($sql, $args);
 }
 /**
  * construct gateway URL
  */
 public function url($processor, $params = false, $server = 'test', $type = 'commerce_manager')
 {
     $params = PSU::params($params);
     $person = PSUPerson::get($params['id']);
     $this->setURLParam('orderType', $processor);
     $this->setURLParam('amountDue', $params['amount']);
     $this->setURLParam('currentAmountDue', $params['current_amount']);
     $this->setURLParam('orderNumber', $params['id']);
     $this->setURLParam('orderName', $person->formatName('l, f m'));
     $this->setURLParam('orderDescription', $processor);
     $this->setURLParam('userChoice2', $params['term']);
     $server = 'prod';
     return $this->_url($server, $type);
 }
Ejemplo n.º 28
0
 /**
  * constructor
  */
 public function __construct($pidm, $term_codes, $params = null)
 {
     $this->pidm = $pidm;
     $this->params = \PSU::params($params);
     if ($term_codes && !is_array($term_codes)) {
         $term_codes = array($term_codes);
     }
     //end if
     foreach ($term_codes as $term_code => $value) {
         $this->terms[$term_code] = null;
     }
     //end foreach
     ksort($this->terms);
 }
Ejemplo n.º 29
0
 public function __construct($crn, $term_code, $params = null)
 {
     parent::__construct();
     $data_loaders = array('cross_list_group' => 'cross_listed', 'cross_list_desc' => 'cross_listed', 'cross_list_max_enrollment' => 'cross_listed', 'cross_list_enrollment' => 'cross_listed', 'cross_list_seats_available' => 'cross_listed', 'meeting_times' => 'schedule', 'meeting_locations' => 'schedule');
     $this->data_loaders = \PSU::params($this->data_loaders, $data_loaders);
     $this->crn = $crn;
     $this->term_code = $term_code;
     if ($params) {
         $params = \PSU::params($params);
         $this->parse($params);
     } else {
         $this->load();
     }
     //end else
 }
Ejemplo n.º 30
0
function formatRecord($person, $merge_with = array())
{
    $base_person = array('pidm' => '', 'wpid' => '', 'psu_id' => '', 'username' => '', 'email' => '', 'msc' => '', 'name_first' => '', 'name_first_formatted' => '', 'name_first_metaphone' => '', 'name_last' => '', 'name_last_formatted' => '', 'name_last_metaphone' => '', 'name_middle_formatted' => '', 'name_full' => '', 'phone_of' => '', 'phone_vm' => '', 'emp' => '0', 'stu' => '0', 'stu_account' => '0', 'dept' => '', 'title' => '', 'major' => '', 'has_idcard' => '0');
    $person['office_phone'] = PSU::stripPunct($person['office_phone']);
    $person['phone_number'] = PSU::stripPunct($person['phone_number']);
    if ($merge_with) {
        $merge_with = PSU::params($merge_with, $base_person);
        $person = PSU::params($person, $merge_with);
    } else {
        $person = PSU::params($person, $base_person);
    }
    //end else
    $final = array('pidm' => $person['pidm'], 'wpid' => $person['wp_id'], 'psu_id' => $person['psu_id'], 'username' => !strpos($person['username'], '@') ? trim($person['username']) : substr($person['username'], 0, strpos($person['username'], '@')), 'email' => !strpos($person['email'], '@') ? trim($person['email']) : substr($person['email'], 0, strpos($person['email'], '@')), 'msc' => $person['msc'] ? $person['msc'] : '', 'name_first' => PSU::stripPunct($person['first_name']), 'name_first_formatted' => $person['first_name'], 'name_first_metaphone' => metaphone(PSU::stripPunct($person['first_name'])), 'name_last' => PSU::stripPunct($person['last_name']), 'name_last_formatted' => $person['last_name'], 'name_last_metaphone' => metaphone(PSU::stripPunct($person['last_name'])), 'name_middle_formatted' => $person['middle_name'], 'name_full' => trim(preg_replace('/\\s\\s+/', ' ', $person['first_name'] . ' ' . substr($person['middle_name'], 0, 1) . ' ' . $person['last_name'] . ' ' . $person['spbpers_name_suffix'])), 'phone_of' => $person['office_phone'] ? '(603) ' . substr($person['office_phone'], 0, 3) . '-' . substr($person['office_phone'], 3) : FALSE, 'phone_vm' => $person['phone_number'] ? '(603) ' . substr($person['phone_number'], 0, 3) . '-' . substr($person['phone_number'], 3) : FALSE, 'emp' => $person['emp'] ? 1 : 0, 'stu' => $person['stu'] ? 1 : 0, 'stu_account' => $person['stu_account'] ? 1 : 0, 'dept' => $person['department'] ?: '', 'title' => $person['title'] ?: '', 'major' => $person['major'] ?: '', 'has_idcard' => $person['has_idcard']);
    return $final;
}