<option value="on"<? if($data['type'] == "on"){ echo " selected"; } ?>>On</option> <option value="on_off"<? if($data['type'] == "on_off"){ echo " selected"; } ?>>On - Off</option> <option value="dim"<? if($data['type'] == "dim"){ echo " selected"; } ?>>Dimable</option> <option value="rgb"<? if($data['type'] == "rgb"){ echo " selected"; } ?>>RGB</option> </select></td> <td><INPUT TYPE="number" NAME="left" VALUE="<? echo $data['left']; ?>" style="width:60px;"/></td> <td><INPUT TYPE="number" NAME="top" VALUE="<? echo $data['top']; ?>" style="width:60px;"/></td> <td class="icone"><center><INPUT type="checkbox" name="icone" value="1"<? if($data['icone'] == "1"){ echo " checked"; } ?>/></center></td> <td class="icone"><center><INPUT type="checkbox" name="texte" value="1"<? if($data['texte'] == "1"){ echo " checked"; } ?>/></center></td> <td><center><INPUT type="checkbox" name="gerer_batterie" value="1"<? if($data['gerer_batterie'] == "1"){ echo " checked"; } ?>/></center></td> <td><center><input type="number" name="ordre" value="<? echo $data['ordre']; ?>" style="width:50px;"></input></center></td> <td> <INPUT id="date_chgt_batterie_<? echo $data['nom']; ?>" type="date" name="date_chgt_batterie" size="10"/> <script> if (!Modernizr.inputtypes['date']) { document.getElementById('date_chgt_batterie_<? echo $data["nom"]; ?>').value = "<? echo date_francais($data['date_chgt_batterie']); ?>"; } else { document.getElementById('date_chgt_batterie_<? echo $data["nom"]; ?>').value = "<? echo $data['date_chgt_batterie']; ?>"; } </script> </td> <td><INPUT type="texte" name="libelle" value="<? echo $data['libelle']; ?>"></td> <td><input type="number" name="conso" value="<? echo $data['conso']; ?>" style="width:60px;"/></td> <td class="input"><center><INPUT TYPE="HIDDEN" NAME="id" VALUE="<? echo $data['nom']; ?>"> <INPUT TYPE="SUBMIT" NAME="Valider" VALUE="Valider"></center></td> </FORM> <td class="input"> <center> <button onclick='javascript:askConfirmDeletion("./index.php?page=administration&detail=affecter_actioneur&Supprimer=Supprimer&id=<? echo $data['id']; ?>")'>Supprimer</button>
$req = mysql_query($query, $link) or die('Erreur SQL !<br>' . $sql . '<br>' . mysql_error()); while ($periph = mysql_fetch_assoc($req)) { if ($periph['batterie'] == 0) { $batterie = "<img src='./img/batterie_ok.png' height='20px'/>"; } else { $batterie = "<img src='./img/batterie_ko.png' height='20px'/>"; } if ($periph['libelle'] == "") { $nom = $periph['nom']; } else { $nom = $periph['libelle']; } echo "<TR class=tab-ligne bgcolor='" . ($i % 2 == 1 ? '#dddddd' : '#eeeeee') . "'>"; $i++; echo "<TD>" . $batterie . "</TD>"; echo "<TD><span style='vertical-align:3px'>" . $nom . "</span></TD>"; if ($periph['date_chgt_batterie'] != "0000-00-00") { echo "<TD style='text-align: center;'>" . date_francais($periph['date_chgt_batterie']) . "</TD>"; } else { echo "<TD></TD>"; } if ($periph['alerte_batterie'] != "0000-00-00 00:00:00") { echo "<TD style='text-align: center;'>" . date_simplifiee($periph['alerte_batterie']) . "</TD>"; } else { echo "<TD></TD>"; } echo "</TR>"; } ?> </TABLE></CENTER>