forked from gplanchat/wootook
-
Notifications
You must be signed in to change notification settings - Fork 0
/
annonce.php
122 lines (105 loc) · 3.59 KB
/
annonce.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
<?php
/**
* This file is part of Wootook
*
* @license http://www.gnu.org/licenses/gpl-3.0.txt
* @see http://www.wootook.com/
*
* Copyright (c) 2009-Present, Wootook Support Team <http://www.xnova-ng.org>
* All rights reserved.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* --> NOTICE <--
* This file is part of the core development branch, changing its contents will
* make you unable to use the automatic updates manager. Please refer to the
* documentation for further information about customizing Wootook.
*
*/
define('INSIDE' , true);
define('INSTALL' , false);
require_once dirname(__FILE__) .'/application/bootstrap.php';
$users = doquery("SELECT * FROM {{table}} WHERE id='".$user['id']."';", 'users');
$annonce = doquery("SELECT * FROM {{table}} ", 'annonce');
$action = $_GET['action'];
if ($action == 5) {
$metalvendre = $_POST['metalvendre'];
$cristalvendre = $_POST['cristalvendre'];
$deutvendre = $_POST['deutvendre'];
$metalsouhait = $_POST['metalsouhait'];
$cristalsouhait = $_POST['cristalsouhait'];
$deutsouhait = $_POST['deutsouhait'];
while ($v_annonce = $users->fetch(PDO::FETCH_BOTH)) {
$user = $v_annonce['username'];
$galaxie = $v_annonce['galaxy'];
$systeme = $v_annonce['system'];
}
doquery("INSERT INTO {{table}} SET
user='{$user}',
galaxie='{$galaxie}',
systeme='{$systeme}',
metala='{$metalvendre}',
cristala='{$cristalvendre}',
deuta='{$deutvendre}',
metals='{$metalsouhait}',
cristals='{$cristalsouhait}',
deuts='{$deutsouhait}'" , "annonce");
$page2 .= <<<HTML
<center>
<br>
<p>Votre Annonce a bien été enregistrée !</p>
<br><p><a href="annonce.php">Retour aux annonces</a></p>
HTML;
display($page2);
}
if ($action != 5) {
$annonce = doquery("SELECT * FROM {{table}} ORDER BY `id` DESC ", "annonce");
$page2 = "<HTML>
<center>
<br>
<table width=\"600\">
<td class=\"c\" colspan=\"10\"><font color=\"#FFFFFF\">Petites Annonces</font></td></tr>
<tr><th colspan=\"3\">Infos de livraison</th><th colspan=\"3\">Ressources à vendre</th><th colspan=\"3\">Ressources souhaitées</th><th>Action</th></tr>
<tr><th>Vendeur</th><th>Galaxie</th><th>Système</th><th>Métal</th><th>Cristal</th><th>Deuterium</th><th>Métal</th><th>Cristal</th><th>Deuterium</th><th>Delet</th></tr>
";
while ($b = $annonce->fetch(PDO::FETCH_BOTH)) {
$page2 .= '<tr><th> ';
$page2 .= $b["user"] ;
$page2 .= '</th><th>';
$page2 .= $b["galaxie"];
$page2 .= '</th><th>';
$page2 .= $b["systeme"];
$page2 .= '</th><th>';
$page2 .= $b["metala"];
$page2 .= '</th><th>';
$page2 .= $b["gcristala"];
$page2 .= '</th><th>';
$page2 .= $b["deuta"];
$page2 .= '</th><th>';
$page2 .= $b["metals"];
$page2 .= '</th><th>';
$page2 .= $b["cristals"];
$page2 .= '</th><th>';
$page2 .= $b["deuts"];
$page2 .= '</th><th>';
$page2 .= "</th></tr>";
}
$page2 .= "
<tr><th colspan=\"10\" align=\"center\"><a href=\"annonce2.php?action=2\">Ajouter une Annonce</a></th></tr>
</td>
</table>
</HTML>";
display($page2);
}
?>