public function save($urlArgsArray) { $this->initializeTask(); $this->record = $_POST; if ($this->record['session_id'] != session_id()) { return 'Fake request'; } if (isset($this->record['session_id'])) { unset($this->record['session_id']); /* no need to save this */ } $rStr = ''; $this->debugPrintArray($this->record); $this->record = $this->processFieldsForPrecentationAndStorage('before_save', $this->fields, $this->record, 1); $this->debugPrintArray($this->record); if (count($this->errorMessage) > 0) { return $this->showError(); } $savePersonRecord = true; if ($this->collectionName == 'person' && isset($this->record['check_duplicate']) && $this->record['check_duplicate'] == 'True') { /* if person already exists then report it */ $foundPerson = false; $rStr .= '<tr>'; $rStr .= '<th>' . 'For first name ' . '</th>'; $rStr .= '<th>' . 'Current Profile Owner' . '</th>'; $rStr .= '<th>' . 'Request to transfer to you' . '</th>'; $rStr .= '<th colspan=10>' . 'Names in profile' . '</th>'; $rStr .= '</tr>'; $personInstance = new owebp_public_Person(); foreach ($this->record['name'] as $name) { $this->findCursor = $_SESSION['mongo_database']->{$this->collectionName}->find(array('name.first' => $name['first'])); foreach ($this->findCursor as $rec) { /* read login credential */ $rStr .= '<tr>'; $rStr .= '<td>' . $name['first'] . '</td>'; $rStr .= '<td>'; $personInstance->record = $this->getDocumentById('person', (string) $rec['created_by']); foreach ($personInstance->record['name'] as $createdByName) { $rStr .= $personInstance->getFullName('Official', true); break; } $rStr .= '</td>'; $rStr .= '<td>'; $email = $personInstance->getEmailAddress(); $rStr .= '<a target="_blank" href="mailto:' . $email . '?Subject=Please%20transfer%20person%20profile%20' . (string) $rec['_id'] . '%20to%20me">' . 'Email To Transfer' . '</a>'; $rStr .= '</td>'; foreach ($rec['name'] as $foundName) { $foundPerson = true; $rStr .= '<td>' . $foundName['first'] . ' ' . $foundName['middle'] . ' ' . $foundName['last'] . '</td>'; } $rStr .= '</tr>'; } } if ($foundPerson) { $rStr = 'Following persons already exists: <table class="showTable">' . $rStr . '</table>To create this profile try again with setting "Check Duplicate" to False. <br />'; $savePersonRecord = false; } else { $rStr = ''; } } $this->debugPrintArray($this->record); if ($_SESSION['mongo_database'] != NULL && $savePersonRecord) { $_SESSION['mongo_database']->{$this->collectionName}->save($this->record); $rStr .= ' Saved successfully '; } else { array_push($this->errorMessage, $rStr . ' Not saved successfully'); } if (count($this->errorMessage) > 0) { return $this->showError(); } $rStr .= $this->showLinks(); return $rStr; }
} ?> <a title="Join and manage you business" href="/user/join">Join</a> <?php $_SESSION['login_person_id'] = ''; if (isset($_SESSION['person']) && isset($_SESSION['person']['_id'])) { $_SESSION['login_person_id'] = (string) $_SESSION['person']['_id']; } if ($_SESSION['allowed_as'] != 'PUBLIC' && $_SESSION['allowed_as'] != 'NULL') { $personName = ''; if ($_SESSION['login_person_id'] == '') { /* person account is not set */ } else { $personClass = new owebp_public_Person(); $personClass->record = $_SESSION['person']; $personName = $personClass->getFullName('Official'); } echo '<a href="/user/update?id=' . (string) $_SESSION['user']['_id'] . '">Welcome</a>'; if ($personName != '') { echo ' <a href="/person/update?id=' . $_SESSION['login_person_id'] . '">' . $personClass->getFullName('Official') . '</a>'; } } ?> <a href="/contact/present_all">Contact Us</a> </div></div><br /> <?php echo $jpmContent;