$resume = new Resume($_POST['member'], $_POST['id']); $to = ""; if (isset($_POST['to'])) { $to = $_POST['to']; } $data = array(); $data['id'] = $_POST['experience']; $data['industry'] = $_POST['industry']; $data['from'] = $_POST['from']; $data['to'] = $to; $data['role'] = $_POST['role']; $data['place'] = $_POST['place']; $data['work_summary'] = sanitize($_POST['work_summary']); $data['reason_for_leaving'] = $_POST['reason_for_leaving']; if ($_POST['experience'] == "0") { if (!$resume->create_work_experience($data)) { echo 'ko1'; exit; } } else { if (!$resume->update_work_experience($data)) { echo 'ko2'; exit; } } echo 'ok'; exit; } if ($_POST['action'] == 'get_educations') { $resume = new Resume($_POST['member'], $_POST['id']); $educations = $resume->get_educations();