-
Notifications
You must be signed in to change notification settings - Fork 0
/
occasion_liste.php
202 lines (165 loc) · 5.88 KB
/
occasion_liste.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
<?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="http://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]-->
<style>
tbody tr:nth-child(odd) { background-color: #85776b;}
tbody tr:nth-child(even) { background-color: #ae9d90;}
tbody tr { background-image: url(noise.png);}
table { background-color: #ff33cc;}
caption {
font-family: 'Rock Salt', cursive;
padding: 20px;
font-style: italic;
caption-side: bottom;
color: #666;
text-align: right;
letter-spacing: 1px;
}
a {
text-decoration: underline;
color: #a00;
}
a:visited {
color: #844;
}
a:hover, a:focus, a:active {
text-decoration: none;
color: white;
background: #800;
}
</style>
</head>
<body class="home">
<!-- Fixed navbar -->
<?php include 'menu.html'; ?>
<!-- /.navbar -->
<!-- Header -->
<header id="head">
<div class="container">
<div class="row">
<!-- fiche Client -->
<p class="tagline"><b style="font-size:16px">LISTE DES OCCASIONS</b> </p>
<p>
<?php
$requete = mysqli_query($conn, "SELECT * FROM occasions ORDER BY occas_id DESC LIMIT 50") or die('Erreur SQL !'.$requete.'<br>'.mysqli_error());
?>
<table width="100%" border="0">
<tr>
<td>N°</td>
<td>Type</td>
<td width="300px">Descriptions</td>
<td>Prix</td>
<td>Status</td>
<td>Vendu le</td>
<td> </td>
</tr>
<tr>
<?php while($donnees = mysqli_fetch_assoc($requete)) { ?>
<form method="post" action="oaccasion_modif.php" enctype="multipart/form-data">
<?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' >" .$donnees['occas_id']. "</td>";
?>
<td><SELECT name="type" style="width:150px" >
<OPTION VALUE="<?php echo $donnees['occas_type']; ?>"><?php echo $donnees['occas_type']; ?>
<OPTION VALUE=""></OPTION>
<OPTION VALUE="fixe">Fixe/Tour</OPTION>
<OPTION VALUE="portable">PC Portable</OPTION>
<OPTION VALUE="tablette">Tablette</OPTION>
<OPTION VALUE="imprimante">Imprimante</OPTION>
<OPTION VALUE="aio">All in One</OPTION>
<OPTION VALUE="autre">Autre</OPTION></SELECT>
</td>
<td><textarea name="description" rows="3" cols="40" placeholder="description du pc..."><?php echo $donnees['occas_txt']; ?></textarea>
</td>
<td><input type="text" value="<?php echo $donnees['occas_prix']; ?>" name="prix" size="12" />
</td>
<td>
<SELECT name="status" style="width:120px" >
<OPTION VALUE="<?php echo $donnees['occas_status']; ?>"><?php echo $donnees['occas_status']; ?>
<OPTION VALUE="Au magasin">Au magasin</OPTION>
<OPTION VALUE="Vendu">Vendu</OPTION>
</SELECT>
</td>
<td><input type="date" name="date" value="<?php echo $donnees['occas_date']; ?>" />
</td>
<td><input type="submit" value="Modifier fiche" ></td>
<input name="occasId" type="hidden" value="<?php echo $donnees['occas_id']; ?>">
</form>
<?php } ?>
</tr>
</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="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src="http://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>
<!-- 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>