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 skills()
 {
     require_once '../App/Model/skills.class.php';
     $skills = new Skills();
     $id = $this->getURL();
     if (isset($_GET['action'])) {
         switch ($_GET['action']) {
             case 'insert':
                 if (!empty($_POST['text']) && !empty($_POST['nivel'])) {
                     $skills = new Skills($_POST['text'], $_POST['nivel']);
                     $insertSkills = $skills->insertSkills();
                     if (!empty($insertSkills)) {
                         echo $insertSkills;
                     }
                 }
                 break;
             case 'edit':
                 $selectOneSkills_edit = $skills->selectOneSkills($id);
                 if (isset($_GET['operation']) && $_GET['operation'] == 'ok') {
                     if (!empty($_POST['text_edit']) && !empty($_POST['nivel'])) {
                         $skills = new Skills($_POST['text_edit'], $_POST['nivel']);
                         $updateOneSkills = $skills->updateOneSkills($id);
                         if (!empty($updateOneSkills)) {
                             echo $updateOneSkills;
                         }
                     }
                 }
                 break;
             case 'delete':
                 $deleteOneSkills = $skills->deleteOneSkills($id);
                 if (!empty($deleteOneSkills)) {
                     echo $deleteOneSkills;
                 }
                 break;
         }
     } else {
         echo '<h2>Acao diferente de insert, edit e delete</h2>';
     }
     $selectBasicSkills = $skills->selectBasicSkills();
     $selectIntermediateSkills = $skills->selectIntermediateSkills();
     $selectAdvancedSkills = $skills->selectAdvancedSkills();
     require_once '../App/View/Adm_content/skills.php';
 }