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 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92
| <?php
// connexion
include_once("db_connection.php");
$tableau=array();
$sql = "SELECT *
FROM base1";
$requete = mysql_query($sql);
$requete2="select * from menu1 where menu='1'" ;
$resultat3=mysql_query($requete2) or die(mysql_error());
$tableau1= mysql_result ($resultat3,0);
$tableau2= mysql_result ($resultat3,1);
$tableau3= mysql_result ($resultat3,2);
$tableau4= mysql_result ($resultat3,3);
$tableau5= mysql_result ($resultat3,4);
$tableau6= mysql_result ($resultat3,5);
$tableau7=mysql_result ($resultat3,6);
$tableau8 =mysql_result ($resultat3,8);
$tableau10=mysql_result ($resultat3,9);
$tableau11=mysql_result ($resultat3,10);
for ($i=0; $i<$tableau;$i++)
{
$tableau($i)=mysql_result($resultat3, $i);
}
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="Parc_Transformateur.css" />
<script class="jsbin" src="/release-builds/jquery.datatables.1.9.1.js"></script>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel= "stylesheet" href="media/css/demo_page.css"/>
<link rel= "stylesheet" href="media/css/demo_table.css"/>
<script type="text/javascript" language="javascript" src="media/js/jquery.js"></script>
<script type="text/javascript" language="javascript" src="media/js/jquery.dataTables.min.js"></script>
<script type="text/javascript" language="javascript" src="media/js/jquery.dataTables.js"></script>
<meta charset="utf-8" />
<?php include_once("menu_admin.php"); ?>
<title> </title>
</head>
<body id="dt_example">
<!-- tableau -->
<div align="center" >
<table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
<thead>
<tr >
<th >Identifiant</th>
<th >Marque</th>
<th >Réalisation</th>
</tr>
</thead>
<tbody>
<?php //affichage des données:
while( $result = mysql_fetch_array( $requete ) )
{
?>
<tr style="background-color: #e5eeff" style="text-align: center;">
<td><?php echo $result['name']; ?></td>
<td><?php echo $result['extension']; ?></td>
<td><?php echo '<select name="menu">';
if(tableau($i) !="")
{
foreach ($tableau as $element)
?>
<option value ="<?php $tableau['$i']; ?>"> <?php echo $tablea['$i']; ?></option>
<?php
}
echo '</select>'; ?>
</td>
</tr>
<?php
}
?>
<tbody>
</table>
</div>
</body>
<script type="text/javascript">
/*
* Example init
*/
$(document).ready(function(){
$('#example').dataTable();
});
</script>
</body>
</html> |
Partager