当前位置: 首页>>代码示例>>PHP>>正文


PHP PSU::nvl方法代码示例

本文整理汇总了PHP中PSU::nvl方法的典型用法代码示例。如果您正苦于以下问题:PHP PSU::nvl方法的具体用法?PHP PSU::nvl怎么用?PHP PSU::nvl使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PSU的用法示例。


在下文中一共展示了PSU::nvl方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 public function __construct($row)
 {
     $row['id'] = $row['id'] ?: -1;
     $row['data_source'] = $row['data_source'] ?: 'judicial';
     $row['detail_code'] = $row['detail_code'] ?: static::$default_detail_code;
     $row['entry_date'] = $row['entry_date'] ?: date('Y-m-d H:i:s');
     $row['username'] = \PSU::nvl($row['username'], $_SESSION['username'], 'script');
     parent::__construct($row);
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:9,代码来源:Judicial.php

示例2: __construct

 public function __construct($row)
 {
     $row['id'] = $row['id'] ?: -1;
     $row['data_source'] = $row['data_source'] ?: 'library';
     $row['detail_code'] = $row['detail_code'] ?: static::$default_detail_code;
     $row['entry_date'] = $row['entry_date'] ?: date('Y-m-d H:i:s');
     $row['username'] = \PSU::nvl($row['username'], $_SESSION['username'], 'script');
     parent::__construct($row);
     if (!$this->meta('description')) {
         $this->set_meta('description', 'Library Billing Fee');
     }
     //end if
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:13,代码来源:Library.php

示例3: __construct

 /**
  * constructor
  */
 public function __construct($data = null)
 {
     // in the event that 'source' wasn't passed in,
     // prepare a default source user
     $default_user = \PSU::nvl($_SESSION['wp_id'], 'script');
     $defaults = array('phone_type' => 'CE', 'source' => 'USER:' . $default_user);
     $data = \PSU::params($data, $defaults);
     parent::__construct($data);
     if ($this->phone) {
         // remove any formatting on the passed in phone number
         $this->phone = self::unformat($this->phone);
         // split the number out into parts (for compatibility with \PSU\Phone)
         $data = $this->parse($this->phone);
         $this->area = $data['area'] ?: '603';
         $this->number = $data['number'];
     }
     //end if
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:21,代码来源:Phone.php

示例4: isset

$reason = isset($_GET['reason']) ? $_GET['reason'] : null;
try {
    if ($action == 'impersonate') {
        if (!$GLOBALS['ape']->canResetPassword()) {
            throw new Exception('You are not allowed to modify account locks.');
        }
        $person = new PSUPerson($identifier);
        $redirect_id = PSU::nvl($person->wp_id, $person->id);
        $GLOBALS['LOG']->write('Impersonating account: ' . $reason, $person->login_name);
        $_SESSION['impersonate'] = TRUE;
        $_SESSION['impersonate_store'] = array('wp_id' => $_SESSION['wp_id'], 'username' => $_SESSION['username'], 'pidm' => $_SESSION['pidm'], 'fullname' => $_SESSION['fullname']);
        $_SESSION['wp_id'] = $person->wp_id;
        $_SESSION['username'] = PSU::nvl($person->login_name, $person->wp_id);
        $_SESSION['pidm'] = $person->pidm;
        $_SESSION['fullname'] = $person->formatName('f m l');
        $_SESSION['phpCAS']['user'] = PSU::nvl($person->login_name, $person->wp_id);
        unset($_SESSION['AUTHZ']);
        if ($_SESSION['pidm']) {
            PSU::get('idmobject')->loadAuthZ($_SESSION['pidm']);
        }
        //end if
        unset($_SESSION['AUTHZ']['admin']);
        foreach ((array) $_SESSION['AUTHZ']['permission'] as $key => $value) {
            if (strpos($key, 'ape_') === 0) {
                unset($_SESSION['AUTHZ']['permission'][$key]);
            }
            //end if
        }
        //end foreach
        $message = 'Now impersonating: ' . $_SESSION['username'] . ' (' . $_SESSION['wp_id'] . ')';
        $_SESSION['messages'][] = $message;
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:31,代码来源:account-impersonate.php

示例5: getOpenCalls


//.........这里部分代码省略.........
            break;
        case 'unassigned':
            $query .= " AND tlc_assigned_to='unassigned' AND (its_assigned_group='0' || its_assigned_group='unassigned' || its_assigned_group='')";
            break;
        case 'caller':
            $person = new PSUPerson($options['who']);
            $query .= " AND (call_log.wp_id = '{$person->wp_id}' OR call_log.pidm = {$person->pidm} OR call_log.caller_username='{$options['who']}')";
            break;
        case 'today':
            $query .= " AND call_log.call_date=NOW()";
            break;
        case 'my_opened':
            $query .= " AND call_log.calllog_username='{$options['who']}' AND call_history.call_status='open'";
            break;
        case 'my':
            $query .= " AND ( call_history.tlc_assigned_to='{$options['who']}'";
            $high_priority_groups = implode(',', User::getHighPriorityGroups(false, $options['who']));
            if ($high_priority_groups) {
                $query .= " OR ( call_history.its_assigned_group IN ({$high_priority_groups}) AND call_history.call_priority = 'high' )";
            }
            $query .= " )";
            break;
        default:
            $query .= " AND call_history.tlc_assigned_to='{$options['who']}'";
            break;
    }
    // end switch
    $query .= " AND call_history.current='1'";
    if (!$options['sort_by'] || $options['sort_by'] == 'call_date') {
        $options['sort_by'] = 'call_date, call_time';
    } elseif ($options['sort_by'] == 'call_updated') {
        $options['sort_by'] = 'date_assigned, time_assigned';
    }
    $query .= " ORDER BY {$options['sort_by']} ASC";
    $calls = PSU::db('calllog')->GetAll($query);
    foreach ($calls as &$call) {
        // needed for the template, but a bit redundant
        $call['call_title'] = $call['title'];
        // determine an assigned_to that combines person and queue/group
        $groupArray = getGroupInfo($call['its_assigned_group']);
        if ($call['its_assigned_group'] != 0 || $groupArray[1] != '') {
            if ($call['tlc_assigned_to'] != 'unassigned') {
                $call['assigned_to']['group'] = $groupArray[1];
                $call['assigned_to'][] = $call['tlc_assigned_to'];
            } else {
                $call['assigned_to']['group'] = $groupArray[1];
            }
        } elseif ($call['tlc_assigned_to'] != '') {
            $call['assigned_to'][] = $call['tlc_assigned_to'];
        } else {
            $call['assigned_to'][] = 'None';
        }
        $call['building_name'] = getBuildingName($call['location_building_id']);
        if ($call['date_assigned']) {
            $assign_datetime = $call['date_assigned'] . ' ' . $call['time_assigned'];
            $call['activity_datetime'] = time() - strtotime($assign_datetime);
            $call['date_assigned'] = date('M j, Y', strtotime($assign_datetime));
            $call['time_assigned'] = date('g:i a', strtotime($assign_datetime));
        }
        //end if
        $call['call_activity_diff'] = \PSU::date_diff(time(), strtotime($assign_datetime), 'simple');
        $call['call_summary'] = substr($call['comments'], 0, 100) . (strlen($call['comments']) > 100 ? '...' : '');
        $call['show_comments'] = str_replace("\"", "&#34", addslashes(substr(strip_tags(str_replace(array("\n", "\t", "\r"), '', $call['comments'])), 0, 30)));
        $call_datetime = $call['call_date'] . ' ' . $call['call_time'];
        $call['call_open_time'] = time() - strtotime($call_datetime);
        $call['call_date'] = date('M j, Y', strtotime($call_datetime));
        $call['call_time'] = date('g:i a', strtotime($call_datetime));
        if ($call['feelings_face']) {
            $call['feelings_face'] = '<br/><img src="/webapp/feedback/templates/images/feedback-' . $call['feelings_face'] . '.png" class="feedback-face" title="' . $call['feelings'] . '"/>';
        }
        //end if
        // If the time that the call has been open (call_open_time) is greater than one week (604800 seconds)
        if ($call['call_open_time'] > 604800) {
            // Set a call age status variable and mark it as old
            $call['call_age_status'] = 'old';
        } else {
            // Otherwise, mark it as normal
            $call['call_age_status'] = 'normal';
        }
        // If the time since the call has been updated (activity_datetime) is greater than one week (604800 seconds)
        if ($call['activity_datetime'] > 604800) {
            // Set an activity  age status variable and mark it as old
            $call['activity_age_status'] = 'old';
        } else {
            // Otherwise, mark it as normal
            $call['activity_age_status'] = 'normal';
        }
        $identifier = PSU::nvl($call['caller_username'], $call['wp_id'], $call['pidm']);
        //grabs the person data for the call
        $person = (array) $GLOBALS['user']->getCallerData($identifier);
        //overrides the username that was saved in the call with the username that was found from PSUPerson
        //this is to prevent ~500 calls displaying improper information
        //that were created with wp_ids instead of usernames as the username identifier
        $call['caller_username'] = $person['username'] ?: $person['identifier'];
        //merges the person array and single call(row) array
        $call = array_merge($call, $person);
    }
    // end foreach
    return $calls;
}
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:101,代码来源:open_call_functions.php

示例6: sanitize

 /**
  * sanitize the object properties so we don't get h4xx0r3d
  */
 public function sanitize()
 {
     // fields are ordered the same as in gb_telephone package
     $fields = array('pidm' => FILTER_SANITIZE_NUMBER_INT, 'seqno' => FILTER_SANITIZE_NUMBER_INT, 'tele_code' => FILTER_SANITIZE_STRING, 'phone_area' => FILTER_SANITIZE_STRING, 'phone_number' => FILTER_SANITIZE_STRING, 'phone_ext' => FILTER_SANITIZE_STRING, 'status_ind' => FILTER_SANITIZE_STRING, 'atyp_code' => FILTER_SANITIZE_STRING, 'addr_seqno' => FILTER_SANITIZE_NUMBER_INT, 'primary_ind' => FILTER_SANITIZE_STRING, 'unlist_ind' => FILTER_SANITIZE_STRING, 'comment' => FILTER_SANITIZE_STRING, 'intl_access' => FILTER_SANITIZE_STRING, 'data_origin' => FILTER_SANITIZE_STRING, 'user_id' => FILTER_SANITIZE_STRING, 'ctry_code_phone' => FILTER_SANITIZE_STRING);
     $data = array();
     // build the data array for inserts/updates
     foreach ($fields as $field => $filter) {
         $data[$field] = filter_var($this->{$field}, $filter) ?: null;
     }
     //end foreach
     // attempt to use the session username as the user that updated the phone
     //   failover to the user defined in the object
     //   failover to hostname
     //   failover to script
     $data['user_id'] = strtoupper(\PSU::nvl($_SESSION['username'], $data['user_id'], $_SERVER['REMOTE_HOST'], 'script'));
     return $data;
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:20,代码来源:Phone.php

示例7: addNewCall

 function addNewCall($new_call_form_vars, $call_location = '')
 {
     $query_status = '';
     // Gets new call form variables from add_new_call.html
     $call_log = array();
     $call_history = array();
     // Vars going to addToCallLog--I laid them out in a way that matched the database.
     $call_log['call_id'] = '';
     $person = new PSUPerson($new_call_form_vars['caller_user_name']);
     $call_log['wp_id'] = $person->wp_id;
     $call_log['pidm'] = $person->pidm ? $person->pidm : 0;
     $call_log['caller_username'] = PSU::nvl($person->username, $person->wp_id, $new_call_form_vars['caller_user_name']);
     //required
     $call_log['caller_first_name'] = stripslashes($person->formatName('f'));
     //required
     $call_log['caller_last_name'] = stripslashes($person->formatName('l'));
     //required
     $call_log['caller_phone_number'] = $new_call_form_vars['caller_phone_number'];
     //required
     $call_log['calllog_username'] = $_SESSION['username'];
     //required
     $call_log['call_type'] = $new_call_form_vars['resnet_check'];
     $call_log['call_time'] = 'NOW()';
     $call_log['call_date'] = 'NOW()';
     $call_log['keywords'] = stripslashes($new_call_form_vars['keywords_list']);
     $call_log['location_building_id'] = $new_call_form_vars['location_building_id'];
     $call_log['location_building_room_number'] = $new_call_form_vars['location_building_room_number'];
     $call_log['location_call_logged_from'] = $call_location;
     $call_log['title'] = stripslashes($new_call_form_vars['title']);
     $call_log['feelings'] = stripslashes($new_call_form_vars['feelings']);
     $call_log['feelings_face'] = $new_call_form_vars['feelings_face'];
     // If the new auto-incremented call_id was returned
     if ($new_call_id = $this->addToCallLog($call_log)) {
         // Vars going to addToCallHistory
         $call_history['id'] = '';
         $call_history['call_id'] = $new_call_id;
         $call_history['updated_by'] = $_SESSION['username'];
         $call_history['tlc_assigned_to'] = $new_call_form_vars['tlc_assigned_to'];
         if ($call_history['tlc_assigned_to'] != "" && $call_history['tlc_assigned_to'] == "helpdesk") {
             $call_history['tlc_assigned_to'] = "";
         }
         $call_history['its_assigned_group'] = $new_call_form_vars['its_assigned_group'];
         if ($call_history['its_assigned_group'] != "") {
         }
         $call_history['comments'] = stripslashes($new_call_form_vars['problem_details']);
         //required
         $call_history['date_assigned'] = 'NOW()';
         $call_history['time_assigned'] = 'NOW()';
         $call_history['call_status'] = $new_call_form_vars['call_status'];
         //required
         $call_history['call_priority'] = $new_call_form_vars['call_priority'];
         //required
         $call_history['call_state'] = $new_call_form_vars['call_state'];
         //required
         $call_history['current'] = 1;
         $status = $this->addToCallHistory($call_history);
         if (!$status) {
             $_SESSION['user_message'] = 'Error inserting new call into call_history table.';
         }
     } else {
         $_SESSION['user_message'] = 'Error retrieving new auto-incremented call_id.';
     }
     return $new_call_id;
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:64,代码来源:add_update.class.php

示例8: sendOpenCallMail

function sendOpenCallMail($call_info, $action)
{
    global $db;
    $person_cache = array();
    $call = $db->GetRow("SELECT * FROM call_log WHERE call_id = ?", array($call_info['call_id']));
    $call_info['call_date'] = $call['call_date'] . ' ' . $call['call_time'];
    $headers = array();
    $headers['content-type'] = 'text/html';
    $caller = PSU::nvl($call_info['caller_wp_id'], $call_info['caller_pidm'], $call_info['call_log_username']);
    $caller_data = $GLOBALS['user']->getCallerData($caller);
    $logger = $person_cache[$call_info['call_log_username']] = PSUPerson::get($call_info['call_log_username']);
    $groupInfo = getGroupInfo($call_info['its_group_assigned_to']);
    $call_log_employee = checkEmployee($call_info['call_log_username']);
    $assigned_employee = checkEmployee($call_info['tlc_assigned_to']);
    $to = array();
    // always send to the submitter if the submitter is an employee
    if ($call_log_employee) {
        if ($logger->system_account_exists) {
            $to[] = $logger->wp_email;
        }
        //end
    } else {
        $end_user_to = $logger->wp_email;
    }
    //end else
    if ($action == "its_staff") {
        $call_info['call_id'] = $call_info['new_call_id'] . $call_info['call_id'];
        $call_info['comments'] = $call_info['problem_details'] . $call_info['comments'];
        if ($call_info['tlc_assigned_to'] != "unassigned") {
            if ($assigned_employee) {
                $to[] = PSUPerson::get($call_info['tlc_assigned_to'])->wp_email;
            } elseif ($call_info['tlc_assigned_to'] == 'caller' && $call_info['call_id']) {
                $sql = "SELECT caller_username \n\t\t\t\t\t\t\t\t\tFROM call_log \n\t\t\t\t\t\t\t\t WHERE call_log.call_id = ?";
                $end_user_to = $db->GetOne($sql, array($call_info['call_id']));
                if ($end_user_to) {
                    $end_user = PSUPerson::get($end_user_to);
                    if ($end_user) {
                        $end_user_to = $end_user->wp_email;
                    }
                }
                //end if
            } else {
                $end_user = PSUPerson::get($call_info['tlc_assigned_to']);
                $end_user_to = $end_user->wp_email;
            }
            //end if
        }
        //end if
        if ($call_info['its_assigned_group'] != 0) {
            $sql = "SELECT email_to \n\t\t\t\t\t\t\t\tFROM   itsgroups\n\t\t\t\t\t\t\t\t     , call_log \n\t\t\t\t\t\t\t\t\t\t , call_history \n\t\t\t\t\t\t\t WHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id \n\t\t\t\t\t\t\t\t AND itsgroups.itsgroupid = ?\n\t\t\t           AND call_log.call_id = ?";
            $email_to = $db->GetOne($sql, array($call_info['its_assigned_group'], $call_info['call_id']));
            if ($email_to == 'all') {
                $sql = "SELECT user_name\n\t\t\t\t\t\t\t\t\tFROM   itsgroups\n\t\t\t\t\t\t\t\t\t     , its_employee_groups\n\t\t\t\t\t\t\t\t\t     , call_log_employee\n\t\t\t\t\t\t\t\t\tWHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.call_log_user_id = its_employee_groups.employee_id \n\t\t\t\t\t\t\t\t\t\tAND its_employee_groups.group_id = ?\n\t\t\t\t\t\t\t\t\t\tAND itsgroups.itsgroupid = its_employee_groups.group_id \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.status = 'active' \n\t\t\t\t            AND its_employee_groups.option_id = '2'";
                $email_list = $db->GetCol($sql, array($call_info['its_assigned_group']));
            } else {
                $email_list = explode(',', $email_to);
            }
            //end else
            foreach ((array) $email_list as $identifier) {
                $user = PSUPerson::get($identifier);
                $to[] = $user->wp_email;
            }
            //end foreach
        }
        //end if
        if ($call_info['its_group_assigned_to'] != 0) {
            $subject = '[Call Log] [' . $groupInfo[1] . '] ' . $caller_data['name_full'];
        } else {
            $subject = '[Call Log] ' . $caller_data['name_full'];
        }
        $subject .= ' (#' . $call_info['call_id'] . ')';
        if ($call_info['call_status'] == 'closed') {
            $subject .= ' [CLOSED]';
            // always send close to the owner, if they are allowed to see the
            // full history
            $caller_identifier = $db->GetOne("SELECT calllog_username FROM call_log WHERE call_log.call_id = '{$call_info['call_id']}'");
            $caller_user = PSUPerson::get($caller_identifier);
            if ($GLOBALS['end_user_email']) {
                $closing_user = PSUPerson::get($_SESSION['wp_id']);
                if ($caller_user->wp_email == $closing_user->wp_email) {
                    $end_user_to = $closing_user->wp_email;
                }
                //end if
            } elseif (checkEmployee($caller_to)) {
                $to[] = $caller_user->wp_email;
            }
            //end else
        }
        $sql = "SELECT * \n\t\t\t\t\t\t\tFROM   call_log\n\t\t\t\t\t\t\t     , call_history \n\t\t\t\t\t\t WHERE call_log.call_id = ?\n\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id\n\t\t\t\t\t\t ORDER BY date_assigned DESC\n\t\t               , time_assigned DESC";
        $call_info_query = $db->Execute($sql, array($call_info['call_id']));
        foreach ($call_info_query as $call_info2) {
            $group_name = getGroupInfo($call_info2['its_assigned_group']);
            if ($group_name[0] == '') {
                $group_name = 'Unassigned';
            } else {
                $group_name = $group_name[0];
            }
            $call_info2['group_name'] = $group_name;
            $call_info2['update_date'] = $call_info2['date_assigned'] . ' ' . $call_info2['time_assigned'];
            if ($call_info2['tlc_assigned_to'] && $call_info2['tlc_assigned_to'] != 'unassigned') {
//.........这里部分代码省略.........
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:101,代码来源:functions.php

示例9: sanitize

 /**
  * sanitize the object properties so we don't get h4xx0r3d
  */
 public function sanitize()
 {
     // fields are ordered the same as in gb_address package
     $fields = array('pidm' => FILTER_SANITIZE_NUMBER_INT, 'atyp_code' => FILTER_SANITIZE_STRING, 'seqno' => FILTER_SANITIZE_NUMBER_INT, 'from_date' => FILTER_SANITIZE_STRING, 'to_date' => FILTER_SANITIZE_STRING, 'street_line1' => FILTER_SANITIZE_STRING, 'street_line2' => FILTER_SANITIZE_STRING, 'street_line3' => FILTER_SANITIZE_STRING, 'city' => FILTER_SANITIZE_STRING, 'stat_code' => FILTER_SANITIZE_STRING, 'zip' => FILTER_SANITIZE_STRING, 'cnty_code' => FILTER_SANITIZE_STRING, 'natn_code' => FILTER_SANITIZE_STRING, 'status_ind' => FILTER_SANITIZE_STRING, 'user' => FILTER_SANITIZE_STRING, 'asrc_code' => FILTER_SANITIZE_STRING, 'delivery_point' => FILTER_SANITIZE_NUMBER_INT, 'correction_digit' => FILTER_SANITIZE_NUMBER_INT, 'carrier_route' => FILTER_SANITIZE_STRING, 'gst_tax_id' => FILTER_SANITIZE_STRING, 'reviewed_ind' => FILTER_SANITIZE_STRING, 'reviewed_user' => FILTER_SANITIZE_STRING, 'data_origin' => FILTER_SANITIZE_STRING, 'ctry_code_phone' => FILTER_SANITIZE_STRING, 'house_number' => FILTER_SANITIZE_STRING, 'street_line4' => FILTER_SANITIZE_STRING);
     $data = array();
     // build the data array for inserts/updates
     foreach ($fields as $field => $filter) {
         if ($field == 'to_date' || $field == 'from_date') {
             $function = $field . '_timestamp';
             $data[$field] = $this->{$function}() ? \PSU::db('banner')->BindDate($this->{$function}()) : null;
         } else {
             $data[$field] = filter_var($this->{$field}, $filter) ?: null;
         }
         //end else
     }
     //end foreach
     // attempt to use the session username as the user that updated the address
     //   failover to the user defined in the object
     //   failover to hostname
     //   failover to script
     $data['user'] = strtoupper(\PSU::nvl($_SESSION['username'], $data['user'], $_SERVER['REMOTE_HOST'], 'script'));
     return $data;
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:26,代码来源:Address.php

示例10: isset

<?php

/**
 * Tool for account locking in the post Luminis world.
 * NOTE - This tool will not handle user spoofing.
 */
$pidm = (int) $_GET['pidm'];
$redirect_id = $pidm;
$lock = (bool) $_GET['lock'];
$reason = isset($_GET['reason']) ? $_GET['reason'] : null;
try {
    if (!$GLOBALS['ape']->canResetPassword()) {
        throw new Exception('You are not allowed to modify account locks.');
    }
    $person = new PSUPerson($pidm);
    $redirect_id = PSU::nvl($person->id, $person->wp_id);
    if ($lock) {
        $GLOBALS['LOG']->write('Locking account', $person->login_name);
        $message = "Account for {$person->login_name} has been locked.";
        $reason .= ' (auto-opened via APE)';
        if ($call_id = APE::create_ticket($person->login_name, 'Account Locked', $reason, array('call_source' => 'APE Locked Account'))) {
            $message .= ' Ticket #<a href="http://go.plymouth.edu/log/' . $call_id . '">' . $call_id . '</a> opened.';
        }
        //end if
        $_SESSION['messages'][] = $message;
        $keys = array('added', 'sourced_id', 'password', 'pidm', 'login_name', 'fullname', 'reason', 'locker_pidm');
        $values = array('NOW()', '?', '?', '?', '?', '?', '?', '?');
        $args = array($person->sourced_id, ' ', $pidm, $person->login_name, $person->formatName('f l'), $reason, $_SESSION['pidm']);
        $sql = "\n\t\t  INSERT INTO ape_support_locks (" . implode(', ', $keys) . ")\n\t\t  VALUES (" . implode(', ', $values) . ")\n\t\t";
        if (!PSU::db('myplymouth')->Execute($sql, $args)) {
            throw new Exception(PSU::db('myplymouth')->errorMsg());
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:31,代码来源:account-lock.php

示例11: total_undisbursed

 public function total_undisbursed()
 {
     $total = 0;
     foreach ($this->records() as $record) {
         $total += \PSU::nvl($record->funds_not_disbursed, 0);
     }
     //end foreach
     return $total;
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:9,代码来源:Feed.php

示例12: url

 public function url($user)
 {
     $person = PSUPerson::get($user);
     if (!$person->pidm) {
         throw new ECommerceException(ECommerceException::INVALID_PIDM);
     }
     $processor = 'UG Tuition/Housing Deposit';
     $server = $_SERVER['URANUS'] ? 'test' : 'prod';
     $term_code_entry = PSU::db('banner')->GetOne("SELECT term_code_entry FROM v_ug_app WHERE pidm = :pidm", array('pidm' => $person->pidm));
     if ($person->isActiveStudent() || $term_code_entry) {
         $this->setURLParam('userChoice2', PSU::nvl($person->student->ug->term_code_admit, $term_code_entry, \PSU\Student::getCurrentTerm('UG')));
         $this->setURLParam('orderType', $processor);
         $this->setURLParam('orderNumber', $person->id);
         $this->setURLParam('orderName', $person->formatName('l, f m'));
         $this->setURLParam('orderDescription', $processor);
         return $this->_url($server);
     } else {
         throw new ECommerceException(ECommerceException::INVALID_STUDENT);
     }
     //end else
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:21,代码来源:ETransUGDeposit.class.php

示例13: sanitize

 /**
  * sanitize the object properties so we don't get h4xx0r3d
  */
 public function sanitize()
 {
     // fields are ordered the same as in gb_email package
     $fields = array('pidm' => FILTER_SANITIZE_NUMBER_INT, 'emal_code' => FILTER_SANITIZE_STRING, 'email_address' => FILTER_SANITIZE_STRING, 'status_ind' => FILTER_SANITIZE_STRING, 'preferred_ind' => FILTER_SANITIZE_STRING, 'user_id' => FILTER_SANITIZE_STRING, 'comment' => FILTER_SANITIZE_STRING, 'disp_web_ind' => FILTER_SANITIZE_STRING, 'data_origin' => FILTER_SANITIZE_STRING);
     $data = array();
     // build the data array for inserts/updates
     foreach ($fields as $field => $filter) {
         $data[$field] = filter_var($this->{$field}, $filter) ?: null;
     }
     //end foreach
     // attempt to use the session username as the user that updated the email
     //   failover to the user defined in the object
     //   failover to hostname
     //   failover to script
     $data['user_id'] = strtoupper(\PSU::nvl($_SESSION['username'], $data['user_id'], $_SERVER['REMOTE_HOST'], 'script'));
     return $data;
 }
开发者ID:AholibamaSI,项目名称:plymouth-webapp,代码行数:20,代码来源:Email.php


注:本文中的PSU::nvl方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。