Bonjours j'ai un probleme dans mon systeme de vote, je ne comprend pas pourquoi ça ne fonctionne pas

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
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
 
<?php require('app/template/header.php'); ?>
 
<style>#contentBox span.desc{color:rgba(0,0,0,0.5);font-size: 14px;}#contentBox .one{width:100%;height:auto;padding-top:10px;padding-bottom:10px;border-bottom:1px dashed rgba(68, 68, 68, 0.23);}#contentBox .fond{float:left;height:60px;width:60px;border:3px solid #1E88E5;border-radius:50%;background:url(./assets/img/article.png) -500px 0px no-repeat;}#contentBox .fond .avatar{float:left;height:60px;width:100%;border-radius:50%;}#contentBox .pseudo{font-size:17px;color:rgba(0, 0, 0, .8);margin-left:3px;}#contentBox .desc{display:block;font-size:13px;color:rgba(0, 0, 0, .8);margin-left:3px;}
.vote-btn {
  appearance:none;
  border-radius:2px;
  border:0;
  background:#ffa956;
  padding:10px;
  font:bold 9px/1.2 arial;
  color:#fff;
  text-transform:uppercase;
  letter-spacing:1px;
  box-shadow:0 1px 1px rgba(0,0,0,.2);
  outline:none;
  position:relative;
  transition: all .3s ease-out; 
  cursor:pointer;
  overflow:hidden;
  text-align:center;
}
</style>
<script>
var VoteWidget= {
  settings: {
    $counter: $('.vote-count'),
    $btn:     $('.myform button'),
  },
init: function() {
  VoteWidget.bind();
},
  bind: function() {
    VoteWidget.settings.$btn.click(function(){
      if (! $(this).hasClass('complete')) {
            VoteWidget.bumpCount();
      }
      $(this).toggleClass('complete');
      VoteWidget.toggleText();  
 
    return false;
  });
  },
  bumpCount: function() {
    var current_count = $('.vote-count').text();
    count = parseInt(current_count);
    count++;
    VoteWidget.settings.$counter.toggleClass('bumped').text(count);
  },
  toggleText: function(){
    var $text_container = $('.myform button .text');
    var alt_text = VoteWidget.settings.$btn.data('alt-text');
    var default_text = VoteWidget.settings.$btn.data('default-text');
    var current_text = $text_container.text();
    console.log('current is ' + current_text);
    if ( current_text == default_text ) {
      $text_container.text(alt_text)
    } else {
      $text_container.text(default_text)
    }
  }
}
</script>
<div id="content">
	<div class="padding">
		<div class="width3 left">
			<div id="contentBox">
				<div class="title_red" style="background: #68c3ff;">Classement du meilleur Staff</div>
				<div class="content" style="display: inline-block;">
					<?php
					$SelectLesDirigeants = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesDirigeants->execute(array("10"));
					if($SelectLesDirigeants->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun dirigeant pour le moment !';
					}
					while($SelectLesDirigeantsExport = $SelectLesDirigeants->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<div class="fond" style="border:3px solid #68c3ff;">
									<div class="avatar" style="background:url(http://avatar-retro.com/habbo-imaging/avatarimage?figure=<?= htmlspecialchars($SelectLesDirigeantsExport->look); ?>&direction=2&head_direction=3&action=wav&gesture=sml) -3px -10px no-repeat;"></div>
								</div>
							</td>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesDirigeantsExport->username); ?></b></span>
								</a>
								<span class="desc" style="color:white;"><b><?= intval($SelectVotes->Votes); ?></b> votes</span>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesResponsables = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesResponsables->execute(array("9"));
					if($SelectLesResponsables->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun responsable pour le moment !';
					}
					while($SelectLesResponsablesExport = $SelectLesResponsables->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<div class="fond" style="border:3px solid #68c3ff;">
									<div class="avatar" style="background:url(http://avatar-retro.com/habbo-imaging/avatarimage?figure=<?= htmlspecialchars($SelectLesResponsablesExport->look); ?>&direction=2&head_direction=3&action=wav&gesture=sml) -3px -10px no-repeat;"></div>
								</div>
							</td>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesResponsablesExport->username); ?></b></span>
								</a>
								<span class="desc" style="color:white;"><b><?= intval($SelectVotes->Votes); ?></b> votes</span>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesAnimateurs = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesAnimateurs->execute(array("8"));
					if($SelectLesAnimateurs->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun animateur pour le moment !';
					}
					while($SelectLesAnimateursExport = $SelectLesAnimateurs->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<div class="fond" style="border:3px solid #68c3ff;">
									<div class="avatar" style="background:url(http://avatar-retro.com/habbo-imaging/avatarimage?figure=<?= htmlspecialchars($SelectLesAnimateursExport->look); ?>&direction=2&head_direction=3&action=wav&gesture=sml) -3px -10px no-repeat;"></div>
								</div>
							</td>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesAnimateursExport->username); ?></b></span>
								</a>
								<span class="desc" style="color:white;"><b><?= intval($SelectVotes->Votes); ?></b> votes</span>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesModerateurs = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesModerateurs->execute(array("7"));
					if($SelectLesModerateurs->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun modérateur pour le moment !';
					}
					while($SelectLesModerateursExport = $SelectLesModerateurs->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<div class="fond" style="border:3px solid #68c3ff;">
									<div class="avatar" style="background:url(http://avatar-retro.com/habbo-imaging/avatarimage?figure=<?= htmlspecialchars($SelectLesModerateursExport->look); ?>&direction=2&head_direction=3&action=wav&gesture=sml) -3px -10px no-repeat;"></div>
								</div>
							</td>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesModerateursExport->username); ?></b></span>
								</a>
								<span class="desc" style="color:white;"><b><?= intval($SelectVotes->Votes); ?></b> votes</span>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesGraphistes = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesGraphistes->execute(array("6"));
					if($SelectLesGraphistes->rowCount() == 0)
					{
						echo 'Il n\'y a aucun graphiste pour le moment !';
					}
					while($SelectLesGraphistesExport = $SelectLesGraphistes->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<div class="fond" style="border:3px solid #68c3ff;">
									<div class="avatar" style="background:url(http://avatar-retro.com/habbo-imaging/avatarimage?figure=<?= htmlspecialchars($SelectLesGraphistesExport->look); ?>&direction=2&head_direction=3&action=wav&gesture=sml) -3px -10px no-repeat;"></div>
								</div>
							</td>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesGraphistesExport->username); ?></b></span>
								</a>
								<span class="desc" style="color:white;"><b><?= intval($SelectVotes->Votes); ?></b> votes</span>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesGuides = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesGuides->execute(array("5"));
					if($SelectLesGuides->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun guide pour le moment !';
					}
					while($SelectLesGuidesExport = $SelectLesGuides->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<div class="fond" style="border:3px solid #68c3ff;">
									<div class="avatar" style="background:url(http://avatar-retro.com/habbo-imaging/avatarimage?figure=<?= htmlspecialchars($SelectLesGuidesExport->look); ?>&direction=2&head_direction=3&action=wav&gesture=sml) -3px -10px no-repeat;"></div>
								</div>
							</td>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesGuidesExport->username); ?></b></span>
								</a>
								<span class="desc" style="color:white;"><b><?= intval($SelectVotes->Votes); ?></b> votes</span>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesPubeurs = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesPubeurs->execute(array("4"));
					if($SelectLesPubeurs->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun pubeur pour le moment !';
					}
					while($SelectLesPubeursExport = $SelectLesPubeurs->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<div class="fond" style="border:3px solid #68c3ff;">
									<div class="avatar" style="background:url(http://avatar-retro.com/habbo-imaging/avatarimage?figure=<?= htmlspecialchars($SelectLesPubeursExport->look); ?>&direction=2&head_direction=3&action=wav&gesture=sml) -3px -10px no-repeat;"></div>
								</div>
							</td>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesPubeursExport->username); ?></b></span>
								</a>
								<span class="desc" style="color:white;"><b><?= intval($SelectVotes->Votes); ?></b> votes</span>
							</td>
						</table>
					</div> <?php } ?>
				</div>
			</div>
		</div>
 
		<div class="width3 right">
			<div id="contentBox">
				<div class="title_red" style="background: #ffa956;">A quoi va servir ces votes ?</div>
				<div class="content" style="display: inline-block;">
					Ces votes permettrons de faire le point au niveau de l'équipe, et de voir ce qu'il va et ne va pas avec le personnel ayant le moins de votes.
					<div class='ajax-poll' tclass='poll-simple' style='width:450px;'></div>
<script>
function saveQuantity(quantity) 
{
  $.ajax({
 
  alert(quantity);
 
  })
}
</script>
				</div>
			</div>
			<div id="contentBox">
				<div class="title_red" style="background: #27ae60;margin-top:15px;">Votes :</div>
					<div class="content" style="display: inline-block;">
						<?php
					$SelectLesDirigeants = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesDirigeants->execute(array("10"));
					if($SelectLesDirigeants->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun dirigeant pour le moment !';
					}
					while($SelectLesDirigeantsExport = $SelectLesDirigeants->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesDirigeantsExport->username); ?></b><span style="padding-left:160px;"><?= htmlspecialchars($SelectLesDirigeantsExport->fonction); ?> :</span></span> 
								</a>
								<form class="vote">
								  <input class="vote-btn" type="submit" name="submit_vote" value="Voter">
								  <span style="padding-left:140px;"><?= htmlspecialchars($SelectLesDirigeantsExport->motto); ?></span>
								</form>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesResponsables = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesResponsables->execute(array("9"));
					if($SelectLesResponsables->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun responsable pour le moment !';
					}
					while($SelectLesResponsablesExport = $SelectLesResponsables->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesResponsablesExport->username); ?></b></span>
								</a>
								<form class="vote">
								  <input class="vote-btn" type="submit" name="submit_vote" value="Voter">
								</form>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesAnimateurs = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesAnimateurs->execute(array("8"));
					if($SelectLesAnimateurs->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun animateur pour le moment !';
					}
					while($SelectLesAnimateursExport = $SelectLesAnimateurs->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesAnimateursExport->username); ?></b></span>
								</a>
								<form class="vote">
								  <input class="vote-btn" type="submit" name="submit_vote" value="Voter">
								</form>
							</td>
						</table>
					</div> <?php } ?>
					<?php
					$SelectLesModerateurs = $bdd->prepare('SELECT * FROM users WHERE rank = ? ORDER BY id');
					$SelectLesModerateurs->execute(array("7"));
					if($SelectLesModerateurs->rowCount() == 0)
					{
					    echo 'Il n\'y a aucun modérateur pour le moment !';
					}
					while($SelectLesModerateursExport = $SelectLesModerateurs->fetch(PDO::FETCH_OBJ)) { 
					?>
					<div class="one">
						<table>
							<td>
								<a href="#" style="text-decoration: none;">
									<span class="pseudo" style="color:white;"><b><?= htmlspecialchars($SelectLesModerateursExport->username); ?></b></span>
								</a>
								<form class="vote">
								  <input class="vote-btn" type="submit" name="submit_vote" value="Voter">
								</form>
							</td>
						</table>
					</div> <?php } ?>
					</div>
			</div>
		</div>
 
<?php require('app/template/footer.php'); ?>