Section téléchargement

Liste des Catégories disponibles

Vous trouverez dans cette rubrique differents programmes disponibles que nous vous proposons de telecharger via les site officiel.

"; if ($axx > 4) { echo "

ADMIN: Ajouter un programme

"; } $ancien = ""; $compteur = 0; $query = "SELECT categorie FROM download ORDER BY categorie ASC"; $result = mysql_query($query) or die(mysql_error()); $valeurs = array(); echo "
"; echo "

Les 5 Derniers éléments

"; $query = "SELECT * FROM download ORDER BY id DESC limit 5"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) ==0) { echo "

Erreur

Aucun element contenu dans cette categorie ($chemin[3])

"; } while ($row = mysql_fetch_array($result)) { echo "

$row[1] ($row[7]) Telecharger ($row[6]) sur $row[8]

"; $lignes = explode("\n",$row[5]); foreach($lignes as $key) { echo "

$key

\n"; } if ($axx > 8) { echo "

Editer cet élément / Supprimer

"; } echo "
\n"; } echo "
"; } elseif($chemin[2] == "view" and !empty($chemin[3])) { $chemin[3] = preg_replace("/[^\w\-\_\.\!]/","",$chemin[3]); if(empty($chemin[4])) { echo "

Liste des Sous Categories disponibles

Vous trouverez dans cette rubrique differents programmes disponibles que nous vous proposons de telecharger via les site officiel.

"; $compteur=0; $ancien=""; $query = "SELECT scategorie FROM download WHERE categorie='$chemin[3]' ORDER BY scategorie ASC"; $result = mysql_query($query) or die(mysql_error()); $valeurs = array(); echo "
    "; while ($row = mysql_fetch_array($result)) { $nom = preg_replace("/-/"," ",$row[0]); if ($compteur != 0 && $ancien != $row[0]) { echo " ($compteur) \n"; } if ($ancien != $row[0]) { $ancien = $row[0]; $compteur=1; $nom = preg_replace("/-/"," ",$row[0]); echo "
  • $nom\n"; } else { $compteur++; } } if ($compteur != 0 ) { echo " ($compteur)
  • \n"; } echo "
"; } else { $chemin[4] = preg_replace("/[^\w\-\_\.\!]/","",$chemin[4]); $query = "SELECT * FROM download WHERE categorie='$chemin[3]' and scategorie='$chemin[4]' ORDER BY nom ASC"; $result = mysql_query($query) or die(mysql_error()); if (mysql_num_rows($result) ==0) { echo "

Erreur

Aucun element contenu dans cette categorie ($chemin[3])

"; } while ($row = mysql_fetch_array($result)) { echo "

$row[1] ($row[7])

Telecharger ($row[6]) sur $row[8]

"; $lignes = explode("\n",$row[5]); foreach($lignes as $key) { echo "

$key

\n"; } if ($axx > 8) { echo "

Editer cet element / Supprimer

"; } echo "
\n"; } } } elseif($chemin[2] == "new" and $axx > 4) { $nom = $_POST['nom']; $categorie = $_POST['categorie']; $scategorie = $_POST['scategorie']; if ($categorie == "autres") { $categorie = $_POST['categorie2']; } if ($scategorie == "autres") { $scategorie = $_POST['scategorie2']; } $description = $_POST['description']; $taille = $_POST['taille']; $softype = $_POST['softype']; $site = $_POST['site']; $download = $_POST['download']; if (!empty($nom) && !empty($categorie) && !empty($description) && !empty($taille) && !empty($softype) && !empty($site) && !empty($download)) { $query ="INSERT INTO download (nom,categorie,scategorie,description,taille,softype,site,download) VALUES ('".text2html($nom)."', '".text2html($categorie)."', '".text2html($scategorie)."', '".text2html($description)."', '".text2html($taille)."', '".text2html($softype)."', '".$site."', '".$download."')"; mysql_query($query) or die(mysql_error()."
$query"); echo "

AJOUTE AVEC SUCCES: categorie ".text2html($categorie)."

"; } else { echo "

Nouveau programme

Nom:
Categorie:
Si autre (sans accents):
Sous Categorie:
Si autre (sans accents):
Description:
Taille:
License:
Site:
Download:
"; } } elseif($chemin[2] == "edit" and $axx > 8) { if ($chemin[4] == "suppr") { $action = "Supprimer"; } else { $action = $_POST['action']; } $chemin[3] = preg_replace("[^0-9]","",$chemin[3]); $nom = $_POST['nom']; $categorie = $_POST['categorie']; if ($categorie == "autres") { $categorie = $_POST['categorie2']; } $description = $_POST['description']; $taille = $_POST['taille']; $softype = $_POST['softype']; $site = $_POST['site']; $download = $_POST['download']; if ($action == "Supprimer") { $query = "DELETE FROM download WHERE id='$chemin[3]'"; mysql_query($query) or die(mysql_error()."
$query"); echo "

Suppression

Suppression AVEC SUCCES

"; } else if (!empty($nom) && !empty($categorie) && !empty($description) && !empty($taille) && !empty($softype) && !empty($site) && !empty($download)) { $query ="UPDATE download SET nom='".text2html($nom)."', categorie='".text2html($categorie)."', description='".text2html($description)."', taille='".text2html($taille)."', softype='".text2html($softype)."', site='".$site."', download='".$download."' WHERE id ='$chemin[3]'"; mysql_query($query) or die(mysql_error()."
$query"); echo "

Modification

Modifie AVEC SUCCES de ".$categorie."

"; } else { echo "

Edition d'un programme (id $chemin[3])

"; $query = "SELECT * FROM download WHERE id='$chemin[3]'"; $result = mysql_query($query) or die(mysql_error()."
$query"); $row = mysql_fetch_array($result); if (!isset($row[0])) { die; } echo "
Nom:
Categorie:
Si autre:
Description:
Taille:
License:
Site:
Download:
"; } } ?>