-
Notifications
You must be signed in to change notification settings - Fork 0
/
client.php
214 lines (166 loc) · 6.37 KB
/
client.php
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
<?php require("auth.php");
require("connect.php"); ?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="Sergey Pozhilov (GetTemplate.com)">
<title>Fiche Intervention</title>
<link rel="shortcut icon" href="assets/images/gt_favicon.png">
<link rel="stylesheet" media="screen" href="https://fonts.googleapis.com/css?family=Open+Sans:300,400,700">
<link rel="stylesheet" href="assets/css/bootstrap.min.css">
<link rel="stylesheet" href="assets/css/font-awesome.min.css">
<!-- Custom styles for our template -->
<link rel="stylesheet" href="assets/css/bootstrap-theme.css" media="screen">
<link rel="stylesheet" href="assets/css/main.css">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="assets/js/html5shiv.js"></script>
<script src="assets/js/respond.min.js"></script>
<![endif]-->
</head>
<body class="home">
<!-- Fixed navbar -->
<?php include 'menu.html'; ?>
<!-- /.navbar -->
<!-- Header -->
<header id="head">
<div class="container">
<div class="row">
<?php
require('encours.php')
?>
<p class="tagline"><b style="font-size:16px">LISTE DES CLIENTS</b> </p>
<p>
<!-- fiche recherche -->
<form name="formNom">
<input type="text" name="nom" size="30"> <input type="button" onClick="rechClient()" value="RECHERCHER PAR NOM">
</form>
<!-- fin fiche recherche -->
<!-- fiche Client -->
<!-- LISTE AJAX -->
<div id="liste">
<?php
$requete = mysqli_query($conn, "SELECT * FROM clients ORDER BY cli_id DESC") or die('Erreur SQL !' . $requete . '<br>' . mysql_error());
?>
<input type="search" placeholder="Search..." class="form-control search-input" data-table="interv-list" />
<table class="interv-list" border="0" align="center">
<thead>
<tr>
<th width="100"> </th>
<th width="40">N°</th>
<th width="180">Nom/Prénom</th>
<th width="80">Téléphone 1</th>
<th width="80">Téléphone 2</th>
<th width="100">E-mail</th>
</tr>
</thead>
<tbody>
<tr>
<?php while ($donnees = mysqli_fetch_assoc($requete)) {
echo "<tr>";
echo "<td align='center'>";
?>
<a href="client_modif.php?id=<?php echo $donnees['cli_id']; ?>"><button>MODIFIER</button></a>
<?php
echo "</td>";
echo "<td align='left'>" . $donnees['cli_id'] . "</td>";
echo "<td align='left'>" . $donnees['cli_civ'] . " " . $donnees['cli_nom'] . " </td>";
echo "<td>" . $donnees['cli_tel1'] . "</td>";
echo "<td>" . $donnees['cli_tel2'] . "</td>";
echo "<td align='left'>" . $donnees['cli_tel3'] . "</td>";
?>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<!-- FIN LISTE AJAX -->
</p>
<!-- fin fiche client -->
<p> </p>
<p align="center">---------------------------</p>
<p> </p>
</p>
<!-- fin fiche client -->
</div>
</div>
</header>
<!-- /Header -->
<!-- Intro -->
<div class="container text-center">
</div>
<!-- /Intro-->
<footer id="footer" class="top-space">
<?php include 'footer.html'; ?>
</footer>
<!-- JavaScript libs are placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.js"></script>
<script src="assets/js/jquery-ui.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="https://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script src="assets/js/headroom.min.js"></script>
<script src="assets/js/jQuery.headroom.min.js"></script>
<script src="assets/js/template.js"></script>
<!-- Clients filtering -->
<script>
(function(document) {
'use strict';
var TableFilter = (function(myArray) {
var search_input;
function _onInputSearch(e) {
search_input = e.target;
var tables = document.getElementsByClassName(search_input.getAttribute('data-table'));
myArray.forEach.call(tables, function(table) {
myArray.forEach.call(table.tBodies, function(tbody) {
myArray.forEach.call(tbody.rows, function(row) {
var text_content = row.textContent.toLowerCase();
var search_val = search_input.value.toLowerCase();
console.log("search_chars = " + search_val);
row.style.display = text_content.indexOf(search_val) > -1 ? '' : 'none';
});
});
});
}
return {
init: function() {
var inputs = document.getElementsByClassName('search-input');
myArray.forEach.call(inputs, function(input) {
input.oninput = _onInputSearch;
});
}
};
})(Array.prototype);
document.addEventListener('readystatechange', function() {
if (document.readyState === 'complete') {
TableFilter.init();
}
});
})(document);
</script>
<!-- AJAX -->
<script>
function rechClient() {
var IDnom = document.formNom.nom.value;
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
} else { // code for IE6, IE5
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 1) {
document.getElementById("liste").innerHTML = "<center><img src='images/loading.gif' width='50px' /></center>";
} else
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
document.getElementById("liste").innerHTML = xmlhttp.responseText;
}
}
xmlhttp.open("GET", "client_rech_ajax.php?nom=" + IDnom, true);
xmlhttp.send();
}
</script>
</body>
</html>