Skip to content
Extraits de code Groupes Projets
Valider 6ac3c09c rédigé par mattgoss's avatar mattgoss
Parcourir les fichiers

favoris

parent 02c9acdf
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -14,7 +14,8 @@ if (isset($_SESSION['authent'])) :
if ($row['mail'] == $peusdo && $row['mdp'] == $password) :
$_SESSION['authent'] = 1;
$_SESSION['pseudo'] = $row['mail'];
$_SESSION['name'] = $row['prenom']
$_SESSION['name'] = $row['prenom'];
$_SESSION['id']=$row['id_user']
?>
<div class="row">
<div class="col-sm-4 ml-auto">
......
<?php echo "vide"?>
\ No newline at end of file
<?php
include "./config/database.php";
include "header.php";
if (isset($_SESSION["authent"]) && $_SESSION['authent'] == 0){
echo "
<meta http-equiv=\"refresh\" content=\"0; url=index.php\">";
exit();
}
?>
<div class="text-center fadeInUp animated pt-4">
<h1>Favoris</h1>
</div>
</header>
<section class="one">
<div class="container">
<h2>Top 10 Favoris</h2>
<div class="divider"></div>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col" class="text-right">Nom</th>
<th scope="col" class="text-right">Nombre de Followers</th>
</tr>
</thead>
<tbody>
<?php
$result = mysqli_query($link, "SELECT nom_artiste, nb_youtube + nb_instagram as nb, tag_instagram FROM influenceurs NATURAL JOIN favoris WHERE nb_youtube != 0 && nb_instagram != 0 && id_user = ".$_SESSION["id"]." ORDER BY nb DESC LIMIT 10");
$compt = 1;
while($row = mysqli_fetch_assoc($result)) : $compt=2;?>
<tr onclick="document.location = 'page_globale.php?user=<?= $row['tag_instagram'] ?>';" class="table-click">
<th scope="row"><?= $compt ?></th>
<td class="text-right"><?php if ($compt == 1) : ?><i class="fas fa-medal"></i><?php endif;?> <?= $row['nom_artiste'] ?></td>
<td class="text-right"><?= $row['nb'] ?></td>
</tr>
<?php
endwhile; ?>
</tbody>
</table>
<?php if ($compt==1) echo "Pas de favoris <br/><br/><br/>"; ?>
<h2>Mes Favoris</h2>
<div class="divider"></div>
<table class="table">
<?php
$resultI = mysqli_query($link, "SELECT * FROM influenceurs NATURAL JOIN favoris WHERE id_user = ".$_SESSION["id"]." ");
$compt = 1;
while($row = mysqli_fetch_assoc($resultI)) : $compt =2?>
<tr>
<td> <b> <?php echo $row['nom_artiste']; ?> </b> </td>
<td>
<?php if ( (isset($_GET["youtube"]) || !isset($_GET["instagram"])) && !empty($row['tag_youtube'])) { ?>
<a href="youtube?user=<?php echo $row['tag_youtube'];?>"> <i class="fab fa-youtube fa-2x"></i> </a>
<?php } ?>
</td>
<td>
<?php if ( (isset($_GET["instagram"]) || !isset($_GET["youtube"])) && !empty($row['tag_instagram'])) { ?>
<a href="instagram-profil.php?user=<?php echo $row['tag_instagram'];?>"> <i class="fab fa-instagram fa-2x"></i> </a>
<?php } ?>
</td>
<td>
<?php if (( (!isset($_GET["instagram"]) && !isset($_GET["youtube"])) || ( isset($_GET["instagram"]) && isset($_GET["youtube"]))) && (!empty($row['tag_instagram']) && !empty($row['tag_youtube']))) { ?>
<a href="page_globale.php?user=<?php echo $row['tag_instagram'];?>"> <i class="fa fa-file fa-2x"></i> </a>
<?php } ?>
</td>
<?php
endwhile; if ($compt==1) echo "Pas de favoris";?>
</table>
</div>
</section>
<?php
include "footer.php"
?>
\ No newline at end of file
......@@ -132,6 +132,9 @@
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"tab.php\">Tableau de bord</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"favoris.php\">Mes favoris</a>
</li>
<li class=\"nav-item\">
<a class=\"nav-link\" href=\"deconnexion.php\" id=\"disconnected\" onclick=\"discoPop()\">Déconnexion</a>
</li>";
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter