Team #informatique
if($axx>8 && $chemin[2] == "modif")
{
if ($_POST['action'] == "modifier" && !empty($chemin[3]) && !empty($_POST['pseudo']) && !empty($_POST['categorie']))
{
$pseudo = $_POST['pseudo'];
$fonction = $_POST['fonction'];
$categorie = $_POST['categorie'];
echo "UPDATE de la table team
";
$query = "UPDATE staff SET pseudo='$pseudo',fonction='$fonction',categorie='$categorie' WHERE id='$chemin[3]'";
mysql_query($query) or die("ERREUR: ".mysql_error());
echo "
Table modifiée avec succès
USER: $pseudo
Fonction: $fonction
Categorie: $categorie
";
}
elseif($_POST['action'] == "supprimer" && !empty($chemin[3]))
{
echo "Suppression d'un element
";
$query = "DELETE FROM staff WHERE id='$chemin[3]' LIMIT 1";
mysql_query($query) or die("ERREUR: ".mysql_error());
echo "
Suppression effectuée avec succè
";
}
else {
echo "Modification de la team
";
$result = mysql_query("SELECT * from staff ORDER BY pseudo ASC") or die("ERREUR: ".mysql_error());
while ($row = mysql_fetch_array($result))
{
echo "
";
}
echo "
Nouvel élément
";
}
}
elseif($axx>8 && $chemin[2] == "new")
{
if (!empty($_POST['pseudo']) && !empty($_POST['categorie']))
{
$pseudo = $_POST['pseudo'];
$fonction = $_POST['fonction'];
$categorie = $_POST['categorie'];
echo "UPDATE de la table team
";
$query = "INSERT INTO staff (pseudo,fonction,categorie) VALUES('$pseudo','$fonction','$categorie');";
mysql_query($query) or die("ERREUR: ".mysql_error());
echo "
";
}
else {
echo "";
}
else
{
?>
Les administrateurs
$query = "SELECT * from staff WHERE categorie='admin' ORDER BY fonction ASC";
$result = mysql_query($query) or die("FATAL: ".mysql_error()."
$query");
while ($row = mysql_fetch_array($result))
{
echo "- $row[1]\n
- $row[2]
\n";
}
?>
Les développeurs
$query = "SELECT * from staff WHERE categorie='dev' ORDER BY fonction ASC";
$result = mysql_query($query) or die("FATAL: ".mysql_error()."
$query");
while ($row = mysql_fetch_array($result))
{
echo "- $row[1]\n
- $row[2]
\n";
}
?>
Les membres de l'équipe
$query = "SELECT * from staff WHERE categorie='team' ORDER BY fonction ASC";
$result = mysql_query($query) or die("FATAL: ".mysql_error()."
$query");
while ($row = mysql_fetch_array($result))
{
echo "- $row[1]\n
- $row[2]
\n";
}
?>
}
?>