-
Notifications
You must be signed in to change notification settings - Fork 0
/
termine.php
252 lines (203 loc) · 8.67 KB
/
termine.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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<?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')
?>
<!-- fiche Client -->
<p class="tagline"><b style="font-size:16px">FICHE INTERVENTION: TERMINÉE</b> </p>
<p>
<?php
$requete = mysqli_query($conn, "SELECT * FROM interventions WHERE inter_status ='termine' ORDER by inter_date DESC") or die('Erreur SQL !' . $requete . '<br>' . mysqli_error());
?>
<input type="search" placeholder="Search..." class="form-control search-input" data-table="interv-list" />
<table class="interv-list" width="100%" border="0">
<thead>
<tr>
<th> </th>
<th>Date</th>
<th width="150px">Nom</th>
<th width="300px">Observations</th>
<th>Status</th>
<th>Date commande</th>
<th>Chez qui</th>
<th>Matériel commandé</th>
<th>Par qui</th>
<th> </th>
</tr>
</thead>
<tbody>
<tr>
<?php while ($donnees = mysqli_fetch_assoc($requete)) { ?>
<?php
$interNom = $donnees['inter_cli_id'];
$sqlNom = mysqli_query($conn, "SELECT cli_nom FROM clients WHERE cli_id ='$interNom' ") or die('Erreur SQL !' . $sqlNom . '<br>' . mysqli_error());
$dataNom = mysqli_fetch_assoc($sqlNom);
echo "<tr>";
echo "<td align='center' ><a href='intervention_modif.php?id=" . $donnees['inter_id'] . "'><button>Modifier Fiche</button></a></td>";
echo "<form method='post' action='status_modif.php' enctype='multipart/form-data'>";
echo "<td>" . date('d/m/Y', strtotime($donnees['inter_date']));
"</td>";
echo "<td>" . $dataNom['cli_nom'] . "</td>";
echo "<td><i>" . $donnees['inter_info_obs'] . "</i></td>";
?>
<td>
<SELECT name="status" style="width:60px">
<OPTION VALUE="<?php echo $donnees['inter_status']; ?>"><?php echo $typeStatue; ?></OPTION>
<OPTION VALUE="cours">A faire</OPTION>
<OPTION VALUE="sav">SAV</OPTION>
<OPTION VALUE="commande">Pièce commandée</OPTION>
<OPTION VALUE="electro">Chez l'électronicien</OPTION>
<OPTION VALUE="attente">En attente</OPTION>
<OPTION VALUE="livre">Livrée</OPTION>
</SELECT>
</td>
<td><input type="date" name="status_date" value="<?php echo $donnees['inter_status_date']; ?>" />
</td>
<td>
<SELECT name="status_gros" style="width:60px">
<OPTION VALUE="<?php echo $donnees['inter_status_gros']; ?>"><?php echo $donnees['inter_status_gros']; ?></OPTION>
<OPTION VALUE="S2i">S2i</OPTION>
<OPTION VALUE="Amazon">Amazon</OPTION>
<OPTION VALUE="Pobix">Pobix</OPTION>
<OPTION VALUE="Alexi">Alexi</OPTION>
<OPTION VALUE="Accessoires ASUS">Accessoires ASUS</OPTION>
<OPTION VALUE="Dalle Express">Dalle Express</OPTION>
</SELECT>
</td>
<td>
<input type="text" value="<?php echo $donnees['inter_status_piece']; ?>" name="status_mat_com" placeholder="pièce commandée" size="12" />
</td>
<td>
<SELECT name="status_qui" style="width:60px">
<OPTION VALUE="<?php echo $donnees['inter_status_qui']; ?>"><?php echo $donnees['inter_status_qui']; ?></OPTION>
<OPTION VALUE="Nicolas">Nicolas</OPTION>
<OPTION VALUE="Matthias">Matthias</OPTION>
<OPTION VALUE="Sandrine">Sandrine</OPTION>
<OPTION VALUE="Autre">Autre</OPTION>
</SELECT>
</td>
<td><input type="submit" value="Modifier status"></td>
<input name="interId" type="hidden" value="<?php echo $donnees['inter_id']; ?>">
</form>
<?php } ?>
</tr>
</tbody>
</table>
</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>
<!-- Table 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 modifStatus(idInter) {
var idInter;
//alert(txtcli);
if (window.XMLHttpRequest) {
// code for IE7+, Firefox, Chrome, Opera, Safari
xmlArt = new XMLHttpRequest();
} else { // code for IE6, IE5
xmlArt = new ActiveXObject("Microsoft.XMLHTTP");
}
xmlArt.onreadystatechange = function() {
if (xmlArt.readyState == 4 && xmlArt.status == 200) {
var texte = xmlArt.responseText;
alert(idInter);
window.location.reload();
//document.formInter.client.removeChild(document.formInter.client.options[1]);
//document.formInter.client.options[document.formInter.client.length] = new Option(texteCliId, texteCliNom, true, true);
//document.form_articles.artTTC.value = info[4];
}
}
xmlArt.open("GET", "ajax_status_modif.php?gettxt=" + idInter, true);
xmlArt.send();
}
</script>
</body>
</html>