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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
|
<form name="userTable" id="table">
<input type="text" data-type="search" id="filterable-input">
<table id="table" data-role="table" data-mode="columntoggle" class="ui-responsive table-stroke" data-filter="true" data-input="#filterable-input" class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th id="Nom" name="nom[]">Nom</th>
<th id="Prénom" name="prenom[]">Prénom</th>
<th data-priority="5" id="Mail[]">Mail</th>
<th data-priority="5" id="Pays[]">Pays</th>
<th data-priority="5" id="Civilité[]">Civilité</th>
<th data-priority="5" id="Naissance[]">Naissance</th>
<th data-priority="5" id="Inscription[]">Inscription</th>
<th data-priority="5" id="Profession[]">Profession</th>
</tr>
</thead>
<tbody>
<?php
for ($i=0;$i<count($u);$i++)
{
?>
<tr>
<td><?php print $u[$i]->get_nom();?></td>
<td><?php print $u[$i]->get_prenom();?></td>
<td><?php print $u[$i]->get_email();?></td>
<td><?php print $u[$i]->get_pays();?></td>
<td><?php print $u[$i]->get_civilite();?></td>
<td><?php print $u[$i]->get_date_n();?></td>
<td><?php print $u[$i]->get_date_ins();?></td>
<td><?php print $u[$i]->get_profession(); ?></td>
</tr>
<?php } ?>
<tr><td><button type="button" class="btn btn-success" id="save">Enregistrer</button></td></tr>
<input type="text" name="SegmentName" placeholder="nom du segment" width="50px">
</tbody>
</table>
</form>
<script>
$(document).ready(function(){
$('#save').click(function(){
var rowsArray = {};
var i = 0;
$('#table tr').each(function({
rowsArray[i] = $(this).val(); // if you want to save the values of each row
i++;
$.ajax({
url: "SaveSegment.php",
method: "POST",
//data:$('#userTable').serialize(),
data: { myarray : rowsArray },
success: function(result) {
alert(data)
$('#result').html(data);
}
});
});
});
});
</script> |
Partager