/** * Returns an array of patron information * * @param string $pid Patron barcode number or record number * @return boolean|array Array of patron information or FALSE if login fails */ public function patron_info($pid) { $papi = new iii_patronapi(); $iii_server_info = self::iii_server_info(); $papi->iiiserver = $iii_server_info['server']; $papi_data = $papi->get_patronapi_data($pid); if (!$papi_data) { return FALSE; } $pdata['pnum'] = $papi_data['RECORDNUM']; $pdata['cardnum'] = $papi_data['PBARCODE']; $pdata['checkouts'] = $papi_data['CURCHKOUT']; $pdata['homelib'] = $papi_data['HOMELIBR']; $pdata['balance'] = preg_replace('/[^0-9.]/', '', $papi_data['MONEYOWED']); $pdata['expires'] = $papi_data['EXPDATE'] ? self::date_to_timestamp($papi_data['EXPDATE'], 2000) : NULL; $pdata['name'] = $papi_data['PATRNNAME']; $pdata['address'] = preg_replace('%\\$%s', "\n", $papi_data['ADDRESS']); $pdata['tel1'] = $papi_data['TELEPHONE']; if ($papi_data['TELEPHONE2']) { $pdata['tel2'] = $papi_data['TELEPHONE2']; } $pdata['email'] = $papi_data['EMAILADDR']; return $pdata; }
/** * Returns an array of patron information * * @param string $pid Patron barcode number or record number * @return boolean|array Array of patron information or FALSE if login fails */ public function patron_info($pid) { $papi = new iii_patronapi(); $papi->iiiserver = $this->locum_config[ils_config][ils_server]; $papi_data = $papi->get_patronapi_data($pid); if (!$papi_data) { return FALSE; } $pdata[pnum] = $papi_data[RECORDNUM]; $pdata[cardnum] = $papi_data[PBARCODE]; $pdata[checkouts] = $papi_data[CURCHKOUT]; $pdata[homelib] = $papi_data[HOMELIBR]; $pdata[balance] = (double) preg_replace('%\\$%s', '', $papi_data[MONEYOWED]); $pdata[expires] = $papi_data[EXPDATE] ? self::date_to_timestamp($papi_data[EXPDATE], 2000) : NULL; $pdata[name] = $papi_data[PATRNNAME]; $pdata[address] = preg_replace('%\\$%s', "\n", $papi_data[ADDRESS]); $pdata[tel1] = $papi_data[TELEPHONE]; if ($papi_data[TELEPHONE2]) { $pdata[tel2] = $papi_data[TELEPHONE2]; } $pdata[email] = $papi_data[EMAILADDR]; return $pdata; }