Hacked By AnonymousFox

Current Path : /home/missmand/public_html/missmandarine.ch/learning/admin/forum/
Upload File :
Current File : /home/missmand/public_html/missmandarine.ch/learning/admin/forum/managerSujet.php

<?php

    include '../lib/init.php';
    Tool::verif_connect();

    Auth::roleAccesAuth(array(5)); /* limitation de l'accès par rôle */

    /* Recherche */
    if(isset($_POST['addRecherche'])){
        Recherche::postRecherche('sujet');
    }
    extract(Recherche::getRecherche('sujet',array('recherche','theme')));

    /* Pagination variables */
    $page = 1;
    $debut = 0;
    if (isset($_GET['page'])) {
        $page = $_GET['page'];
        $debut = $page-1;
        $debut *=50;
    }

?>
<!doctype html>
<html lang="fr">

<head>
     <meta charset="utf-8">
     <title><?php echo TITLE ?></title>
     <link href='http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,800italic,400,300,600,700' rel='stylesheet' type='text/css'/>
     <link href="<?php echo BASEADMIN ?>css/init.css" rel="stylesheet" type="text/css" />
     <link href="<?php echo BASEADMIN ?>css/template.css" rel="stylesheet" type="text/css" />
     <link href="<?php echo BASEADMIN ?>css/sujet.css" rel="stylesheet" type="text/css" />
</head>

<body>
	
	<div id="main">
		
		<!-- En tête -->
        <?php
            include '../include/header.php';
        ?>
        <!-- Menu latéral -->
        <?php
            include '../include/menu.php';
        ?>

        <div id="conteneur">

    		<div id="titre">
                <h1>Gestion des sujets</h1>
                <span id="flecheTitre"></span>
    		</div>	

        	<div class="inner">

                <div id="recherche">
                    <form action="#" method="post">

                    <select name="theme" class="small">

                        <option value="">Par thème</option>
                        
                        <?php
                            $sql = $bdd->query("SELECT forumNom, forumId FROM forum 
                                                ORDER BY forumNom ASC ");
                            while($data = $sql->fetchObject()){

                                $forumId = $data->forumId;
                                
                                $sql2 = $bdd->query("SELECT themeId, themeNom FROM forum_theme
                                                     WHERE themeForum = $forumId 
                                                     ORDER BY themeNom ASC ");

                                if($sql2->rowCount() != 0){

                                    echo'<optgroup label ="'.$data->forumNom.'">';
                                        while($data2 = $sql2->fetchObject()){
                                            if($data2->themeId == $theme)
                                                echo'<option value="'.$data2->themeId.'" selected>'.$data2->themeNom.'</option>';
                                            else
                                                echo'<option value="'.$data2->themeId.'">'.$data2->themeNom.'</option>';
                                        }
                                    echo'</optgroup>';

                                }

                            }
                        ?>

                    </select>


                        <input type="text" name="recherche" class="medium" placeholder="Recherche" value="<?php echo $recherche ?>" />
                        <input type="submit" value="" name="addRecherche" id="btnRecherche"/>

                    </form>
                    <div class="clear"></div>
                </div>

                <?php
                    echo flash();
                ?>

                <table class="table">
                    
                    <tr>
                        <th width="50%" class="left">Sujet</th>
                        <th width="10%">Réponse(s)</th>
                        <th width="10%">Abus</th>
                        <th width="10%">Thème</th>
                        <th width="10%">Fichier</th>
                        <th width="10%" colspan="2">Actions</th>
                    </tr> 

                    <?php

                        $requete = "SELECT * FROM forum_sujet
                                    INNER JOIN forum_theme ON sujetTheme = themeId 
                                    INNER JOIN utilisateur ON utilisateurId = sujetUtilisateur
                                    WHERE 0 = 0 ";
                                    if(!empty($theme))
                                        $requete .= " AND sujetTheme = $theme ";
                                    if(!empty($recherche))
                                        $requete .= " AND CONCAT(sujetNom,sujetContenu) LIKE '%$recherche%' ";
                                    $requete .= " ORDER BY sujetId DESC
                                    LIMIT $debut, 50 ";
                        $sql = $bdd->query($requete);

                        if($sql->rowCount() == 0){
                            echo'<tr>';
                                echo'<td colspan="7">Aucun Sujet</td>';
                            echo'</tr>';
                        }

                        while($data = $sql->fetchObject()){

                            echo '<tr>';

                                echo '<td class="left">';
                                    echo '<p class="created">Ajouté le : '.date("d/m/Y",$data->sujetCreated).' par : '.$data->utilisateurPrenom.' '.$data->utilisateurNom.'</p>';
                                    echo '<p><strong>'.$data->sujetNom.'</strong></p>';
                                    echo '<p>'.$data->sujetResume.'</p>';
                                echo '</td>';

                                echo'<td><a href="'.BASEADMIN.'forum/managerReponse.php?sujet='.$data->sujetId.'" class="btn bleu">Afficher</a></td>';

                                echo'<td>';
                                    $countAbus = Forum::countAbusSujet($bdd, $data->sujetId);
                                    if(!$countAbus) echo '0';
                                    else echo $countAbus;
                                echo'</td>';

                                echo'<td>'.$data->themeNom.'</td>';

                                if(!empty($data->sujetFichier))
                                    echo'<td><a href="'.BASEFRONT.'file/sujet/'.$data->sujetFichier.'" title="Voir le fichier" target="_blank"><img src="'.BASEADMIN.'img/icones/iconFolder.png"/></a></td>';
                                else
                                    echo'<td><img src="'.BASEADMIN.'img/icones/iconFolderOff.png" title="Aucun fichier"/></td>';

                                if($data->sujetEtat == 0)
                                    echo'<td class="publierSujet" id="'.$data->sujetId.'"><img src="'.BASEADMIN.'img/icones/activer.png" title="Publier / Dépublier"/></td>';
                                else
                                    echo'<td class="publierSujet" id="'.$data->sujetId.'"><img src="'.BASEADMIN.'img/icones/desactiver.png" title="Publier / Dépublier"/></td>'; 
                                echo '<td><a href="'.BASEADMIN.'forum/editSujet.php?sujet='.$data->sujetId.'" title="Modifier le sujet"><img src="'.BASEADMIN.'img/icones/modifier.png"/></a></td>';

                            echo'</tr>';

                        }

                    ?>

                </table>  

                <div id="navigation">
                        
                    <?php
                        $requete = "SELECT COUNT(sujetId) AS total FROM forum_sujet 
                                    WHERE 0 = 0 ";
                                    if(!empty($theme))
                                        $requete .= " AND sujetTheme = $theme ";
                                    if(!empty($recherche))
                                        $requete .= " AND CONCAT(sujetNom,sujetContenu) LIKE '%$recherche%' ";
                                    
                        Tool::pagination($requete,'forum/managerSujet',50,$page,$bdd);
                    ?>

                </div>


        	</div>
          
        </div>

	</div>

	<script type="text/javascript" src="<?php echo BASEADMIN ?>js/jquery.js"></script>
	<script type="text/javascript" src="<?php echo BASEADMIN ?>js/jquery-ui.js"></script>
	<script type="text/javascript" src="<?php echo BASEADMIN ?>js/script.js"></script>	

</body>
</html>



Hacked By AnonymousFox1.0, Coded By AnonymousFox