Ejemplo n.º 1
0
 public function insert_inline_scripts($_show_popup = '', $_buffer_id = '')
 {
     $script = 'var job_id = "' . $this->job_id . '";' . "\n";
     if (count($this->job) <= 0 || is_null($this->job) || $this->job === false) {
         $script .= 'var show_popup = "";' . "\n";
         // } else if ($this->job['expired'] >= 0 || $this->job['closed'] == 'Y') {
         //     $script .= 'var show_popup = "";'. "\n";
     } else {
         $script .= 'var show_popup = "' . $_show_popup . '";' . "\n";
         $script .= 'var buffer_id = "' . $_buffer_id . '";' . "\n";
         if (!empty($_buffer_id)) {
             // try to pre-fill the information
             $criteria = array('columns' => "candidate_email, candidate_name, candidate_phone, \n                                  current_position, current_employer", 'match' => "id = " . $_buffer_id, 'limit' => "1");
             $ref_buf = new ReferralBuffer();
             $result = $ref_buf->find($criteria);
             if ($result !== false && !is_null($result) && !empty($result)) {
                 $script .= 'var candidate_name ="' . $result[0]['candidate_name'] . '"' . "\n";
                 $script .= 'var candidate_email ="' . $result[0]['candidate_email'] . '"' . "\n";
                 $script .= 'var candidate_phone ="' . $result[0]['candidate_phone'] . '"' . "\n";
                 $script .= 'var current_position ="' . $result[0]['current_position'] . '"' . "\n";
                 $script .= 'var current_employer ="' . $result[0]['current_employer'] . '"' . "\n";
             }
         }
     }
     if (!is_null($this->member)) {
         $script .= 'var id = "' . $this->member->getId() . '";' . "\n";
         $script .= 'var country_code = "' . $this->member->getCountry() . '";' . "\n";
     } else {
         $script .= 'var id = 0;' . "\n";
         $script .= 'var country_code = "' . $_SESSION['yel']['country_code'] . '";' . "\n";
     }
     if (count($this->criterias) > 0 && !is_null($this->criterias)) {
         $script .= 'var industry = "' . $this->criterias['industry'] . '";' . "\n";
         $script .= 'var keywords = "' . $this->criterias['keywords'] . '";' . "\n";
     } else {
         $script .= 'var industry = "";' . "\n";
         $script .= 'var keywords = "";' . "\n";
     }
     if ($this->action_responded && $this->action_has_error) {
         $script .= 'var alert_error = true;';
         $script .= 'var alert_success = false;';
     } else {
         $script .= 'var alert_error = false;';
         if ($this->action_responded) {
             $script .= 'var alert_success = true;';
         } else {
             $script .= 'var alert_success = false;';
         }
     }
     $this->header = str_replace('<!-- %inline_javascript% -->', $script, $this->header);
 }
Ejemplo n.º 2
0
                break;
            }
        }
        if (!$is_dev) {
            ?>
            <script type="text/javascript">alert('Please logout from your existing connection before proceeding.');</script>
            <?php 
            exit;
        }
    }
}
if (isset($_GET['hash'])) {
    // get from ReferralBuffer
    $criteria = array("columns" => "resume_file_name, resume_file_type, resume_file_size", "match" => "id = " . $_GET['id'], "limit" => "1");
    $buffer = new ReferralBuffer();
    $result = $buffer->find($criteria);
    if (is_null($result) || count($result) <= 0 || $result === false) {
        echo 'No record of resume.';
        exit;
    }
    if (!file_exists($GLOBALS['buffered_resume_dir'] . '/' . $_GET['id'] . '.' . $_GET['hash'])) {
        echo 'Resume file not found.';
        exit;
    }
    header('Content-type: ' . $result[0]['resume_file_type']);
    header('Content-Disposition: attachment; filename="' . $result[0]['resume_file_name'] . '"');
    header('Content-Transfer-Encoding: binary');
    header('Expires: 0');
    header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
    header('Pragma: public');
    header('Content-length: ' . $result[0]['resume_file_size']);