-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.php
106 lines (106 loc) · 3.8 KB
/
index.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
<?php
require 'required.inc.php';
$cars = Car::findAll();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Cars</title>
<script type="text/javascript" src="jquery-1.2.3.min.js"></script>
<script type="text/javascript" src="jquery.livequery.min.js"></script>
<script type="text/javascript" src="jquery.ui-1.0.min.js"></script>
<script type="text/javascript" src="cars.js"></script>
<link rel="stylesheet" type="text/css" href="flora.tablesorter.css" />
<link rel="stylesheet" type="text/css" href="flora.resizable.css" />
<link rel="stylesheet" type="text/css" href="flora.dialog.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="print.css" media="print" />
</head>
<body class="flora">
<h1>Cars</h1>
<table id="cars" class="tablesorter">
<thead>
<tr>
<th>Price</th>
<th>Make</th>
<th>Model</th>
<th>Year</th>
<th>Mileage</th>
<th>VIN</th>
<th>Dealer</th>
</tr>
</thead>
<tbody>
<?php foreach ($cars as $car) { $carfax=file_exists('carfax/'.$car->vin.'.html'); ?>
<tr id="<?= h($car->id) ?>">
<td class="price"><?= h($car->price) ?></td>
<td class="make"><?= h($car->make) ?></td>
<td class="model"><?= h($car->model) ?></td>
<td class="year"><?= h($car->year) ?></td>
<td class="mileage"><?= h($car->mileage) ?></td>
<td class="vin"><? if ($carfax) { ?><a href="carfax/<?= h($car->vin) ?>.html"><? } ?><?= h($car->vin) ?><? if ($carfax) { ?></a><? } ?></td>
<td class="dealer"><a href="<?= h($car->uri) ?>"><?= h($car->dealer) ?></a></td>
<td class="edit"><a href="edit.php?id=<?= h($car->id) ?>"><img src="images/edit.png" alt="Edit" /></a></td>
<td class="delete">
<form method="post" action="delete.php" class="delete_form">
<p>
<input type="hidden" name="id" value="<?= h($car->id) ?>" />
<input type="image" src="images/delete.png" value="Delete" alt="Delete" />
</p>
</form>
</td>
</tr>
<?php } ?>
</tbody>
</table>
<div id="add">
<h2>Add Car</h2>
<form id="add_form" method="post" action="add.php">
<table>
<tbody>
<tr>
<td>Price</td>
<td><input type="text" name="price" /></td>
</tr>
<tr>
<td>Make</td>
<td><input type="text" name="make" /></td>
</tr>
<tr>
<td>Model</td>
<td><input type="text" name="model" /></td>
</tr>
<tr>
<td>Year</td>
<td><input type="text" name="year" /></td>
</tr>
<tr>
<td>Mileage</td>
<td><input type="text" name="mileage" /></td>
</tr>
<tr>
<td>VIN</td>
<td><input type="text" name="vin" /></td>
</tr>
<tr>
<td>Website</td>
<td><input type="text" name="uri" /></td>
</tr>
<tr>
<td>Dealer</td>
<td><input type="text" name="dealer" /></td>
</tr>
<tr>
<td id="recaptcha" colspan="2">
<?= recaptcha_get_html(RECAPTCHA_PUBLIC_KEY, $_GET['recaptcha_error']) ?>
</td>
</tr>
<tr>
<td colspan="2" align="right"><input type="submit" value="Add" /></td>
</tr>
</tbody>
</table>
</form>
</div>
</body>
</html>