Ejemplo n.º 1
0
 public static function getInstance()
 {
     if (self::$theInstance == null) {
         self::$theInstance = new CandidateService();
     }
     return self::$theInstance;
 }
Ejemplo n.º 2
0
 public function buildSearchCountQueryForTest($parameterObject)
 {
     return parent::buildSearchCountQuery($parameterObject);
 }
Ejemplo n.º 3
0
<?php

/*
Copyright: All contributers to the Umple Project
This file is made available subject to the open source license found at:
http://umple.org/license
*/
if (isset($_POST['action'])) {
    switch ($_POST['action']) {
        case 'registerCandidate':
            require_once "CandidateService.php";
            CandidateService::getInstance()->setCandidateJSON($_POST['candidateJSON']);
            $result = CandidateService::getInstance()->getLatestResult();
            echo $result;
            break;
    }
} else {
    echo <<<_OUT
\t\t<!DOCTYPE html>
        <html>
                <head>
\t\t\t\t\t<script type="text/javascript" src="registercandidate.js"></script>
\t\t\t\t\t<link rel="stylesheet" href="usecase.css" />
                </head>
                <body>
                    <div class="mainForm">
\t\t\t\t\t\t<label for="candidateName">Candidate Name:</label>
\t\t\t\t\t\t\t\t<input type="text" id="candidateName"></input>
\t\t\t\t\t\t<label for="candidateAddress">Candidate Address:</label>
\t\t\t\t\t\t\t\t<input type="text" id="candidateAddress"></input>
\t\t\t\t\t\t<label for="candidateTelephone">Candidate Telephone:</label>
 public function getAllowedCandidateHistoryList($role, $empNumber, $candidateId)
 {
     $candidateService = new CandidateService();
     return $candidateService->getCanidateHistoryForUserRole($role, $empNumber, $candidateId);
 }
Ejemplo n.º 5
0
    private $addrModel;
    public function __construct()
    {
        parent::__construct();
        $this->candidateModel = new \Model\Candidate();
        $this->addrModel = new \Model\CandidateAddress();
    }
    public function register()
    {
        $this->contentType = "application/json";
        $exists = $this->candidateModel->exists($this->params['phone']);
        if (!$exists) {
            $result = $this->candidateModel->add(array('fullname' => $this->params['fullname'], 'phone' => $this->params['phone'], 'email' => $this->params['email'], 'passwd' => $this->params['passwd'], 'dob' => $this->params['dob'], 'gender' => $this->params['gender'], 'required_job' => $this->params['required_job'], 'last_update_date' => time(), 'update_by' => $_SERVER['HTTP_HOST']));
        } else {
            $result = array('error' => "{$this->params['phone']} already exists");
        }
        return $result;
    }
    public function addAddress()
    {
        $this->contentType = "application/json";
        $result = $this->addrModel->add(array('candidate_id' => $this->params['candidate_id'], 'is_present' => (bool) $this->params['is_present'], 'address' => $this->params['address'], 'city' => $this->params['city'], 'state' => $this->params['state'], 'zip' => $this->params['zip'], 'last_update_date' => time(), 'update_by' => $_SERVER['HTTP_HOST']));
        if ($this->params['is_present'] == 1 && !empty($result['result'])) {
            // Update all other is_present columns to false
            $this->addrModel->update(array('is_present' => false), array('is_present' => array('op' => '=', 'val' => true), 'candidate_id' => array('op' => '=', 'val' => $this->params['candidate_id']), 'address_id' => array('op' => '<>', 'val' => $result['result'])));
        }
        return $result;
    }
}
$obj = new CandidateService();
$obj->doo();