Je débute en Php, php jquery Mysql
Je tente de realiser une petite application en Php (en utilisant jquery datatable) afin de gerer une liste d'employes mais je n'arrive pas obtenir ce que je veux avec ma page "liste_emplyes" dont voici le code :
Sur le serveur, j'ai un dossier qui contient les dossiers (js, images, css, admin) et dans le dossier js j'ai
jquery-1.8.0.min.js
jquery.dataTables.js
jquery-ui-1.8.23.custom.min.js
Code : Tout sélectionner
<?php require_once('Connections/ma_connection.php'); ?>
<?php require_once('security.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
mysql_select_db($database_ma_connection, $ma_connection);
$query_RsListe = "SELECT * FROM employes2";
$RsListe = mysql_query($query_RsListe, $ma_connection) or die(mysql_error());
$row_RsListe = mysql_fetch_assoc($RsListe);
$totalRows_RsListe = mysql_num_rows($RsListe);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Liste des employés</title>
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/style.css" rel="stylesheet" type="text/css" />
<link href="../css/cupertino/jquery-ui-1.8.23.custom.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-1.8.0.min.js"></script>
<script type="text/javascript" src="../js/jquery.dataTables.js"></script>
<script type="text/javascript" src="../js/jquery-ui-1.8.23.custom.min.js"></script>
<script type="text/javascript" charset="utf-8">
var oTable;
$(document).ready(function() {
$Table = $('#menuTable').dataTable({
"bJQueryUI": true,
"sPaginationType": "full_numbers",
"oLanguage": { "sUrl": "../js/fr_FR.txt" },
"bAutoWidth": false,
"aoColumnDefs": [
{ "asSorting": [ "desc" ], "aTargets": [ 0 ] }
]
});
});
</script>
</head>
<body>
<div id="wrapper">
<div id="header"><span>ADMINISTRATION DES EMPLOYES</span></div>
<div id="navigation">
<a href="liste_employes.php">Liste des employés</a> | <a href="ajout_employes.php">Ajouter un employés</a> | <a href="logout.php">Déconnexion</a>
</div>
<div id="container">
<p id="ptitle">Liste des employés</p>
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="display" id="menuTable">
<thead>
<tr>
<th>ID</th>
<th>Matricule</th>
<th>Nom</th>
<th>Service</th>
<th>Poste</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<tr>
<?php do { ?>
<td><?php echo $row_RsListe['id']; ?></td>
<td><?php echo $row_RsListe['MAT']; ?></td>
<td><?php echo $row_RsListe['NOM']; ?></td>
<td><?php echo $row_RsListe['SRV']; ?></td>
<td><?php echo $row_RsListe['POSTE']; ?></td>
<td align="center"><img src="../images/edit.gif" width="16" height="16" alt="Edition" /> <img src="../images/delete.gif" width="16" height="16" alt="Supprimer" /></td>
<?php } while ($row_RsListe = mysql_fetch_assoc($RsListe)); ?>
</tr>
</tbody>
<tfoot>
<tr><th colspan="6"> </th></tr>
</tfoot>
</table>
</div>
<div id="footer">
<p>développement</p>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($RsListe);
?>
Quelqu'un aurait il une idée, une remarque ? SVP Merci
Bonne journée
Raphael