suppression

Répondre


Cette question est un moyen d’empêcher des soumissions automatisées de formulaires par des robots.
Smileys
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :!: :?: :idea: :arrow: :| :mrgreen: =D> #-o =P~ :^o :non: :priere: 8-|
Voir plus de smileys
  Revue du sujet
 

  Étendre la vue Revue du sujet : suppression

Re: suppression

par Aureusms » 14 août 2014, 12:08

Toytoy a raison c'est illisible...
Sinon regarde vers la commande javascript confirm().

Re: suppression

par toytoy » 13 août 2014, 22:00

utilise les balises php on voit rien là, ensuite la portion utile du code aussi, car tu nous parle de suppression mais de quoi ? Explique nous un peu le but de ton script :)

suppression

par sambael » 13 août 2014, 21:33

bonjour j'aimerai quand je cique sur supprimer qu'il m'affiche un message de ce genre "Voulez-vous vraiment supprimer ?" et voila mon code

<?php require_once('Connections/connexion.php'); ?>
<?php
$row['num_ordre']="";
$row['date_correspondance']="";
$row['destinataire']="";
$row['objet']="";
$row['num_reponse']="";
$row['observations']="";
$row['id_destinataire']="";
$row['id_dossier']="";
$row['id_fournisseur']="";
?>

<?php
//initialize the session
if (!isset($_SESSION)) {
session_start();
}

// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
$_SESSION['MM_Username'] = NULL;
$_SESSION['MM_UserGroup'] = NULL;
$_SESSION['PrevUrl'] = NULL;
unset($_SESSION['MM_Username']);
unset($_SESSION['MM_UserGroup']);
unset($_SESSION['PrevUrl']);

$logoutGoTo = "index.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
if (!isset($_SESSION)) {
session_start();
}
$MM_authorizedUsers = "administrateur";
$MM_donotCheckaccess = "false";

// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;

// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && false) {
$isValid = true;
}
}
return $isValid;
}

$MM_restrictGoTo = "limite.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}

if ((isset($_GET['sup'])) && ($_GET['sup'] != "")) {
$deleteSQL = sprintf("DELETE FROM depart WHERE Id_depart=%s",
GetSQLValueString($_GET['sup'], "int"));

mysql_select_db($database_connexion, $connexion);
$Result1 = mysql_query($deleteSQL, $connexion) or die(mysql_error());
}

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_insert"])) ) {
$insertSQL = sprintf("INSERT INTO depart (num_ordre, date_correspondance, destinataire, objet, num_reponse, observations, id_dossier, id_destinataire, id_fournisseur) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['num_ordre'], "text"),
GetSQLValueString($_POST['date_correspondance'], "text"),
GetSQLValueString($_POST['destinataire'], "text"),
GetSQLValueString($_POST['objet'], "text"),
GetSQLValueString($_POST['num_reponse'], "text"),
GetSQLValueString($_POST['observations'], "text"),
GetSQLValueString($_POST['id_dossier'], "text"),
GetSQLValueString($_POST['id_destinataire'], "text"),
GetSQLValueString($_POST['id_fournisseur'], "text")
);

mysql_select_db($database_connexion, $connexion);
$Result1 = mysql_query($insertSQL, $connexion) or die(mysql_error());
}
if ((isset($_GET["rama"])) && ($_GET["rama"] == "fatou")) {
$id=$_GET['id'];
{
mysql_select_db($database_connexion, $connexion);
$query_Recordset1 = "SELECT * FROM depart WHERE Id_depart=".$id;
$Recordset1 = mysql_query($query_Recordset1, $connexion) or die(mysql_error());
$row = mysql_fetch_assoc($Recordset1);
$adresse=$row['num_ordre'];
$email=$row['date_correspondance'];
$tel=$row['destinataire'];
$num=$row['objet'];
$destinataire=$row['num_reponse'];
$ninea=$row['observations'];
$domaine=$row['id_destinataire'];
$Nom=$row['id_dossier'];
$fourn=$row['id_fournisseur'];

if ((isset($_POST["MM_update"]))) {
$updateSQL = sprintf("UPDATE depart SET num_ordre=%s, date_correspondance=%s, destinataire=%s, objet=%s, num_reponse=%s, observations=%s, id_destinataire=%s, id_dossier=%s, id_fournisseur=%s WHERE num_ordre=%s",
GetSQLValueString($_POST['num_ordre'], "text"),
GetSQLValueString($_POST['date_correspondance'], "text"),
GetSQLValueString($_POST['destinataire'], "text"),
GetSQLValueString($_POST['objet'], "text"),
GetSQLValueString($_POST['num_reponse'], "text"),
GetSQLValueString($_POST['observations'], "text"),
GetSQLValueString($_POST['id_dossier'], "text"),
GetSQLValueString($_POST['id_destinataire'], "text"),
GetSQLValueString($_POST['id_fournisseur'], "text"));
mysql_select_db($database_connexion, $connexion);
$Result1 = mysql_query($updateSQL, $connexion) or die(mysql_error());
}
}
}

$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;

mysql_select_db($database_connexion, $connexion);
$query_Recordset1 = "SELECT *,a.Id_depart FROM depart a, destinataire d, dossier s, fournisseur f WHERE a.id_dossier=s.id_dossier AND a.id_destinataire=d.Id_Destination AND a.id_fournisseur=f.Id_fournisseur";
$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $connexion) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1)-1;

mysql_select_db($database_connexion, $connexion);
$query_Recordset2 = "SELECT * FROM dossier";
$Recordset2 = mysql_query($query_Recordset2, $connexion) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);

mysql_select_db($database_connexion, $connexion);
$query_Recordset3 = "SELECT * FROM destinataire";
$Recordset3 = mysql_query($query_Recordset3, $connexion) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);

mysql_select_db($database_connexion, $connexion);
$query_Recordset4 = "SELECT * FROM fournisseur";
$Recordset4 = mysql_query($query_Recordset4, $connexion) or die(mysql_error());
$row_Recordset4 = mysql_fetch_assoc($Recordset4);
$totalRows_Recordset4 = mysql_num_rows($Recordset4);



?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>DEPART</title>
<style type="text/css">
<!--
.Style1 {
font-size: 12px;
font-style: italic;
color: #666666;
}
a {
text-decoration: none;
color: #333333;
display: block;
}
-->
</style>
</head>

<body>
<center><table width="1000" border="0" cellpadding="0" cellspacing="0" bgcolor="#999999">
<!--DWLayoutTable-->
<tr>
<td width="12" height="7"></td>
<td width="978"></td>
<td width="10"></td>
</tr>
<tr>
<td height="497"></td>
<td valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<!--DWLayoutTable-->
<tr>
<td width="3" height="24"></td>
<td width="9">&nbsp;</td>
<td colspan="5" valign="top"><?php include "entete.php";?></td>
<td width="9">&nbsp;</td>
</tr>

<tr>
<td height="20"></td>
<td>&nbsp;</td>
<td width="357">&nbsp;</td>
<td width="419">&nbsp;</td>
<td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="170" height="20" align="right" valign="top"><a href="<?php echo $logoutAction ?>">D&eacute;connexion</a></td>
</tr>
</table> </td>
<td width="122"></td>
<td></td>
</tr>
<tr>
<td height="24"></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td width="14">&nbsp;</td>
<td width="68">&nbsp;</td>
<td></td>
<td></td>
</tr>
<tr>
<td height="34"></td>
<td colspan="2" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#999999">
<!--DWLayoutTable-->
<tr>
<td width="3" height="3"></td>
<td width="179"></td>
<td width="4"></td>
<td width="171"></td>
<td width="9"></td>
</tr>
<tr>
<td height="28"></td>
<td align="center" valign="middle" bgcolor="#FFFFFF"><a href="accueil.php"><strong>ACCUEIL</strong></a></td>
<td>&nbsp;</td>
<td align="center" valign="middle" bgcolor="#FFFFFF"><a href="arrivee.php"><strong>DEPART</strong></a></td>
<td></td>
</tr>
<tr>
<td height="3"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>








</table></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td></td>
<td></td>
</tr>



<tr>
<td height="323"></td>
<td colspan="4" valign="top">&nbsp;
<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td nowrap="nowrap" align="right">Dossier:</td>
<td><label>
<select name="id_dossier" id="id_dossier">
<option>Choisir un dossier</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset2['id_dossier']?>"><?php echo $row_Recordset2['num_dossier']?></option>
<?php
} while ($row_Recordset2 = mysql_fetch_assoc($Recordset2));
$rows = mysql_num_rows($Recordset2);
if($rows > 0) {
mysql_data_seek($Recordset2, 0);
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
}
?>
</select>
</label></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Destinataire:</td>
<td><label>
<select name="id_destinataire" id="id_destinataire">
<option>Choisir un destinataire</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset3['Id_Destination']?>"><?php echo $row_Recordset3['Nom_Destination']?></option>
<?php
} while ($row_Recordset3 = mysql_fetch_assoc($Recordset3));
$rows = mysql_num_rows($Recordset3);
if($rows > 0) {
mysql_data_seek($Recordset3, 0);
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
}
?>
</select>
</label></td>
</tr>
<tr valign="baseline">
<td nowrap="nowrap" align="right">Fournisseur:</td>
<td><label>
<select name="id_fournisseur" id="id_fournisseur">
<option>Choisir un fournisseur</option>
<?php
do {
?>
<option value="<?php echo $row_Recordset4['Id_fournisseur']?>"><?php echo $row_Recordset4['Nom_fournisseur']?></option>
<?php
} while ($row_Recordset4 = mysql_fetch_assoc($Recordset4));
$rows = mysql_num_rows($Recordset4);
if($rows > 0) {
mysql_data_seek($Recordset4, 0);
$row_Recordset4 = mysql_fetch_assoc($Recordset4);
}
?>
</select>
</label></td>
</tr>

<tr valign="baseline">
<td nowrap align="right">num_ordre:</td>
<td><input type="text" name="num_ordre" value="<?php echo $row['num_ordre']; ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">date_correspondance:</td>
<td><input type="text" name="date_correspondance" value="<?php echo $row['date_correspondance']; ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">destinataire:</td>
<td><input type="text" name="destinataire" value="<?php echo $row['destinataire']; ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">objet:</td>
<td><input type="text" name="objet" value="<?php echo $row['objet']; ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">num_reponse:</td>
<td><input type="text" name="num_reponse" value="<?php $row['num_reponse']; ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">observations:</td>
<td><input type="text" name="observations" value="<?php echo $row['observations']; ?>" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">&nbsp;</td>
<td><input type="submit" value="Insérer">
<label>
<input type="submit" name="MM_update" value="Modifier" />
</label>
<label>
<input type="submit" name="Submit2" value="annuler" />
</label> </td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>

</table></td>
<td>&nbsp;</td>
<td></td>
</tr>



<tr>
<td height="92"></td>
<td colspan="3" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="960" height="48" align="center">&nbsp;
<table border="0">
<tr bgcolor="#FFFFFF">
<td><div align="center"><span class="Style4">Id_depart</span></div></td>
<td><div align="center"><span class="Style4">num_ordre</span></div></td>
<td><div align="center"><span class="Style4">date_correspondance</span></div></td>
<td><div align="center"><span class="Style4">destinataire</span></div></td>
<td><div align="center"><span class="Style4">objet</span></div></td>
<td><div align="center"><span class="Style4">num_reponse</span></div></td>
<td><div align="center"><span class="Style4">observations</span></div></td>
<td><div align="center"><span class="Style4">Dossier</span></div></td>
<td><div align="center"><span class="Style4">Destinataire</span></div></td>
<td><div align="center"><span class="Style4">Fournisseur</span></div></td>
<td>Edit</td>
<td>Supp</td>
</tr>
<?php do { ?>
<tr>
<td><?php echo $row_Recordset1['Id_depart']; ?></td>
<td><?php echo $row_Recordset1['num_ordre']; ?></td>
<td><?php echo $row_Recordset1['date_correspondance']; ?></td>
<td><?php echo $row_Recordset1['destinataire']; ?></td>
<td><?php echo $row_Recordset1['objet']; ?></td>
<td><?php echo $row_Recordset1['num_reponse']; ?></td>
<td><?php echo $row_Recordset1['observations']; ?></td>
<td><?php echo $row_Recordset1['num_dossier']; ?></td>
<td><?php echo $row_Recordset1['Nom_Destination']; ?></td>
<td><?php echo $row_Recordset1['Nom_fournisseur']; ?></td>
<td><div align="center"><a href="depart.php?rama=fatou&id=<?php echo $row_Recordset1['Id_depart']; ?>"><img src="imges/edit.png" width="13" height="15" border="0" /></a></div></td>
<td><div align="center"><a href="depart.php?sup=<?php echo $row_Recordset1['Id_depart']; ?>"><img src="imges/corbeil.png" width="13" height="15" border="0" /></a></div></td>
</tr>

<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<table width="44%" border="0" align="center" bgcolor="#CCCCCC">
<!--DWLayoutTable-->
<tr>
<td width="262"></td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>"><img src="First.gif" border=0></a>
<?php } // Show if not first page ?> </td>
<td width="31%" align="center"><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>"><img src="Previous.gif" border=0></a>
<?php } // Show if not first page ?> </td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>"><img src="Next.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
<td width="23%" align="center"><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>"><img src="Last.gif" border=0></a>
<?php } // Show if not last page ?>
</td>
</tr>
</table>
<p>&nbsp;
Enregistrements <?php echo ($startRow_Recordset1 + 1) ?> &agrave; <?php echo min($startRow_Recordset1 + $maxRows_Recordset1, $totalRows_Recordset1) ?> sur <?php echo $totalRows_Recordset1 ?></p>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="978" height="19" align="center" valign="middle"><span class="Style1">&copy; 2014 CHNU FANN /CONCEPTION BY PROMO 6 SID:UADB</span></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
<?php
mysql_free_result($Recordset1);

mysql_free_result($Recordset2);

mysql_free_result($Recordset3);

mysql_free_result($Recordset4);

?>