Beispiel #1
0
 private static function makeTutor($linha)
 {
     $nome = $linha['nome'];
     $pessoaId = $linha['id_pessoa'];
     $sobrenome = $linha['sobrenome'];
     $cpf = $linha['cpf'];
     $email = $linha['email'];
     $formacaoId = $linha['id_formacao'];
     $formacaoDescricao = $linha['d_formacao'];
     $formacao = array("descricao" => $formacaoDescricao, "id" => $formacaoId);
     $titulacaoId = $linha['id_titulacao'];
     $titulacaoDescricao = $linha['d_titulacao'];
     $titulacao = array("descricao" => $titulacaoDescricao, "id" => $titulacaoId);
     $tutorId = $linha['id_tutor'];
     $tutor = new Tutor();
     $tutor->setCpf($cpf);
     $tutor->setEmail($email);
     $tutor->setFormacao($formacao);
     $tutor->setId($pessoaId);
     $tutor->setSobrenome($sobrenome);
     $tutor->setNome($nome);
     $tutor->setTitulacao($titulacao);
     $tutor->setTutorId($tutorId);
     $tutor->setId($pessoaId);
     return $tutor;
 }
 function update()
 {
     $tutor = new Tutor();
     $tutor->setNome($_POST['nome']);
     $tutor->setCpf($_POST['cpf']);
     $tutor->setEmail($_POST['email']);
     $tutor->setSobrenome($_POST['sobrenome']);
     $formacao = array('id' => $_POST['formacao']);
     $titulacao = array('id' => $_POST['titulacao']);
     $tutor->setFormacao($formacao);
     $tutor->setTitulacao($titulacao);
     $tutor->setTutorId($_POST['id']);
     $tutor->setId($_POST['id_pessoa']);
     $tutor->update();
     header("location: ../view/index.php");
 }