예제 #1
0
파일: job_action.php 프로젝트: pamalite/yel
    } else {
        if ($job->update($data) == false) {
            echo "ko";
            exit;
        }
    }
    echo "ok";
    exit;
}
if ($_POST['action'] == 'close') {
    if (!isset($_POST['payload'])) {
        echo "ko";
        exit;
    }
    $xml_dom->load_from_xml($_POST['payload']);
    $jobs = $xml_dom->get('id');
    $query = "UPDATE jobs SET closed = 'Y' WHERE id IN (";
    $i = 0;
    foreach ($jobs as $job) {
        $query .= $job->nodeValue;
        if ($i < $jobs->length - 1) {
            $query .= ", ";
        }
        $i++;
    }
    $query .= ")";
    $mysqli = Database::connect();
    if (!$mysqli->execute($query)) {
        echo "ko";
        exit;
    }
예제 #2
0
          fwrite($handle, 'Subject: '. $subject. "\n\n");
          fwrite($handle, $message);
          fclose($handle);*/
        echo "ok";
        exit;
    }
    echo "ko";
    exit;
}
if ($_POST['action'] == 'remove_candidates') {
    if (!isset($_POST['payload'])) {
        echo "ko";
        exit;
    }
    $xml_dom->load_from_xml($_POST['payload']);
    $candidates = $xml_dom->get('id');
    $query = "UPDATE referrals SET employer_removed_on = NOW() WHERE id IN (";
    if ($_POST['used_suggested'] == 'Y') {
        $query = "UPDATE referrals SET employer_removed_on = NOW(), used_suggested = 'Y' WHERE id IN (";
    }
    $i = 0;
    foreach ($candidates as $candidate) {
        $query .= $candidate->nodeValue;
        if ($i < $candidates->length - 1) {
            $query .= ", ";
        }
        $i++;
    }
    $query .= ")";
    $mysqli = Database::connect();
    if (!$mysqli->execute($query)) {
예제 #3
0
파일: xmldom.php 프로젝트: pamalite/yel
<?php

require_once "../../private/lib/utilities.php";
$xml_dom = new XMLDOM();
echo "Attributes test: <br><br>";
if ($xml_dom->load_from_uri(dirname(__FILE__) . "/text.xml")) {
    $properties = $xml_dom->get("property");
    $propertys = array();
    foreach ($properties as $property) {
        $key = "";
        foreach ($property->attributes as $attribute) {
            switch ($attribute->name) {
                case "key":
                    $key = $attribute->value;
                    break;
                default:
                    if (!empty($key)) {
                        $propertys[$key][$attribute->name] = $attribute->value;
                    }
                    break;
            }
        }
    }
    echo "<pre>";
    print_r($propertys);
    echo "</pre>";
} else {
    echo "failed";
}
echo "<br><br>";
echo "Elements test: <br><br>";
예제 #4
0
        if (!$member->create_bank($_POST['bank'], $_POST['account'])) {
            echo 'ko';
            exit;
        }
    } else {
        if (!$member->update_bank($_POST['id'], $_POST['bank'], $_POST['account'])) {
            echo 'ko';
            exit;
        }
    }
    echo 'ok';
    exit;
}
if ($_POST['action'] == 'delete_bank') {
    $xml_dom->load_from_xml($_POST['payload']);
    $banks = $xml_dom->get('id');
    $query = "UPDATE member_banks SET in_used = 'N' WHERE id IN (";
    $i = 0;
    foreach ($banks as $id) {
        $query .= $id->nodeValue;
        if ($i < $banks->length - 1) {
            $query .= ", ";
        }
        $i++;
    }
    $query .= ")";
    $mysqli = Database::connect();
    if (!$mysqli->execute($query)) {
        echo 'ko';
        exit;
    }
예제 #5
0
$xml_dom = new XMLDOM();
if (!isset($_POST['action'])) {
    $member = new Member($_POST['referee']);
    $response = array('resume' => $member->get());
    header('Content-type: text/xml');
    echo $xml_dom->get_xml_from_array($response);
    exit;
}
if ($_POST['action'] == 'delete') {
    if (!isset($_POST['payload'])) {
        echo "ko";
        exit;
    }
    $member = new Member($_POST['member'], $_SESSION['yel']['member']['sid']);
    $xml_dom->load_from_xml($_POST['payload']);
    $referees = $xml_dom->get('id');
    foreach ($referees as $id) {
        if (!$member->delete_referee($id->nodeValue)) {
            echo "ko";
            exit;
        }
    }
    echo "ok";
    exit;
}
if ($_POST['action'] == 'add_network') {
    $member = new Member($_POST['member'], $_SESSION['yel']['member']['sid']);
    $network_id = 0;
    if (!($network_id = $member->create_network($_POST['industry']))) {
        echo "ko";
        exit;
예제 #6
0
 $data['seeking'] = $seeking;
 $data['updated_on'] = date('Y-m-d');
 $data['imported_on'] = $data['updated_on'];
 if ($member->update($data) === false) {
     echo 'ko';
     exit;
 }
 // import job profiles
 $positions_xml = '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
 $positions_xml .= $_POST['positions'];
 if (!$xml_dom->load_from_xml($positions_xml)) {
     echo 'ko';
     exit;
 }
 $mysqli = Database::connect();
 $nodes = $xml_dom->get('position');
 foreach ($nodes as $node) {
     $data = array();
     foreach ($node->childNodes as $child) {
         switch ($child->nodeName) {
             case 'title':
                 $data['position_title'] = sql_nullify($child->nodeValue);
                 break;
             case 'employer':
                 $data['employer'] = sql_nullify($child->nodeValue);
                 break;
             case 'employer_industry':
                 // match to YE industry
                 $query = "SELECT industries.id \n                              FROM industries \n                              LEFT JOIN linkedin_industry_map ON industries.industry = linkedin_industry_map.ye_industry\n                              WHERE linkedin_industry_map.linkedin_industry = '" . $child->nodeValue . "' \n                              LIMIT 1";
                 $industry_results = $mysqli->query($query);
                 if (is_null($industry_results) || empty($industry_results)) {