function lenderInvite() { global $database, $session; if ($session->userlevel != LENDER_LEVEL) { header("Location: " . SITE_URL); exit; } $emails = explode(',', array_get($_POST, 'emails')); $emails = sanitize_custom($emails); $emails = $session->validateLenderInviteEmails($session->userid, $emails); $lender = $database->getLenderDetails($session->userid); $custom_message = array_get($_POST, 'has_custom_message') ? array_get($_POST, 'custom_message') : null; foreach ($emails as $email) { $session->lenderInviteViaEmail($lender, $email, $custom_message); } header("Location: /invite#invitees"); }
function sharebox_off() { global $session; $_POST = sanitize_custom($_POST); $loanprurl = getLoanprofileUrl($_POST['borrowerid'], $_POST['loanid']); $result = $session->sharebox_off($_POST['lenderid'], $_POST['sharebox_off']); if ($result) { echo $loanprurl; } else { echo $loanprurl; } }
function feedbackLoanProfile() { global $session, $form; $_POST = sanitize_custom($_POST); $emailed = $session->emailedTo($_POST['borrowerid'], $_POST['emailaddress'], $_POST['ccaddress'], $_POST['replyTo'], $_POST['emailsubject'], $_POST['emailmessage'], $_POST['sendername'], $_POST['loanid']); $errurl = sprintf("index.php?p=24&id=%s&l_id=%s&ref=1", $_POST['borrowerid'], $_POST['loanid']); if (!$emailed) { $_SESSION['value_array'] = $_POST; $_SESSION['error_array'] = $form->getErrorArray(); if (!empty($_SESSION['error_array'])) { $keys = array_keys($_SESSION['error_array']); $errurl = $errurl . "#" . $keys[0]; } } else { $_SESSION['send_feedback_on_loan_profile'] = true; } header("Location: {$errurl}"); exit; }
function makeConfirmAuth() { global $session, $database; $_POST = sanitize_custom($_POST); $date_auth = strtotime($_POST['auth_date']); if (empty($date_auth)) { $date_auth = time(); } $result = $database->updateAuthStatus($date_auth, $_POST['borrowerid'], $_POST['loanid'], $_POST['pamount']); $url = $_SERVER['HTTP_REFERER']; if ($result == 1) { $database->commitTxn(); header("Location: {$url}"); exit; } else { $database->rollbackTxn(); header("Location: {$url}&err=1001"); exit; } }