Message confirmation javascript
Fermé
mjs21
Messages postés
15
Date d'inscription
mardi 27 mai 2008
Statut
Membre
Dernière intervention
17 juin 2008
-
6 juin 2008 à 13:31
Jhym - 6 juin 2008 à 14:16
Jhym - 6 juin 2008 à 14:16
A voir également:
- Message confirmation javascript
- Recuperer message whatsapp - Guide
- Confirmation de lecture whatsapp - Guide
- Message d'absence thunderbird - Guide
- Telecharger javascript - Télécharger - Langages
- Confirmation de lecture gmail - Guide
1 réponse
J'essaierais un truc du style
while($row = mysql_fetch_array($result))
{
$select = mysql_query("SELECT COUNT(num_mat) FROM MATERIEL, TYPE WHERE TYPE.num_type = MATERIEL.num_type AND MATERIEL.num_type = $row['num_type']",$connexion);
$boolAssoc = false;
if ($select > 0)
{
$boolAssoc = true;
}
echo '<tr>';
echo '<td bgcolor="#CCCCCC">'.$row["lib_type"].'</td>';
echo '<td bgcolor="#CCCCCC"><a href="modif_type.php?num='.$row['num_type'].'"><img src="img/modification.PNG"/></a></td>';
echo '<td bgcolor="#CCCCCC"><a href="#" onClick="SuppType($boolAssoc,$row['num_type']); return false;"><img src="img/supprimer.png"/></a></td>';
echo '</tr>'."\n";
}
echo '
<script language="javascript">
function SuppType(bool,num)
{
if (confirm('Attention, ce type est associé à du matériel.\nVoulez-vous le supprimer ?'))
{
document.location = 'modif_type.php?numsupp=' + num;
}
}
</script>
';
while($row = mysql_fetch_array($result))
{
$select = mysql_query("SELECT COUNT(num_mat) FROM MATERIEL, TYPE WHERE TYPE.num_type = MATERIEL.num_type AND MATERIEL.num_type = $row['num_type']",$connexion);
$boolAssoc = false;
if ($select > 0)
{
$boolAssoc = true;
}
echo '<tr>';
echo '<td bgcolor="#CCCCCC">'.$row["lib_type"].'</td>';
echo '<td bgcolor="#CCCCCC"><a href="modif_type.php?num='.$row['num_type'].'"><img src="img/modification.PNG"/></a></td>';
echo '<td bgcolor="#CCCCCC"><a href="#" onClick="SuppType($boolAssoc,$row['num_type']); return false;"><img src="img/supprimer.png"/></a></td>';
echo '</tr>'."\n";
}
echo '
<script language="javascript">
function SuppType(bool,num)
{
if (confirm('Attention, ce type est associé à du matériel.\nVoulez-vous le supprimer ?'))
{
document.location = 'modif_type.php?numsupp=' + num;
}
}
</script>
';
6 juin 2008 à 14:05
J'essaye et je te tiens au courant :)
6 juin 2008 à 14:16
Ca donnerait plutot :
while($row = mysql_fetch_array($result))
{
$select = mysql_query("SELECT COUNT(num_mat) FROM MATERIEL, TYPE WHERE TYPE.num_type = MATERIEL.num_type AND MATERIEL.num_type = $row['num_type']",$connexion);
$boolAssoc = false;
if ($select > 0)
{
$boolAssoc = true;
}
echo '<tr>';
echo '<td bgcolor="#CCCCCC">'.$row["lib_type"].'</td>';
echo '<td bgcolor="#CCCCCC"><a href="modif_type.php?num='.$row['num_type'].'"><img src="img/modification.PNG"/></a></td>';
echo '<td bgcolor="#CCCCCC"><a href="#" onClick="SuppType($boolAssoc,$row['num_type']); return false;"><img src="img/supprimer.png"/></a></td>';
echo '</tr>'."\n";
}
echo '
<script language="javascript">
function SuppType(bool,num)
{
if (bool)
{
msg= 'Attention, ce type est associé à du matériel.\nVoulez-vous le supprimer ?';
}
else
{
msg='Voulez-vous supprimer ce type ?';
}
if (confirm(msg))
{
document.location = 'modif_type.php?numsupp=' + num;
}
}
</script>
';