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
| <tr>
<td class="texte alignement_haut">Téléphone</td>
<td>
<!--Template js dynamique!-->
<textarea style="display:none" id="template-telephone">
<tr class="ligne-telephone">
<td class="texte"><input name="telephone[{0}]" type="text" id="telephone[{0}]" class="champs_description"/> <img align="absmiddle" id="add-telephone" border="0" title="Ajouter" alt="Ajouter" src="images/plus.png"></td>
</tr>
</textarea>
<!--Affichage entete tableau !-->
<table id="ligne-telephone" width="100%">
<!--<thead>
<tr>
<td class="texte"><img align="absmiddle" id="add-telephone" border="0" title="Ajouter" alt="Ajouter" src="images/plus.png"></td>
</tr>
</thead>!-->
<tbody>
<?
$i=1;
/* if($id!=0)
{ //Boucle de l'existant
$sql = "SELECT * FROM vendeur_informations WHERE id_vendeur=".$id." AND id_type_information='5' ORDER BY id ASC";
$res = mysql_query($sql);
while($data_vendeur_informations = @mysql_fetch_array($res))
{
echo('<tr class="ligne-telephone">
<td class="texte">
<input name="telephone['.$i.']" type="text" class="champs_description" id="telephone['.$i.']" value="'.numtel($data_vendeur_informations['valeur']).'"></td></tr>');
$i++;
}
}*/
echo('<script>
$(document).ready(function() {
//Affichage ligne supplementaire telephone
var templatetelephone = jQuery.format($("#template-telephone").val());
function addRowtelephone() {
$(templatetelephone(i++)).appendTo("#ligne-telephone tbody");
}');
echo('var i = '.$i.';');
if($i==1)
echo('addRowtelephone();');
// add more rows on click
echo('$("#add-telephone").click(addRowtelephone);
});
</script>');
?>
</table></td>
</tr> |