Bienvenue sur mon patron est con | Ici c'est garanti 100% anonyme |
Mon patron est con est le site de tous vos coups de gueule contre votre patron.
Publiez et partagez en tout anonymat
vos coups de gueule contre ces chefs qui ne savent pas manager ! Parce qu'il faut savoir dire STOP !
|
| Statistiques Mon Patron est Con : |
$sql = "
SELECT *
FROM users
";
$result = mysql_query($sql);
$nb_users = mysql_num_rows($result);
$sql = "
SELECT *
FROM anecdote
WHERE anecdote.id_cat = '0'
";
$result = mysql_query($sql);
$nb_anec_sexy = mysql_num_rows($result);
$sql = "
SELECT *
FROM anecdote
WHERE anecdote.id_cat = '1'
";
$result = mysql_query($sql);
$nb_anec_hard = mysql_num_rows($result);
$sql = "SELECT COUNT(*) as Nb_comm FROM `comments`";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)):
$nb_comm = $row["Nb_comm"];
endwhile;
$sql = "SELECT SUM( total_votes ) AS Total_Votes
FROM `ratings`
WHERE 1 ";
$result = mysql_query($sql);
while($row = mysql_fetch_array($result)):
$nb_votes = $row["Total_Votes"];
endwhile;
?>
Notice: Undefined variable: nb_anec_hard in /public_html/monpatronestcon/index.php on line 123
Notice: Undefined variable: nb_anec_sexy in /public_html/monpatronestcon/index.php on line 123
0 coups de gueule ont été publiés
Notice: Undefined variable: nb_comm in /public_html/monpatronestcon/index.php on line 132
commentaires et
Notice: Undefined variable: nb_votes in /public_html/monpatronestcon/index.php on line 132
votes
Notice: Undefined variable: nb_users in /public_html/monpatronestcon/index.php on line 135
membres actifs.
- 32 visiteurs sont actuellement en ligne.
| Dernier coup de gueule poussé : |
$sql = "
SELECT
anecdote.id_anec,
anecdote.title,
anecdote.text,
anecdote.date as LaDate,
users.nickname
FROM anecdote,users
WHERE anecdote.id_user=users.id_user
AND anecdote.active='1'
ORDER BY anecdote.id_anec DESC
LIMIT 1
";
$result = mysql_query($sql);
// Si un enregistrement est trouvé
if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{
$sql2 = "
SELECT COUNT(id_comment) as NbComment
FROM comments
WHERE id_anec = '".$row["id_anec"]."'
AND active='1'
";
$result2 = mysql_query($sql2);
while($row2 = mysql_fetch_array($result2)) { $nb_com = $row2["NbComment"]; }
//Calcul de la moyenne des votes
$vote_total=0;
$sql3 = "
SELECT *
FROM ratings
WHERE id = '".$row["id_anec"]."'
";
$result3 = mysql_query($sql3);
if(mysql_num_rows($result3) > 0)
{
while($row3 = mysql_fetch_array($result3))
{
if(intval($row3["total_votes"]!=0)) {
$note = intval($row3["total_value"])/intval($row3["total_votes"]);
} else {
$note = 0;
}
}
$width = ($note*73)/5;
}
else { $width=0; }
//On transforme la date
$ladate = date("d/m/y à H:i",$row["LaDate"]);
//On prend un bout du texte seulement
if(strlen($row["text"])>240) {
$nb_caracteres = 240;
for($i=$nb_caracteres; $i<= $nb_caracteres+100;$i++) {
if(substr($row["text"],$i,1)==" ") {
$text = substr($row["text"],0,$i).'...';
break;
}
else { $text = $row["text"]; }
}
} else { $text = $row["text"]; }
echo '
'
.'
'
.'
'.$text.'
'
.'
'
.' |
'
.'rédigé par '.$row["nickname"].' le '.$ladate
.' | Commentaires('. $nb_com .')'
.' |
';
}
}
?>
| Le Top 3 des Coups de Gueule : |
$sql = "
SELECT anecdote.id_anec, anecdote.title, anecdote.text, anecdote.date AS LaDate, users.nickname, (ratings.total_value/ratings.total_votes) AS Somme
FROM anecdote, users, ratings
WHERE anecdote.id_user = users.id_user
AND ratings.id = anecdote.id_anec
AND anecdote.active = '1'
GROUP BY id_anec
ORDER BY `Somme` DESC
LIMIT 3
";
$result = mysql_query($sql);
// Si un enregistrement est trouvé
if(mysql_num_rows($result) > 0)
{
while($row = mysql_fetch_array($result))
{
$sql2 = "
SELECT COUNT(id_comment) as NbComment
FROM comments
WHERE id_anec = '".$row["id_anec"]."'
";
$result2 = mysql_query($sql2);
while($row2 = mysql_fetch_array($result2)) { $nb_com = $row2["NbComment"]; }
//Calcul de la moyenne des votes
$vote_total=0;
$sql3 = "
SELECT *
FROM ratings
WHERE id = '".$row["id_anec"]."'
";
$result3 = mysql_query($sql3);
if(mysql_num_rows($result3) > 0)
{
while($row3 = mysql_fetch_array($result3))
{
if(intval($row3["total_votes"]!=0)) {
$note = intval($row3["total_value"])/intval($row3["total_votes"]);
} else {
$note = 0;
}
}
$width = ($note*73)/5;
}
else { $width=0; }
//On transforme la date
$ladate = date("d/m/y à H:i",$row["LaDate"]);
if(strlen($row["text"])>240) {
$nb_caracteres = 240;
for($i=$nb_caracteres; $i<= $nb_caracteres+100;$i++) {
if(substr($row["text"],$i,1)==" ") {
$text = substr($row["text"],0,$i).'...';
break;
} else {
$text = substr($row["text"],0,240).'...';
}
}
} else { $text = $row["text"]; }
echo '
'
.'
'
.'
'.$text.'
'
.'
'
.' |
'
.'rédigé par '.$row["nickname"].' le '.$ladate
.' | Commentaires('. $nb_com .')'
.' |
';
}
}
?>