public function index() { // inclui os arquivos require_once '../App/Model/photo.class.php'; require_once '../App/Model/characteristics.class.php'; require_once '../App/Model/presentation.class.php'; require_once '../App/Model/skills.class.php'; require_once '../App/Model/portifolio.class.php'; // instancia os objetos $photo = new Photo(); $characteristics = new Characteristics(); $presentation = new Presentation(); $skills = new Skills(); $portifolio = new Portifolio(); // chama os metodos $selectPhoto = $photo->selectPhoto(); $selectCharacteristics = $characteristics->selectCharacteristics(); $selectPresentation = $presentation->selectPresentation(); $selectBasicSkills = $skills->selectBasicSkills(); $selectIntermediateSkills = $skills->selectIntermediateSkills(); $selectAdvancedSkills = $skills->selectAdvancedSkills(); $selectPortifolio = $portifolio->selectPortifolio(); // Enviando mensagem de contato $to = '*****@*****.**'; $subject = 'Contato do site'; $contactName = $_POST['name']; $contactEmail = $_POST['email']; $contactPhone = $_POST['phone']; $contactMessage = $_POST['message']; $body = '<strong>Mensagem de contato</strong><br><br>'; $body .= '<strong>Nome: </strong>' . $contactName . '<br>'; $body .= '<strong>Email: </strong>' . $contactEmail . '<br>'; $body .= '<strong>Telefone: </strong>' . $contactPhone . '<br>'; $body .= '<strong>Mensagem: </strong>' . $contactMessage . '<br>'; $header = 'From: ' . $contactEmail . ' Reply-to: ' . $contactEmail; $header .= 'Content-type: text/html; charset=utf-8'; $resposta = mail($to, $subject, $body, $header); // envia os resultados para o index require_once '../App/View/Index/index.php'; }
public function presentation() { require_once '../App/Model/presentation.class.php'; $presentation = new Presentation(); $id = $this->getURL(); if (isset($_GET['action'])) { switch ($_GET['action']) { case 'insert': if (!empty($_POST['presentation_text']) && !empty($_POST['curriculum_text'])) { $presentation = new Presentation($_POST['presentation_text'], $_POST['curriculum_text']); $insertPresentation = $presentation->insertPresentation(); if (!empty($insertPresentation)) { echo $insertPresentation; } } break; case 'edit': $selectOnePresentation_edit = $presentation->selectOnePresentation($id); if (isset($_GET['operation']) && $_GET['operation'] == 'ok') { if (!empty($_POST['presentation_text_edit']) && !empty($_POST['curriculumt_text_edit'])) { $presentation = new Presentation($_POST['presentation_text_edit'], $_POST['curriculumt_text_edit']); $updateOnePresentation = $presentation->updateOnePresentation($id); if (!empty($updateOnePresentation)) { echo $updateOnePresentation; } } } break; case 'delete': $deleteOnePresentation = $presentation->deleteOnePresentation($id); if (!empty($deleteOnePresentation)) { echo $deleteOnePresentation; } break; } } $selectPresentation = $presentation->selectPresentation(); require_once '../App/View/Adm_content/presentation.php'; }