print_array(ReferralRequests::get_all()); ?> </p><p style="font-weight: bold;">Referrer confirms for referral 1... </p><p><?php $data = array(); $data['id'] = 1; $data['referrer_acknowledged_on'] = now(); if (ReferralRequests::update($data)) { ReferralRequests::close_similar_requests_with_id(1); print_array(ReferralRequests::get($data['id'])); } else { echo "failed"; exit; } ?> </p><p style="font-weight: bold;">Referrer confirms for referral 4... </p><p><?php $data = array(); $data['id'] = 4; $data['referrer_acknowledged_on'] = now(); if (ReferralRequests::update($data)) { ReferralRequests::close_similar_requests_with_id(4); print_array(ReferralRequests::get($data['id'])); } else { echo "failed"; exit; } ?> </p><p style="font-weight: bold;">Show all requests... </p><p><?php print_array(ReferralRequests::get_all()); ?> </p>
$headers = 'From: YellowElevator.com <*****@*****.**>' . "\n"; mail($referrer, $subject, $message, $headers); /*$handle = fopen('/tmp/email_to_'. $referrer. '.txt', 'w'); fwrite($handle, 'Subject: '. $subject. "\n\n"); fwrite($handle, $message); fclose($handle);*/ } continue; } } // For existing members, add the request. if (!$cannot_add_referee) { $query = "SELECT CONCAT(lastname, ', ', firstname) AS fullname \n FROM members \n WHERE email_addr = '" . $referrer . "' LIMIT 1"; $result = $mysqli->query($query); $referrer_name = $result[0]['fullname']; if (ReferralRequests::create($data)) { if ($_POST['from'] == 'others') { $lines = file(dirname(__FILE__) . '/private/mail/candidate_referral_request.txt'); $raw_message = ''; foreach ($lines as $line) { $raw_message .= $line; } $raw_message = str_replace('%member_name%', htmlspecialchars_decode(desanitize($member->get_name())), $raw_message); $raw_message = str_replace('%member_email_addr%', $member->id(), $raw_message); $raw_message = str_replace('%protocol%', $GLOBALS['protocol'], $raw_message); $raw_message = str_replace('%root%', $GLOBALS['root'], $raw_message); $raw_message = str_replace('%job%', htmlspecialchars_decode($job_title), $raw_message); $raw_message = str_replace('%employer%', htmlspecialchars_decode(desanitize($employer_name)), $raw_message); $subject = htmlspecialchars_decode(desanitize($member->get_name())) . " needs to be referred to a job!"; $headers = 'From: YellowElevator.com <*****@*****.**>' . "\n"; foreach ($referrers as $referrer) {
foreach ($result as $i => $row) { $result[$i]['description'] = htmlspecialchars_decode(html_entity_decode($row['description'])); $result[$i]['title'] = htmlspecialchars_decode($row['title']); $result[$i]['referrer'] = htmlspecialchars_decode($row['referrer']); } $response = array('requests' => array('request' => $result)); header('Content-type: text/xml'); echo $xml_dom->get_xml_from_array($response); exit; } if ($_POST['action'] == 'close_request') { $data = array(); $data['id'] = $_POST['id']; $data['referrer_acknowledged_on'] = now(); ReferralRequests::update($data); ReferralRequests::close_similar_requests_with($data['id']); exit; } if ($_POST['action'] == 'reject_request') { $query = ''; if ($_POST['is_request'] == '1') { $query = "UPDATE referral_requests SET rejected = 'Y' WHERE id = " . sanitize($_POST['id']); } else { $query = "UPDATE referrals SET \n member_rejected_on = NOW(), member_confirmed_on = NULL \n WHERE id = " . sanitize($_POST['id']); } $mysqli = Database::connect(); $mysqli->execute($query); } if ($_POST['action'] == 'read_resume') { $query = ''; if ($_POST['is_request'] == '1') {