1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
| <?php session_start(); ?>
<?php require_once("connexioninscription.inc.php"); ?>
<div id="container">
<?php include("header.inc.php"); ?>
<?php include("menus.inc.php"); ?>
<div id="corpspublication">
<div id="retourselect">
<a href="publication.php" title="recharger la page"><h1 class="titre1">Publication</h1></a>
</div>
<div id="souscorpspublication">
<div id="encartpubl"><h3 class="textesimple">Publier une oeuvre</h3></div>
<?php
$query=$bdd->prepare('SELECT artiste_id, titre_oeuvre, description_oeuvre, image_oeuvre, oeuvre_categorie, oeuvre_style, oeuvre_id, date_crea, date_edit FROM oeuvre_artiste');
if (empty($_SESSION['membre_id']))
{
echo '<p class="textewarning">'."vous devez vous connectez pour accéder à la publication oeuvre".'</p>';
}
else
{
echo '<form method="post" action="" enctype="multipart/form-data">
<label for="titre"><p class="textesimple">Titre : </p></label><input type="text" name="titre" id="oeuvretitre" />
<label for="oeuvre"><p class="textesimple">Oeuvre : </p></label><input type="file" name="imgpublication"/>
<label for="description"><p class="textesimple">Description : </p></label><input type="text" name="oeuvredescription" id="oeuvredescription" />
<label for="categorie"><p class="textesimplesans">Catégorie</p></label><br />
<select name="categorie" id="categorie">
<option value="peinture">Peinture</option>
<option value="croquis">Croquis</option>
<option value="dessin">Dessin</option>
<option value="autre">Autre...</option>
</select>
<label for="style"><p class="textesimplesans">Style</p></label><br />
<select name="style" id="style">
<option value="abstrait">Abstrait</option>
<option value="pointillisme">Pointillisme</option>
<option value="cubisme">Cubisme</option>
<option value="autre">Autre...</option>
</select>
<label for="datecreaoeuvre"><p class="textesimple">Date de création : </p></label><input type="text" name="datecreaoeuvre" id="datecreaoeuvre" />
<input type="submit" name="envoyer" value="envoyer"/>
</form>';
if (isset($_POST['envoyer']))
{
if (!empty($_FILES))
{
$imgpublication=$_FILES['imgpublication'];
$ext = strtolower(substr($imgpublication['name'],-3));
$allow_ext = array('jpg','png','gif');
if (in_array($ext,$allow_ext))
{
move_uploaded_file($imgpublication['tmp_name'],"images/oeuvres/".$imgpublication['name']);
}
}
else
{
$erreurpublication = "Votre fichier contient une mauvaise extension, ou n'est pas une image.";
}
if (isset($erreurpublication))
{
echo $erreurpublication;
}
$titre = ($_POST['titre']);
$oeuvredescription = ($_POST['oeuvredescription']);
$style = ($_POST['style']);
$datecreaoeuvre = ($_POST['datecreaoeuvre']);
}
}
?>
</div>
</div>
<?php include("footer.inc.php"); ?>
</div> |
Partager