Bonjour tous le monde. Après plusieurs tentatives, je n'arrive plus à mettre ma table de base de données oracle dans une grille réaliser avec jquery inspirer des modeles de jquery DataGrid, j'arrive tous de même à me connecter à ma base orale avec une page PHP, j'utilise WampServer pour l'acces et l’exécution de mes pages PHP et HTML.
Voici le code utiliser :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
// Connexion au service XE (i.e. la base de données) sur la machine "localhost"
$conn = oci_connect('****', '*****', 'localhost/XE');
if (!$conn) {
    $e = oci_error();
    trigger_error(htmlentities($e['message'], ENT_QUOTES), E_USER_ERROR);
}
?>
<html>
<head>
    <meta charset="UTF-8">
    <title>Ecriture Comptable</title>
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/icon.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/themes/color.css">
    <link rel="stylesheet" type="text/css" href="http://www.jeasyui.com/easyui/demo/demo.css">
    <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.min.js"></script>
    <script type="text/javascript" src="http://www.jeasyui.com/easyui/jquery.easyui.min.js"></script>
</head>
<body>
    <h2><i>Liste de la Journée Comptable</i></h2>
    <div style="margin:20px 0;"></div>
    <div class="easyui-panel" style="width:60%;max-width:320px;padding:5px 15px;">
            <label class="label-top">Selectionner la date:</label>
            <input class="easyui-datebox" data-options="formatter:myformatter,parser:myparser"></input>
	<script type="text/javascript">
		function myformatter(date){
            var d = date.getDate();
            var m = date.getMonth()+1;
			var y = date.getFullYear();
			return (d<10?('0'+d):d)+'/'+(m<10?('0'+m):m)+'/'+y;
		}
		function myparser(s){
			if (!s) return new Date();
			var ss = (s.split('/'));
			var d = parseInt(ss[0],10);
            var m = parseInt(ss[1],10);
			var y = parseInt(ss[2],10);
			if (!isNaN(y) && !isNaN(m) && !isNaN(d)){
				return new Date(y,m-1,d);
			} else {
				return new Date();
			}
		}
	</script>
 
        <a href="#testclic" class="easyui-linkbutton" data-options="iconCls:'icon-search'" style="width:100px"></a>
          <script>
                        $("#testclic").click( function(#testclic)
           {
             <#testclic>;
           }
        );
     	</script>
 
 
        </div>
    </div>
 
    <table id="dg" title="Journée Comptable" style="width:800px;height:200px" data-options="
                rownumbers:true,
                singleSelect:true,
                autoRowHeight:false,
                pageSize:10">
        <thead>
            <tr>
                <th field="Num_Emp" width="100">No Employeur</th>
                <th field="Libelle" width="200">Libelle</th>
                <th field="Raisoc" width="300">Raison Social</th>
                <th field="Credit" width="100" align="right">Montant Credit</th>
            </tr>
        </thead>
    </table>
 
<?php
$stid = oci_parse($conn, "SELECT t.NumeroCot ||' '|| Cle(t.NumeroCot) Num_Emp, b.raisoc, Libelle
						, Sum(t.credit) Credit
						FROM Linc.Secu_Ecr t, Linc.Secu_Cot b 
						WHERE t.Journee = '20160203' And t.Canal = '12' AND t.numerocot = b.numerocot
						Group By t.NumeroCot, t.libelle, b.raisoc
						Order by t.NumeroCot");
 
oci_execute($stid);
 
echo "<table>\n";
while ($row = oci_fetch_array($stid, OCI_ASSOC+OCI_RETURN_NULLS)) {
    echo "<tr>";
    foreach ($row as $item) {
        echo "    <td>" . ($item !== null ? htmlentities($item, ENT_QUOTES) : "") . "</td>\n";
    }
    echo "</tr>\n";
}
echo "</table>\n";
?>
 
    <script>
          function getData(){
            var rows = [];
 
                rows.push({ 
				    Num_Emp: 'Num_Emp'
                });
 
            return rows;
        }
 
        $(function(){
            $('#dg').datagrid({data:getData()}).datagrid('clientPaging');
        });
 
    </script>
</body>
</html>
et Voici le résultat
Nom : Sans titre.png
Affichages : 355
Taille : 70,0 Ko
Alors Voila je voudrais mettre le résultat de la requête en bas de l'image dans le tableaux de jQuery. Merci à tous.