| Current Path : /home/c/i/n/cinepatreb/www/ws/php/ | 
| Current File : /home/c/i/n/cinepatreb/www/ws/php/film.php | 
<?php
include_once '../php/dao/include_dao.php';
include_once 'outils.php';
  $pkFilm = $_GET['film'];
if ($pkFilm != '') {
    $film = DAOFactory::getFilmDAO()->load($pkFilm);
    ?>
    <link rel="stylesheet" href="/Patria/ws/templates/cine/css/template.css" type="text/css" />
    <style>
        body{
            color:white;
            font-family: Verdana;
            font-size: 11px;
            background-color:  #1a1a1a;
        }
        .txtRed{
            color:#c73025;
        }
        .gras{
            font-weight: bold;
        } 
        table{
            border-spacing: 0px 0px;
            text-align: left ;
        }
        a{
            color:white;
        }
        .txtJustify{
            text-align: justify ;
        }
        .afficheFilm{
            padding: 10px;
            width:350px;
        }
        .afficheFilm img{
            width:350px;
        }
        .valign{
            vertical-align: top;
        }
        #synopsis{
            color:white;
            font-family: Verdana;
        }
        #synopsis td{
            padding: 5px;
        }
        h2{
            font-size: 16px;
        }
        .synopsysHoraire{
            width:80%;
        }
        .affichePaire{
            background-color: #444;
        }
        .afficheImpaire{
            background-color: black;
        }
        iframe{
            margin-left: auto;
            margin-right: auto;
        }
    </style>
    <h2><?php echo $film->nomFilm; ?></h2>
    <table id="synopsis">
        <tr>
            <td class="valign">
                <div class="afficheFilm">
                    <img src="../patriaManagment/media/files/<?php echo $film->affiche; ?>"/> 
                </div>
            </td>
            <td class="valign">
                <div id="infos" >
                    <!-- Début Horaires>-->
                    <div id="seances">
                        <?php if ($film->acceuil == -1) { ?>
                            <?php
                            $listeHeurePatria = DAOFactory::getListeHeureGroupeDAO()->queryByHeurePourFilm(1, Cine::PATRIA, Date::getDateAujourdhui(0), $film->pkFilm);
                            $listeHeureNosLoisirs = DAOFactory::getListeHeureGroupeDAO()->queryByHeurePourFilm(1, Cine::NOSLOISIRS, Date::getDateAujourdhui(0), $film->pkFilm);
                            ?> 
                            <table class="synopsysHoraire">
                                <tr>
                                    <td class="valign">
                                        <h3 class="txtRed">PATRIA</h3>
                                        <?php
                                        $heure = new Horaire();
                                        $i = 0;
                                        foreach ($listeHeurePatria as $heure) {
                                            $style = "afficheImpaire";
                                            if ($i % 2) {
                                                $style = "affichePaire";
                                            }
                                            echo "<div class=\"" . $style . "\">";
                                            echo "<table><tr>";
                                            echo "<td class=\"wd100px\">";
                                            //echo testValeur(Date::formatageDate(Date::getDateAujourdhui(0), DAte::D_M_Y), Date::formatageDate($heure->heure, Date::D_M_Y), "Aujourd'hui", ucfirst(Date::formatageDate($heure->heure, Date::D_M_Y)));
                                            echo testValeur(Date::formatageDate(Date::getDateAujourdhui(0), DAte::D_M_Y), Date::formatageDate($heure->heure, Date::D_M_Y), "Aujourd'hui", substr(ucfirst(Date::formatageDate($heure->heure, Date::DD_M_Y)), 0, 3) . " " . Date::formatageDate($heure->heure, Date::D_M));
                                            echo "</td>";
                                            echo" <td>" . ucfirst(Date::formatageDate($heure->heure, Date::HH_MM)) . "</td>";
                                            echo "</tr></table>";
                                            echo "</div>";
                                            $i++;
                                        }
                                        ?>
                                    </td>
                                    <td class="valign">
                                        <h3 class="txtRed">NOS LOISIRS</h3>
                                        <?php
                                        $heure = new Horaire();
                                        $i = 0;
                                        foreach ($listeHeureNosLoisirs as $heure) {
                                            $style = "afficheImpaire";
                                            if ($i % 2) {
                                                $style = "affichePaire";
                                            }
                                            echo "<div class=\"" . $style . "\">";
                                            echo "<table><tr>";
                                            echo "<td class=\"wd100px\">";
                                            echo testValeur(Date::formatageDate(Date::getDateAujourdhui(0), DAte::D_M_Y), Date::formatageDate($heure->heure, Date::D_M_Y), "Aujourd'hui", substr(ucfirst(Date::formatageDate($heure->heure, Date::DD_M_Y)), 0, 3) . " " . Date::formatageDate($heure->heure, Date::D_M));
                                            echo "</td>";
                                            echo" <td>" . ucfirst(Date::formatageDate($heure->heure, Date::HH_MM)) . "</td>";
                                            echo "</tr></table>";
                                            echo "</div>";
                                            $i++;
                                        }
                                        ?>
                                    </td>
                                </tr>
                            </table>
                            <?php
                        } else {
                            echo "<h2>Prochainement</h2>";
                        }
                        ?>
                    </div>
                    <!--FinHoraires> -->
                    <table>
                        <tr>
                            <td class="td100px">
                                <span class="txtRed">
                                    <?php
                                    $listeGenres = DAOFactory::getListeGenreFilmDAO()->queryAllOrderByFilm($film->pkFilm);
                                    echo "GENRE";
                                    if (count($listeGenres) > 1) {
                                        echo "S";
                                    }
                                    ?>
                                </span> 
                            </td>
                            <td>
                                <?php
                                $i = 0;
                                foreach ($listeGenres as $genre) {
                                    $activeGenre = new Genre();
                                    $activeGenre->pkGenre = $genre->fkGenre;
                                    $selectGenre = DAOFactory::getGenreDAO()->load($activeGenre->pkGenre);
                                    $i++;
                                    echo $selectGenre->genre;
                                    if (count($listeGenres) > 1 && $i < count($listeGenres)) {
                                        echo " - ";
                                    };
                                }
                                ?>
                            </td>
                        </tr>
                        <tr>
                            <td class="txtRed">DATE DE SORTIE</td>
                            <td><?php echo Date::formatageDate($film->dateSortie, DAte::D_M_Y) ?></td>
                        </tr>
                        <tr>
                            <td class="txtRed">ACTEURS</td>
                            <td><?php echo $film->acteur; ?></td>
                        </tr>
                        <tr>
                            <td class="txtRed">
                                REALISATEUR
                            </td>
                            <td><?php echo $film->realisateur; ?></td>
                        </tr>
                        <tr>
                            <td class="txtRed">DUREE</td>
                            <td><?php echo Date::formatageDate($film->duree, Date::HH_MM); ?></td>
                        </tr>
                        <?php
                        if ($film->description != "") {
                            ?>
                            <tr>
                                <td>
                                    <span class="txtRed">DESCRIPTION</span> 
                                </td>
                                <td class="txtJustify"><?php echo $film->description; ?>  </td>
                            </tr>
                            <?php
                        }
                        ?>
                        <tr>
                            <td class="txtJustify" colspan="2" >
                                <?php echo $film->information; ?>
                            </td>
                        </tr>
                        <?php
                        if ($film->urlSite != "") {
                            ?>
                            <tr>
                                <td class="txtRed">BANDE ANNONCE</td>
                                <td >
                                    <a target="_blank" href="<?php echo $film->urlSite; ?>"> <?php echo $film->urlSite; ?></a>
                                </td>
                            </tr>
                            <?php
                        }
                        ?>
                    </table>
                </div>
            </td>
        </tr>
        <tr>
            <td colspan="2" class="tdAlignCentre">
                <div id="video" class="tdAlignCentre">
                    <?php echo $film->urlVideo; ?>
                </div>
            </td>
        </tr>
    </table>
    <?php
} else {
    echo '<div class="contenu">';
    echo "Pas de film selectionné.";
    echo '</div>';
}
?>