<?php /** * Created by PhpStorm. * User: kodoyosa * Date: 05/11/15 * Time: 10:29 */ include '../../../model/user/dashboard/m_recruiter_valid_post.php'; session_start(); //add_job($date, $location,$title, $description, $recruiter); $recruiterids = get_recruiter_id($_SESSION['id']); foreach ($recruiterids as $recruiterid) { $id = $recruiterid['recruiter_id']; } if (!empty($_POST['title']) && !empty($_POST['location']) && !empty($_POST['date']) && !empty($_POST['description'])) { add_job($_POST['date'], $_POST['location'], $_POST['title'], $_POST['description'], $id); echo 'L\'annonce a été ajouté avec succès !<br>'; echo 'cliquez <a href="../../../controler/user/dashboard/c_profil.php">ici</a> pour revenir à votre profil'; } else { echo 'Veuillez remplir tout les champs du formulaire.'; }
// Get job data // TO DO $job_category = $_POST['catID']; $job_title = $_POST['jobTitle']; $job_type = $_POST['jobType']; $job_city = $_POST['city']; $job_state = $_POST['state']; $job_summary = $_POST['summary']; $job_description = $_POST['description']; // if (isset($_POST['jobID'])) { $job_id = $_POST['jobID']; $query = update_job($job_category, $job_title, $job_type, $job_city, $job_state, $job_summary, $job_description, $job_id); $message = "Item has been updated."; } else { add_job($job_category, $job_title, $job_type, $job_city, $job_state, $job_summary, $job_description); $job_id = $db->lastInsertId(); $message = "The new item has been added."; } include './view_job.php'; } else { if ($action == 'list_applicants') { $applicants = get_applicants(); include './list_applicants.php'; } else { if ($action == 'view_resume') { $resume_id = $_GET['resume_id']; $resume = get_resume_by_id($resume_id); // Get resume data // TO DO $user_fname = $resume['fname'];
<?php /* Part of the codes are modified from https://github.com/jonsuh/jQuery-Ajax-Call-to-PHP-Script-with-JSON-Return */ /* 安全性,檢查是否為 AJAX、是否為 POST 方法,並檢查 $action 是否正確*/ if (is_ajax()) { if (isset($_POST["action"]) && !empty($_POST["action"])) { //Checks if action value exists $action = $_POST["action"]; switch ($action) { //Switch case for value of action case "action_add": add_job(); break; case "action_delete": delete_job(); break; } } } //Function to check if the request is an AJAX request function is_ajax() { return isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'; } /* Return the HTML content of the URL, return false if 404. e.g. https://www.ptt.cc/bbs/not_exist_board/not_exist_page.html is not valid */ function get_url_content($url) { $handle = curl_init($url);
function list_jobs_action($uid) { // needed to set the tab active $extras_active = true; $jobs_active = true; if (user_is_admin($uid)) { if (isset($_POST['price'])) { $job_added = get_job_by_id($_POST['id']); // job exists if ($job_added) { update_job($_POST['id'], $_POST['delivery'], $_POST['price']); } else { add_job($_POST['uid'], $_POST['timestamp'], $_POST['file'], $_POST['duration'], $_POST['filament'], $_POST['delivery'], $_POST['price']); } } // get all the uids $uids = get_all_uids(); // get all the printig jobs $jobs = get_all_jobs(); require 'templates/jobs.php'; } else { require 'templates/login.php'; } }
if (!update_field('tests', 'test', 'url')) { notice('Invalid parameters'); } } else { if ($action == 'add') { if (array_key_exists('test_id', $_POST) && array_key_exists('metric_name', $_POST)) { $id = intval($_POST['test_id']); $aggregator = intval($_POST['metric_aggregator']); if (!$aggregator) { notice('Invalid aggregator. You must specify one.'); } else { $metric_id = $db->insert_row('test_metrics', 'metric', array('test' => $id, 'name' => $_POST['metric_name'], 'aggregator' => $aggregator)); if (!$metric_id) { notice("Could not insert the new metric for test {$id}"); } else { add_job('aggregate', '{"metricIds": [ ' . $metric_id . ']}'); notice("Inserted the metric for test {$id}"); } } } else { if (array_key_exists('metric_id', $_POST)) { regenerate_manifest(); } else { notice('Invalid parameters'); } } } } } if ($db) { $aggregators = array();
<?php $data = json_decode($_POST['wrapper'], true); include_once '../functions/database.php'; print_r(add_job($data)); print_r($data);