private static function GetCredentials() { if (empty(self::$appid) || empty(self::$key)) { $data = json_decode(file_get_contents(dirname(__FILE__) . '/data/config.json'), true); self::$appid = $data['op']['appid']; self::$key = $data['op']['key']; } return true; }
$startDateFieldValue = date('U', strtotime($_REQUEST['dateStart'])); $endDateFieldValue = date('U', strtotime($_REQUEST['dateEnd'])); $key = $user_email . $type . $id . $position; $date = date('c'); $ret = RFPluginOPConnector::AddTag(<<<STRING \t<contact id='{$id}'> \t\t<tag>{$tag}</tag> \t</contact> STRING ); $p = new SimpleXMLElement($ret); $ret = RFPluginOPConnector::UpdateContactField(<<<STRING \t<contact id='{$id}'> \t\t<Group_Tag name="{$sectionName}"> \t\t\t<field name="{$startDateFieldName}">{$startDateFieldValue}</field> \t\t\t<field name="{$endDateFieldName}">{$endDateFieldValue}</field> \t\t</Group_Tag> \t</contact> STRING ); $p = new SimpleXMLElement($ret); $existing = CBDashboard::get_data($key); if (!is_array($existing)) { $existing = array(); } $existing['updates'][] = array('date' => $date, 'status' => $status, 'type' => $type, 'start' => $startDateFieldValue, 'end' => $endDateFieldValue, 'aid' => $id, 'actor' => $user_email, 'position' => $position); $existing['totals'][$tag][] = $date; $ret = CBDashboard::save_data($key, $existing); break; case 'hdti': RFPluginHDTIConnector::Request($_REQUEST);
$name = trim((string) $p->xpath('//contact/Group_Tag[@name=\'Contact Information\']/field[@name=\'First Name\']')[0] . ' ' . (string) $p->xpath('//contact/Group_Tag[@name=\'Contact Information\']/field[@name=\'Last Name\']')[0]); if (empty($name)) { $error = "Current logged in user does not appear to have any CreditBlock account data in Ontraport!"; } else { $id = (string) $p->xpath('//contact')[0]->attributes()->id; $primary = array('id' => $id, 'name' => $name, 'type' => 'manager', 'tag' => 'Main', 'address' => (string) $p->xpath('//contact/Group_Tag[@name=\'Contact Information\']/field[@name=\'Address\']')[0], 'equifaxPin' => (string) $p->xpath('//contact/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Equifax PIN\']')[0], 'equifaxStatus' => (string) $p->xpath('//contact/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Equifax Status\']')[0], 'experianPin' => (string) $p->xpath('//contact/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Experian PIN\']')[0], 'experianStatus' => (string) $p->xpath('//contact/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Experian Status\']')[0], 'transunionPin' => (string) $p->xpath('//contact/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'TransUnion PIN\']')[0], 'transunionStatus' => (string) $p->xpath('//contact/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'TransUnion Status\']')[0]); $persons = array(); if (empty($manager)) { /** * If the manager field has NOT been populated, then this account might be a manager */ $dd = RFPluginOPConnector::FindData(<<<STRING <search> \t<equation> \t\t<field>Credit Block Acct Manager</field> \t\t<op>c</op> \t\t<value>{$name}</value> \t</equation> </search> STRING ); $pn = new SimpleXMLElement($dd); $a = 0; while (++$a) { $name = trim((string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Contact Information\']/field[@name=\'First Name\']')[0] . ' ' . (string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Contact Information\']/field[@name=\'Last Name\']')[0]); if (empty($name)) { break; } $id = (string) $pn->xpath('//contact[position()=' . $a . ']')[0]->attributes()->id; $persons[] = array('id' => $id, 'name' => $name, 'type' => 'managed', 'tag' => 'Main', 'address' => (string) $pn->xpath('//contact/Group_Tag[@name=\'Contact Information\']/field[@name=\'Address\']')[0], 'equifaxPin' => (string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Equifax PIN\']')[0], 'equifaxStatus' => (string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Equifax Status\']')[0], 'experianPin' => (string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Experian PIN\']')[0], 'experianStatus' => (string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'Experian Status\']')[0], 'transunionPin' => (string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'TransUnion PIN\']')[0], 'transunionStatus' => (string) $pn->xpath('//contact[position()=' . $a . ']/Group_Tag[@name=\'Credit Block - Main\']/field[@name=\'TransUnion Status\']')[0]); } }