if (strcmp($method, 'POST') == 0) { $clave_prof = htmlentities($_POST['clave_prof']); if ($source == 'alta' || $source == 'modificacion') { $apellido_p = htmlentities($_POST['apellidoP']); $apellido_m = htmlentities($_POST['apellidoM']); $genero = htmlentities($_POST['genero']); $area = htmlentities($_POST['area']); $email = htmlentities($_POST['correo']); if ($source == 'alta') { if (addTutor($clave_prof, $apellido_p, $apellido_m, $genero, $area, $email)) { echo 'Tutor agregado correctamente'; } else { echo 'Error: No se pudo crear al tutor'; } } elseif ($source == 'modificacion') { if (updateTutor($clave_prof, $apellido_p, $apellido_m, $genero, $area, $email)) { echo 'Tutor modificado correctamente'; } else { echo 'Error: No se pudo modificar al tutor'; } } } else { if ($source == 'busqueda') { if (findTutor($clave_prof)) { $result = rellenarBusqueda($clave_prof); echo $result; } else { echo 'Error: No se pudo encontrar al tutor'; } } elseif ($source == 'baja') { if (deleteTutor($clave_prof)) {
{ $insertedRows = TutorData::create($ID,$name, $gender,$phone,$email,$class,$year,$major,$password,$verified); $success = ($insertedRows == 1) ? true : false; return $success; } }*/ if ($_GET['f'] == 'add' && $_GET['name'] && $_GET['gender'] && $_GET['phone'] && $_GET['email'] && $_GET['class'] && $_GET['year'] && $_GET['major'] && $_GET['password']) { addTutor($_GET['name'], $_GET['gender'], $_GET['phone'], $_GET['email'], $_GET['class'], $_GET['year'], $_GET['major'], $_GET['password']); } else { if ($_GET['f'] == 'get' && $_GET['email']) { getTutor($_GET['email']); } elseif ($_GET['f'] == 'get' && $_GET['tid']) { getTutorInfo($_GET['tid']); } else { if ($_GET['f'] == 'update' && $_GET['name'] && $_GET['gender'] && $_GET['phone'] && $_GET['email'] && $_GET['class'] && $_GET['year'] && $_GET['major'] && $_GET['password'] && $_GET['tid']) { updateTutor($_GET['name'], $_GET['gender'], $_GET['phone'], $_GET['email'], $_GET['class'], $_GET['year'], $_GET['major'], $_GET['password'], $_GET['tid']); } else { if ($_GET['f'] == 'list' && $_GET['email']) { listTutorsByEmail($_GET['email']); } else { if ($_GET['f'] == 'list' && $_GET['name']) { listTutorByName($_GET['name']); } else { if ($_GET['f'] == 'list' && $_GET['major']) { listTutorByMajor($_GET['major']); } else { if ($_GET['f'] == 'list') { listTutor(); } else { echo $_GET['gender']; }