Example #1
0
        echo "L'image " . basename($_FILES["fileToUpload"]["name"]) . " a été ajouté. ";
        // Insérer un nouveau enregistrement dans la table PHOTO
        $category = "no category";
        $season = "no season";
        $title = basename($_FILES["fileToUpload"]["name"]);
        $description = "no description";
        $link = $target_file;
        $unePhoto = new Photo();
        //$unePhoto->setId( $_REQUEST['id'] );
        $unePhoto->setCategory($category);
        $unePhoto->setSeason($season);
        $unePhoto->setTitle($title);
        $unePhoto->setDescription($description);
        $unePhoto->setLink($link);
        $unePhoto->setHidden(0);
        $dao = new PhotoDao();
        $dao->create($unePhoto);
    } else {
        echo "Désolé, une erreur s'est produite.";
    }
}
// Source de : http://www.w3schools.com/
?>
		<br/>
		<br/>
		<a href="./admin.php?what=photo"><b><u>Retourner &agrave; la gestion des photos</u></b></a>
		
	</div>
</div>
</body>
</html>
Example #2
0
				</div>
				<div class="clearfix"> </div>
			</div>
		</div>
	</div>
	<!--Work-Starts-Here-->
	 <!-- content-section-starts -->
	 <div class="gallery-content">
	 <div class="container">
		<div class="gallery-content-head text-left">
			<h3>Gallerie Photos</h3>
                        <form id="listePhotos" action="" method="get">
<?php 
require_once 'code/classes/PhotoDao.php';
require_once 'code/classes/Photo.php';
$dao = new PhotoDao();
$categories = $dao->getCategoriesList();
$seasons = $dao->getSeasonsList();
$taillePage = 12;
//12 photos by page
$selected = " selected='selected'";
if (!isset($_SESSION)) {
    session_start();
}
if (isset($_REQUEST['photosCategory'])) {
    unset($_SESSION['nbResultats']);
    if ($_REQUEST['photosCategory'] == "all") {
        unset($_SESSION['selectedCategory']);
    } else {
        $_SESSION['selectedCategory'] = $_REQUEST['photosCategory'];
    }
Example #3
0
  <LI><A 
  href="http://getbootstrap.com/examples/justified-nav/#">Downloads</A></LI>
  <LI><A href="http://getbootstrap.com/examples/justified-nav/#">About</A></LI>
  <LI><A 
href="http://getbootstrap.com/examples/justified-nav/#">Déconnexion</A></LI></UL></NAV></DIV><!-- Jumbotron --> 

<h3>Gestion de photos</h3>
<!-- Example row of columns -->       
<DIV class="row">
<DIV class="col-lg-12">
<div>
<?php 
require_once 'code/classes/PhotoDao.php';
require_once 'code/classes/Photo.php';
require_once 'code/classes/Util.php';
$dao = new PhotoDao();
$categories = $dao->getCategoriesList();
$seasons = $dao->getSeasonsList();
$afficheListe = TRUE;
if (isset($_REQUEST['action'])) {
    switch ($_REQUEST['action']) {
        case 'edit':
            $afficheListe = FALSE;
            $p = $dao->findById($_REQUEST['id']);
            echo $dao->delete($_REQUEST['id']);
            //$dao->findById($_REQUEST['id'])->getLink();
            ?>
			<h4>&Eacutedition</h4>
                        <table>
                            <tr><td>
                                <img height='200' src='<?php