$utilisateur = Utilisateur::getById($_SESSION['id']); if (!($utilisateur->estAdministrateur() || $utilisateur->estProfesseur())) { header('location: ../Intranet/mesInformations.php'); } } else { header('location: ../Intranet/connexion.php'); } if (isset($_POST['btSubmit'])) { $cahierTexte = new CahierTexte(); $matiereNiveau = MatiereNiveau::getByMatiereNiveau($_POST['selectMatiere'], $_POST['selectNiveau']); $cahierTexte->setIdMatiereNiveau($matiereNiveau->getIdMatiereNiveau()); $cahierTexte->setDateRealisation($_POST['selectDate']); $cahierTexte->setDateRedaction(date("Y-m-d")); $cahierTexte->setIdRedacteur($utilisateur->getIdUtilisateur()); $cahierTexte->setContenuCahierTexte($_POST['contenuCahierTexte']); $cahierTexte->insert(); // tansfert du fichier Plan de Travail associ�. if (!empty($_FILES['fichierCahierTexte'])) { if (ftp_link::estPDFfile($_FILES['fichierCahierTexte']['name'], $_FILES['fichierCahierTexte']['type'])) { if ($_FILES['fichierCahierTexte']['error'] == 0) if (!move_uploaded_file($_FILES['fichierCahierTexte']['tmp_name'], '../CahierTexte/CahierTexte' . $cahierTexte->getIdCahierTexte() . '.pdf')) { echo "Un probl�me est survenu sur l'envoi du fichier. Merci de contacter le support."; } } } } ?> <!DOCTYPE html> <html>