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 68 69 70
| <?php require_once "PDO_connect.php";
$query="SELECT * FROM smartphone.abonnements";
try{
$prep = $bdd->prepare($query);
$prep->execute();
$resultats = $prep->fetchAll();
}catch(Exception $e){;
echo "Erreur ! ".$e->getMessage() ;
}
?>
<!DOCTYPE>
<html>
<head>
<title>Abonnement</title>
<link rel="stylesheet" type="text/css" href="Select.css">
<style>
</style>
<script type="text/javascript">
function dataTable()
$(document).ready(function() {
var table = $('#example').dataTable();
$('#example tbody').on( 'click', 'tr', function () {
if ( $(this).hasClass('selected') ) {
$(this).removeClass('selected');
}
}
);
$('.button').click( function () {
table.row('.selected').remove().draw( false );
} );
} );
</script>
</head>
<body>
<center>
<table id="#example" class="DataTable" >
<thead>
<tr>
<th>Operateur</th>
<th>SIM</th>
<th>PUK</th>
<th>Num ligne</th>
<th>Volume</th>
<th>Statut abo</th>
</tr>
</thead><tbody>
<?php
echo "<br>";
if(!empty($resultats)){
foreach ($resultats as $row) {
echo "<tr>";
echo "<td data-name=\"Operateur\">".$row["Operateur"]."</td>";
echo "<td data-name=\"Num_SIM\">".$row["Num_SIM"]."</td>";
echo "<td data-name=\"PUK\">".$row["PUK"]."</td>";
echo "<td data-name=\"Num_ligne\">".$row["Num_ligne"]."</td>";
echo "<td data-name=\"Volume\">".$row["Volume"]."</td>";
echo "<td data-name=\"Statut_abo\">".$row["Statut_abo"]."</td>";
echo "</tr>";
}
}else {
echo "Pas d'enregistrements dans cette table...";
}
?>
</tbody></table></center>
</body>
</html> |