Code : Tout sélectionner
<script language="javascript">
function conf(id)
{
var oui = confirm('Ok pour valider cette tache - Cancel pour la dévalider');
if(oui == true)
{
document.getElementById(id).style.color='#000000';
document.getElementById(id).style.background='#3CB371';
}
if(oui == false)
{
document.getElementById(id).style.color='#000000';
document.getElementById(id).style.background='#FFA07A';
}
}
</script>
mysql_select_db("arnis01");
$str_requete = "SELECT tache FROM liste WHERE periodicite='Daily'";
$o_result = mysql_query($str_requete) or die( 'Erreur SQL !<br>'.$sql.'<br>'.mysql_error()); ;
while ($a_result = mysql_fetch_array($o_result)) {
echo "<b>".$a_result["tache"]."</b>";
for($i = 1; $i <= 12; $i++){
echo '<input type="button" style="width:27px; background-color: #FFA07A;" id="mon_id'.$i.'" onclick="conf(\'mon_id'.$i.'\');" value="'.$i.'" />';
}
}
Merci[/code]