<?php
session_start();
include('connexion.php');
include('fonctions.php');
if(isset($_SESSION['login']))
{
$login = $_SESSION['login'];
if(isset($_SESSION['admin'])&&($_SESSION['admin']==1))
{
$page = "<a class='titre' href='index.php'>Accueil</a> > <a class='titre' href='#'>Edition</a>";
$no = $_POST['no'];
$type = $_POST['type'];
// Récupération du contenu déjà existant
$stmt_select_article = $objPdo->prepare('SELECT * FROM donnees WHERE no_donnee = :no');
$stmt_select_article->bindValue(':no', $no);
if($stmt_select_article->execute())
{
$resultat = $stmt_select_article->fetch(PDO
::FETCH_BOTH);
if($resultat)
{
$mel = $resultat['mise_en_ligne'];
$titre = $resultat['titre'];
$donnee = $resultat['donnee'];
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="css/titre.css" rel="stylesheet" type="text/css">
<link href="css/article.css" rel="stylesheet" type="text/css">
<link href="css/menu.css" rel="stylesheet" type="text/css">
<link href="js/menu.js" rel="stylesheet" type="text/javascript">
<script type="text/javascript" src="./tinymce/jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="./tinymce.js"></script>
<title>Edition de l'article - Société Goethe de France</title>
</head>
<body>
<div class="container">
<?php include('titre.php'); ?>
<div class="row">
<div class="span12 article">
<h3>Edition de l'article (
<?php echo getLibelleType
($type);?>)</h3>
<form action='valid_edit.php' method="post">
<div class="row">
<div class="span5 left">Titre :</div>
<div class="span7 right"><input type="text" name="titre" value="
<?php echo $titre ?>"></div>
</div>
<div class="row">
<div class="span12"><center><textarea name="content" cols="200" rows="20">
<?php echo $donnee ?></textarea></center></div>
</div>
<input type="hidden" name="no" value="
<?php echo $no ?>">
<input type="hidden" name="type" value="
<?php echo $type ?>">
<div class="row">
<div class="span12"><center><input type="submit" value="Modifier"></center></div>
</div>
</form>
</div>
<div class="span12 article">
<h3>Suppression de l'article</h3>
<form action='suppr_art.php' method='post'>
<div class="row">
<div class="span12"><center>
<input type="submit" onclick="if(!confirm('Attention, cet article va être supprimé définitivement. Souhaitez-vous continuer ?')) return false;" value="Supprimer définitivement cet article" />
<input type="hidden" name="no" value="
<?php echo $no ?>">
<input type="hidden" name="type" value="
<?php echo $type ?>">
</center></div>
</div>
</form>
</div>
</div>
<?php include ("plan.php"); ?>
</div>
</body>
</html>
<?php
}
}
}
}
?>