Example #1
0
    exit;
}
if ($_POST['action'] == 'get_referrer_remarks') {
    $referral_buffer = new ReferralBuffer($_POST['id']);
    $record = $referral_buffer->get();
    $remark = trim(htmlspecialchars_decode(stripslashes($record[0]['referrer_remarks'])));
    $remark = str_replace('<br/>', "\n", $remark);
    echo strip_tags($remark);
    exit;
}
if ($_POST['action'] == 'save_referrer_remarks') {
    $data = array();
    $data['referrer_remarks'] = $_POST['remarks'];
    $data['referrer_remarks'] .= "\n\n--- " . date('Y-m-d H:i') . " ---\n\n";
    $referral_buffer = new ReferralBuffer($_POST['id']);
    if ($referral_buffer->update($data) === false) {
        echo 'ko';
        exit;
    }
    echo 'ok';
    exit;
}
if ($_POST['action'] == 'get_remind_on') {
    $result = array();
    if ($_POST['is_buffer'] == '1') {
        $criteria = array('columns' => "referral_buffers.remind_on, \n                          DATEDIFF(remind_on, NOW()) AS days_left", 'match' => "id = " . $_POST['id'], 'limit' => "1");
        $buffer = new ReferralBuffer();
        $result = $buffer->find($criteria);
    } else {
        $criteria = array('columns' => "member_jobs.remind_on, \n                          DATEDIFF(member_jobs.remind_on, NOW()) AS days_left", 'joins' => "member_jobs ON members.email_addr = member_jobs.member", 'match' => "member_jobs.id = " . $_POST['id'], 'limit' => "1");
        $member = new Member();
Example #2
0
<?php

require_once dirname(__FILE__) . '/private/lib/utilities.php';
if (!isset($_GET['id'])) {
    redirect_to('welcome.php');
}
$referral_buffer = new ReferralBuffer($_GET['id']);
// check whether the buffer has been updated before
// does the buffer exists?
$result = $referral_buffer->get();
if ($result === false || is_null($result) || empty($result)) {
    // no
    redirect_to($GLOBALS['protocol'] . '://' . $GLOBALS['root'] . '/index.php');
    exit;
}
// already responded?
if (!is_null($result[0]['candidate_response']) && !is_null($result[0]['candidate_responded_on'])) {
    // yes
    redirect_to($GLOBALS['protocol'] . '://' . $GLOBALS['root'] . '/index.php');
    exit;
}
// proceed
$data['candidate_response'] = 'no';
$data['candidate_responded_on'] = now();
$referral_buffer->update($data);
redirect_to($GLOBALS['protocol'] . '://' . $GLOBALS['root'] . '/index.php');
exit;
Example #3
0
$buffer_id = $_POST['buffer_id'];
if (empty($buffer_id)) {
    $data['requested_on'] = $today;
    $data['referrer_email'] = $branch_email;
    $data['referrer_phone'] = 'NULL';
    $data['referrer_name'] = 'NULL';
    $buffer_id = $referral_buffer->create($data);
    if ($buffer_id === false) {
        redirect_to($GLOBALS['protocol'] . '://' . $GLOBALS['root'] . '/job/' . $job->getId() . '?error=1');
        exit;
    }
} else {
    $referral_buffer = new ReferralBuffer($buffer_id);
    $data['candidate_response'] = 'yes';
    $data['candidate_responded_on'] = $today;
    if ($referral_buffer->update($data) === false) {
        redirect_to($GLOBALS['protocol'] . '://' . $GLOBALS['root'] . '/job/' . $job->getId() . '?error=1');
        exit;
    }
}
// 2. check any files to upload
$has_resume = 'NO';
$file_path = '';
$resume_text = '';
$file_type = '';
$filename = '';
if (!empty($_FILES['apply_resume']['name'])) {
    $type = $_FILES['apply_resume']['type'];
    $size = $_FILES['apply_resume']['size'];
    $name = $_FILES['apply_resume']['name'];
    $filename = basename($name);