$position = $_REQUEST['attrPos']; if (!empty($position) && !is_numeric($position)) { break; } $status = isset($_REQUEST['status']) ? 'Lift' : 'Block'; $tag = $status . ' ' . ($position ? '#' . $position : 'Main'); $sectionName = $position ? 'Credit Block - Additional Persons' : 'Credit Block - Main'; $startDateFieldName = $position ? 'Lift #' . $position . ' Start Date' : 'Lift Start Date'; $endDateFieldName = $position ? 'Lift #' . $position . ' End Date' : 'Lift End Date'; $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)) {