$resume = new Resume($_POST['member'], $_POST['id']); $technical_skills = $resume->get_technical_skills(); $response = array('resume' => array('technicals' => $technical_skills)); header('Content-type: text/xml'); echo $xml_dom->get_xml_from_array($response); exit; } if ($_POST['action'] == 'save_technical_skill') { if (!isset($_POST['technical_skill']) || !isset($_POST['level']) || !isset($_POST['skill'])) { echo "ko"; exit; } $resume = new Resume($_POST['member'], $_POST['id']); $data = array(); $data['id'] = $_POST['technical_skill']; $data['technical_skill'] = sanitize($_POST['skill']); $data['level'] = $_POST['level']; if ($_POST['technical_skill'] == "0") { if (!$resume->create_technical_skill($data)) { echo "ko"; exit; } } else { if (!$resume->update_technical_skill($data)) { echo "ko"; exit; } } echo "ok"; exit; }