laat plaatje niet zien
maar nu wil ik in mijn garage dat hij het zelfde plaatje laat zien
het luk mijn niet om hem vanuit de db te laten lezen
Code (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
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
<?php
include("config.php");
if(! check_login()) {
header('Location: login.php');
exit;
}
if ($jisin == 1) {
header('Location: jisin.php');
}
$car = mysql_query("SELECT * FROM `cars` ORDER BY rand() LIMIT 0,1");
$garage = mysql_fetch_object($car);
?>
<style>
div#bg {
background-color: #c1bda4;
border-left: 1px solid #9c9984;
border-right: 1px solid #9c9984;
border-bottom: 1px solid #9c9984;
border-top: 1px solid #9c9984;
width: 500px;
height: auto;
}
div#menu_content {
background-color: #d1cdb5;
border-left: 1px solid #9c9984;
border-right: 1px solid #9c9984;
border-bottom: 1px solid #9c9984;
border-top: 0;
width: 500px;
height: 25px;
font-family:arial;
font-size:12px;
}
div#menu_links {
height: 26px;
float: left;
margin: 0px;
padding: 0px;
margin-left: 5px;
font-family:arial;
font-size:12px;
color: #000000;
}
a.two:link
{
color:#16130e;
text-decoration: none;
}
a.two:visited
{
color:#16130e;
text-decoration: none;
}
a.two:hover
{
color: #a4a193;
text-decoration: none;
}
div#info3 {
background-color: #c1bda4;
border-left: 1px solid #9c9984;
border-right: 1px solid #9c9984;
border-bottom: 1px solid #9c9984;
border-top: 1px solid #9c9984;
width: 500px;
height: auto;
text-align: left;
}
.maintext{
background-color: #023445;
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
width: 500px;
height: 25px;
font-family:arial;
font-size:12px;
color: white;
text-align: left;
padding-left:2px;
padding-top: 6px;
}
#font_car {
font-family:arial;
font-size:12px;
color: black;
text-align: left;
}
#border_car {
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
}
</style>
<link rel="stylesheet" type="text/css" href="voorbeeld.css">
<body>
<table cellpadding="0" cellspacing="0" width="500px"><tr><td>
<table width="500px" border="0" cellspacing="2" cellpadding="2" class="mod_list">
<div class="maintext"><div align="left">Garage.</div></div>
<div id="menu_content">
<div id="menu_links"><a href="index.php?a=garage&t=garage" class="two" >Garage</a></div>
<div id="menu_links">|</div>
<div id="menu_links"><a href="index.php?a=garage&t=verschepen" class="two" >Verschepen</a></div>
<div id="menu_links">|</div>
<div id="menu_links"><a href="index.php?a=garage&t=verkopen" class="two" >Verkopen</a></div>
<div id="menu_links">|</div>
<div id="menu_links"><a href="index.php?a=garage&t=crushen" class="two" >Crushen</a></div>
</div>
<?php
$dbres = mysql_query("SELECT * FROM garage WHERE login='$data->login' ORDER BY id");
while($list = mysql_fetch_object($dbres))
{
$plaatje = array("","images/2mercedes.jpg","golf.jpg","2rollsphantom.jpg","seat.jpg","2rover.jpg","delorean.jpg","2CadillacV16.jpg","cadillac.jpg","pontiac.jpg","2chrysler.jpg","audir8.jpg","mustang.jpg","gmc.jpg","hummer.jpg","2rolls.jpg","viper.jpg","ferarri.jpg");
$naam = array("","Caddillac Sedan","Golfkar","Rolls Phantom","Seat Cordoba","Rover","DeLorean DMC","Cadillac V16","Cadillac","Pontiac Firebird","Chrysler","Audi R8","Mustang","GMC","Hummer","Rolls Royce","Dodge Viper","Ferrari Spyder");
$plaatje = $plaatje[$list->soort];
$naam = $naam[$list->soort];
$schade = $list->waarde/100;
$schadekosten = $list->schade*$schade;
$waarde = number_format($list->waarde-$schadekosten, 0, '.' , '.');
?>
<br>
<table border="1" bordercolor=white style="background-color:#dbd2b7; width="250px" height="90px" >
<tr>
<th width="50%" scope="row">
<div id="font_car">
Naam: <?echo$naam;?><br>
Id: <?echo$list->id;?><br>
Schade: <?echo$schade;?>%<br>
Schadekosten <?echo$schadekosten;?><br>
Waarde: <?echo$waarde;?>
</div>
</th>
<td width="50%">
<img src="images/autos/<?echo$plaatje;?>" width="100">
</td>
</tr>
</table>
<?
}
?>
include("config.php");
if(! check_login()) {
header('Location: login.php');
exit;
}
if ($jisin == 1) {
header('Location: jisin.php');
}
$car = mysql_query("SELECT * FROM `cars` ORDER BY rand() LIMIT 0,1");
$garage = mysql_fetch_object($car);
?>
<style>
div#bg {
background-color: #c1bda4;
border-left: 1px solid #9c9984;
border-right: 1px solid #9c9984;
border-bottom: 1px solid #9c9984;
border-top: 1px solid #9c9984;
width: 500px;
height: auto;
}
div#menu_content {
background-color: #d1cdb5;
border-left: 1px solid #9c9984;
border-right: 1px solid #9c9984;
border-bottom: 1px solid #9c9984;
border-top: 0;
width: 500px;
height: 25px;
font-family:arial;
font-size:12px;
}
div#menu_links {
height: 26px;
float: left;
margin: 0px;
padding: 0px;
margin-left: 5px;
font-family:arial;
font-size:12px;
color: #000000;
}
a.two:link
{
color:#16130e;
text-decoration: none;
}
a.two:visited
{
color:#16130e;
text-decoration: none;
}
a.two:hover
{
color: #a4a193;
text-decoration: none;
}
div#info3 {
background-color: #c1bda4;
border-left: 1px solid #9c9984;
border-right: 1px solid #9c9984;
border-bottom: 1px solid #9c9984;
border-top: 1px solid #9c9984;
width: 500px;
height: auto;
text-align: left;
}
.maintext{
background-color: #023445;
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
width: 500px;
height: 25px;
font-family:arial;
font-size:12px;
color: white;
text-align: left;
padding-left:2px;
padding-top: 6px;
}
#font_car {
font-family:arial;
font-size:12px;
color: black;
text-align: left;
}
#border_car {
border-left: 1px solid #FFFFFF;
border-right: 1px solid #FFFFFF;
border-bottom: 1px solid #FFFFFF;
border-top: 1px solid #FFFFFF;
}
</style>
<link rel="stylesheet" type="text/css" href="voorbeeld.css">
<body>
<table cellpadding="0" cellspacing="0" width="500px"><tr><td>
<table width="500px" border="0" cellspacing="2" cellpadding="2" class="mod_list">
<div class="maintext"><div align="left">Garage.</div></div>
<div id="menu_content">
<div id="menu_links"><a href="index.php?a=garage&t=garage" class="two" >Garage</a></div>
<div id="menu_links">|</div>
<div id="menu_links"><a href="index.php?a=garage&t=verschepen" class="two" >Verschepen</a></div>
<div id="menu_links">|</div>
<div id="menu_links"><a href="index.php?a=garage&t=verkopen" class="two" >Verkopen</a></div>
<div id="menu_links">|</div>
<div id="menu_links"><a href="index.php?a=garage&t=crushen" class="two" >Crushen</a></div>
</div>
<?php
$dbres = mysql_query("SELECT * FROM garage WHERE login='$data->login' ORDER BY id");
while($list = mysql_fetch_object($dbres))
{
$plaatje = array("","images/2mercedes.jpg","golf.jpg","2rollsphantom.jpg","seat.jpg","2rover.jpg","delorean.jpg","2CadillacV16.jpg","cadillac.jpg","pontiac.jpg","2chrysler.jpg","audir8.jpg","mustang.jpg","gmc.jpg","hummer.jpg","2rolls.jpg","viper.jpg","ferarri.jpg");
$naam = array("","Caddillac Sedan","Golfkar","Rolls Phantom","Seat Cordoba","Rover","DeLorean DMC","Cadillac V16","Cadillac","Pontiac Firebird","Chrysler","Audi R8","Mustang","GMC","Hummer","Rolls Royce","Dodge Viper","Ferrari Spyder");
$plaatje = $plaatje[$list->soort];
$naam = $naam[$list->soort];
$schade = $list->waarde/100;
$schadekosten = $list->schade*$schade;
$waarde = number_format($list->waarde-$schadekosten, 0, '.' , '.');
?>
<br>
<table border="1" bordercolor=white style="background-color:#dbd2b7; width="250px" height="90px" >
<tr>
<th width="50%" scope="row">
<div id="font_car">
Naam: <?echo$naam;?><br>
Id: <?echo$list->id;?><br>
Schade: <?echo$schade;?>%<br>
Schadekosten <?echo$schadekosten;?><br>
Waarde: <?echo$waarde;?>
</div>
</th>
<td width="50%">
<img src="images/autos/<?echo$plaatje;?>" width="100">
</td>
</tr>
</table>
<?
}
?>
nu krijg ik de vraag wat moeten die array`s er in dan?
die moeten vervangen worden door te lezen he plaatje uit de db
Code (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
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
--
-- Tabel structuur voor tabel `cars`
--
CREATE TABLE IF NOT EXISTS `cars` (
`naam` varchar(16) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL DEFAULT '',
`waarde` varchar(6) NOT NULL DEFAULT '',
`auto` varchar(255) NOT NULL DEFAULT '',
FULLTEXT KEY `naam` (`naam`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Gegevens worden uitgevoerd voor tabel `cars`
--
INSERT INTO `cars` (`naam`, `url`, `waarde`, `auto`) VALUES
('Alfa Romeo', 'images/alfa_romeo%20_fnm_2000_jk.jpg', '25000', 'Alfa Romeo'),
('Aston Martin', 'images/aston_martin_db3s.jpg', '60000', 'Aston Martin'),
('Buick Cabrio', 'images/buick_cabrio.jpg', '30000', 'Buick Cabrio'),
('Caddillac Sedan', 'images/caddillac_sedan.jpg', '40000', 'Caddillac Sedan'),
('Chevy Camaro', 'images/chevy_camaro_ss.jpg', '85000', 'Chevy Camaro'),
('Dodge Dart', 'images/dodge_dart.jpg', '12500', 'Dodge Dart'),
('Ford Mustang', 'images/ford_fairlane.jpg', '22500', 'Ford Mustang'),
('Ford Fairlane', 'images/ford_mustang.jpg', '5000', 'Ford Fairlane'),
('Streamliner', 'images/streamliner.jpg', '120000', 'Streamliner'),
('Mercury Cougar', 'images/mercury_cougar.jpg', '145000', 'Mercury Cougar');
-- Tabel structuur voor tabel `cars`
--
CREATE TABLE IF NOT EXISTS `cars` (
`naam` varchar(16) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL DEFAULT '',
`waarde` varchar(6) NOT NULL DEFAULT '',
`auto` varchar(255) NOT NULL DEFAULT '',
FULLTEXT KEY `naam` (`naam`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Gegevens worden uitgevoerd voor tabel `cars`
--
INSERT INTO `cars` (`naam`, `url`, `waarde`, `auto`) VALUES
('Alfa Romeo', 'images/alfa_romeo%20_fnm_2000_jk.jpg', '25000', 'Alfa Romeo'),
('Aston Martin', 'images/aston_martin_db3s.jpg', '60000', 'Aston Martin'),
('Buick Cabrio', 'images/buick_cabrio.jpg', '30000', 'Buick Cabrio'),
('Caddillac Sedan', 'images/caddillac_sedan.jpg', '40000', 'Caddillac Sedan'),
('Chevy Camaro', 'images/chevy_camaro_ss.jpg', '85000', 'Chevy Camaro'),
('Dodge Dart', 'images/dodge_dart.jpg', '12500', 'Dodge Dart'),
('Ford Mustang', 'images/ford_fairlane.jpg', '22500', 'Ford Mustang'),
('Ford Fairlane', 'images/ford_mustang.jpg', '5000', 'Ford Fairlane'),
('Streamliner', 'images/streamliner.jpg', '120000', 'Streamliner'),
('Mercury Cougar', 'images/mercury_cougar.jpg', '145000', 'Mercury Cougar');
Gewijzigd op 01/01/1970 01:00:00 door Thymen akker
Want je steelt (denk ik) bijna nooit een auto zonder schade (bij dat soort games dan).
Gewijzigd op 01/01/1970 01:00:00 door /home/joost
jep met schade ja
Code (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
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
--
-- Tabel structuur voor tabel `garage`
--
CREATE TABLE IF NOT EXISTS `garage` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`login` varchar(16) NOT NULL DEFAULT '',
`naam` varchar(16) NOT NULL DEFAULT '',
`waarde` int(6) NOT NULL DEFAULT '0',
`damage` char(3) NOT NULL DEFAULT '',
`stad` varchar(16) NOT NULL DEFAULT '',
`safe` char(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2097 ;
--
-- Gegevens worden uitgevoerd voor tabel `garage`
--
INSERT INTO `garage` (`id`, `login`, `naam`, `waarde`, `damage`, `stad`, `safe`) VALUES
(2088, 'Admin', 'Caddillac Sedan', 33600, '12', 'Corleone', '0'),
(2089, 'Admin', 'Aston Martin', 11200, '61', 'Corleone', '0'),
(2090, 'Admin', 'Streamliner', 76800, '27', 'Corleone', '0'),
(2091, 'Admin', 'Streamliner', 11200, '68', 'Corleone', '0'),
(2092, 'Admin', 'Dodge Dart', 9333, '19', 'Corleone', '0'),
(2093, 'Admin', 'Buick Cabrio', 500, '92', 'Corleone', '0'),
(2094, 'Admin', 'Dodge Dart', 2000, '63', 'Corleone', '0'),
(2095, 'Admin', 'Caddillac Sedan', 23467, '31', 'Corleone', '0'),
(2096, 'Admin', 'Ford Fairlane', 1333, '55', 'Corleone', '0');
-- Tabel structuur voor tabel `garage`
--
CREATE TABLE IF NOT EXISTS `garage` (
`id` int(4) NOT NULL AUTO_INCREMENT,
`login` varchar(16) NOT NULL DEFAULT '',
`naam` varchar(16) NOT NULL DEFAULT '',
`waarde` int(6) NOT NULL DEFAULT '0',
`damage` char(3) NOT NULL DEFAULT '',
`stad` varchar(16) NOT NULL DEFAULT '',
`safe` char(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=2097 ;
--
-- Gegevens worden uitgevoerd voor tabel `garage`
--
INSERT INTO `garage` (`id`, `login`, `naam`, `waarde`, `damage`, `stad`, `safe`) VALUES
(2088, 'Admin', 'Caddillac Sedan', 33600, '12', 'Corleone', '0'),
(2089, 'Admin', 'Aston Martin', 11200, '61', 'Corleone', '0'),
(2090, 'Admin', 'Streamliner', 76800, '27', 'Corleone', '0'),
(2091, 'Admin', 'Streamliner', 11200, '68', 'Corleone', '0'),
(2092, 'Admin', 'Dodge Dart', 9333, '19', 'Corleone', '0'),
(2093, 'Admin', 'Buick Cabrio', 500, '92', 'Corleone', '0'),
(2094, 'Admin', 'Dodge Dart', 2000, '63', 'Corleone', '0'),
(2095, 'Admin', 'Caddillac Sedan', 23467, '31', 'Corleone', '0'),
(2096, 'Admin', 'Ford Fairlane', 1333, '55', 'Corleone', '0');