1 2 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
|
<html>
<body>
<form name="insertion" method="post">
<?php
echo"<table class='tableau5' border:0.5px solid #000066 background-color:#FFCC33;padding:2px 2px 2px 2px;font-size:12px>";
print ("<th class='first' width = '5%' height='20%' align='center' style='background-color:#CCCCCC;color:#000;;font-size:13px; margin-left:5px;padding:2px 2px 2px 2px;'>");
print ("<th class='first' width = '10%' height='20%' align='center' style='background-color:#CCCCCC;color:#000;;font-size:13px; margin-left:5px;padding:2px 2px 2px 2px;'> Code Document");
print ("<th class='first' width = '65%' height='20%' align='centre' style='background-color:#CCCCCC;color:#000;font-size:13px;padding:2px 2px 2px 15px;'>URL");
$sqlEntr = mysql_query("SELECT * FROM document order by code_doc");
while ($T=mysql_fetch_array($sqlEntr))
{
echo"<tr>";echo"<th class='colone5' style='background-color:#E0E0E0; color:#000; height:20px; width:10px; text-align:left font-size:12px;font-family:Arial, Verdana, Helvetica, sans-serif; padding:0px 0px 0px 20px;'>"; print "<input type='checkbox' name='choisir'> ";echo"</th>";echo"<th class='colone5' style='background-color:#E0E0E0; color:#000; height:20px; width:50px; text-align:left font-size:12px;font-family:Arial, Verdana, Helvetica, sans-serif; padding:0px 0px 0px 20px;'>"; print "$T[code_doc]";echo"</th>";echo"<td class='deux1' style='background-color:#E4E4E4;font-size:12px;width:650px; height:20px; font-family:Arial, Verdana, Helvetica, sans-serif; padding:0px 0px 0px 10px;'>"; print "<a href='detail_index.php?No=.$T[code_doc].'>".$T["url"]."</a>" ; echo"</td>"; echo"</tr>";
if(isset($_POST["choisir"])) $choisir=$_POST["choisir"];
if(isset($_POST['submit']) && !isset($_POST["choisir"]))
{
echo ("");
}
}
echo"</table>";
?>
<input class="Supprimer" name="submit" style=" margin-left:-20px; " type="submit" value="Supprimer"/>
</form>
</body>
</html>
<?php
if(isset($_POST["choisir"]))
if(!empty ($choisir))
{
$sql="DELETE FROM document WHERE code_doc='$choisir' ";
//exécution de la requête SQL:
$requete = mysql_query($sql, $cnx) or die( mysql_error() ) ;
mysql_close();
//affichage des résultats, pour savoir si l'insertion a marchée:
if($requete)
{
echo ("supprimer");
echo("<META HTTP-equiv=\"refresh\" content=0;URL=formulaire.php>");
}
else
{
echo("L'insertion à échouée<br>") ;
}
}
?> |
Partager