| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
 100
 101
 102
 
 |  
<?php
 
connect();
 
 
 
	$sql = "SELECT MAX(id) FROM serv";
	$res = mysql_query($sql);
 
while($val = mysql_fetch_array($res))
	{
		$mx = $val['0'];
		$count = $mx;
	}
 
 
	$sql2 = "SELECT * FROM `serv` ORDER BY 'id' DESC";
	$res2 = mysql_query($sql2);
 
while($val2 = mysql_fetch_array($res2))
{
	$titre = $val2['titre'];
 
	$titre = str_replace("\r\n",'<BR/>',$titre);
	$titre = str_replace("::",'</p><div align ="center"><img src="custompics/',$titre);
	$titre = str_replace(":w:",'" width="',$titre);
	$titre = str_replace(":h:",'" height="',$titre);
	$titre = str_replace(":/:",'" onContextMenu = "return false" onMouseDown = "return false"></div><BR/><p>',$titre);
	$titre = str_replace("à",'à',$titre);
	$titre = str_replace("â",'â',$titre);
	$titre = str_replace("ä",'ä',$titre);
	$titre = str_replace("é",'é',$titre);
	$titre = str_replace("è",'è',$titre);
	$titre = str_replace("ê",'ê',$titre);
	$titre = str_replace("ë",'ë',$titre);
	$titre = str_replace("ï",'ï',$titre);
	$titre = str_replace("î",'î',$titre);
	$titre = str_replace("ö",'ö',$titre);
	$titre = str_replace("ô",'ô',$titre);
	$titre = str_replace("û",'û',$titre);
	$titre = str_replace("ü",'ü',$titre);
	$titre = str_replace("ù",'ù',$titre);
	$titre = str_replace("Â",'Â',$titre);
	$titre = str_replace("Ä",'Ä',$titre);
	$titre = str_replace("Ê",'Ê',$titre);
	$titre = str_replace("Ë",'Ë',$titre);
	$titre = str_replace("Ï",'Ï',$titre);
	$titre = str_replace("Î",'Î',$titre);
	$titre = str_replace("Ö",'Ö',$titre);
	$titre = str_replace("Ô",'Ô',$titre);
	$titre = str_replace("Û",'Û',$titre);
	$titre = str_replace("Ü",'Ü',$titre);
 
	echo "<p><a href=\"editserv.php?srv=".$mx."&nc=".$nc."&sid=".$sid."\">".$titre."</a></p>";
 
 
 
	$mx -= 1;
 
	$sql3 = "SELECT * FROM `serv` WHERE id = ".$mx;
	$res3 = mysql_query($sql3);
 
 
 
	$tst = mysql_num_rows($res3);
 
	$sql5 = "SELECT MIN(id) FROM serv";
	$res5 = mysql_query($sql5);
 
	while($val5 = mysql_fetch_array($res5))
	{
		$mn = $val5['0'];
	}
 
	if ($mx > $mn)
	{
 
		while ($tst == 0) 
		{
 
			$mx -= 1;
 
			$sql4 = "SELECT * FROM `serv` WHERE id = ".$mx;
			$res4 = mysql_query($sql4);
			$tst = mysql_num_rows($res4);
 
		}
	}
}
 
	 mysql_close();
 
if ($count == 0) 
{
	echo "<p>Aucun article à éditer</p>";
}
 
 
echo "<BR><BR><p align =\"center\"><a href = \"createserv.php?nc=".$nc."&sid=".$sid."\" >Créer un article</a></p>";
piedAdmin();
?> | 
Partager