Example #1
0
 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';
 }
Example #2
0
 public function characteristics()
 {
     require_once '../App/Model/characteristics.class.php';
     $characteristics = new Characteristics();
     $id = $this->getURL();
     if (isset($_GET['action'])) {
         switch ($_GET['action']) {
             case 'insert':
                 if (!empty($_POST['text'])) {
                     $characteristics = new Characteristics($_POST['text']);
                     $insertCharacteristics = $characteristics->insertCharacteristics();
                     if (!empty($insertCharacteristics)) {
                         echo $insertCharacteristics;
                     }
                 }
                 break;
             case 'edit':
                 $selectOneCharacteristics_edit = $characteristics->selectOneCharacteristics($id);
                 if (isset($_GET['operation']) && $_GET['operation'] == 'ok') {
                     if (!empty($_POST['text_edit'])) {
                         $characteristics = new Characteristics($_POST['text_edit']);
                         $updateOneCharacteristics = $characteristics->updateOneCharacteristics($id);
                         if (!empty($updateOneCharacteristics)) {
                             echo $updateOneCharacteristics;
                         }
                     }
                 }
                 break;
             case 'delete':
                 $deleteOneCharacteristics = $characteristics->deleteOneCharacteristics($id);
                 if (!empty($deleteOneCharacteristics)) {
                     echo $deleteOneCharacteristics;
                 }
                 break;
         }
     } else {
         echo '<h2>Acao diferente de insert, edit e delete</h2>';
     }
     $selectCharacteristics = $characteristics->selectCharacteristics();
     require_once '../App/View/Adm_content/characteristics.php';
 }