-
Notifications
You must be signed in to change notification settings - Fork 0
/
DataBase.php
114 lines (108 loc) · 3.25 KB
/
DataBase.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
<?php
require 'inc/config.php';
require 'inc/dbh.php';
$r = $dbh->query('SELECT * FROM autogallery ORDER BY `id` ASC ;')
or die('ERROR TABLES');
$gallery = $r->fetchAll();
?>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
<script src="node_modules/bootstrap/dist/js/bootstrap.bundle.min.js"></script>
<title>Table-PHP</title>
<style>
</style>
</head>
<body>
<!-- <ul >-->
<!-- --><?php //foreach ($gallery as $cars): ?>
<!-- <li>-->
<!-- --><?php //echo $cars['brand_id'] ?>
<!-- </li>-->
<!-- --><?php //endforeach; ?>
<!-- </ul>-->
<table class="table table-bordered text-center bg-dark text-bg-light">
<tr class="text-bg-dark">
<th>ID</th>
<th>BRAND</th>
<th>MODEL</th>
<th>COLOR</th>
<th>YEAR</th>
<th style="width: 140px ">#</th>
</tr>
<?php foreach ($gallery as $cars): ?>
<tr class="bg-light">
<td class="bg-secondary">
<?php echo $cars['id'] ?>
</td>
<td>
<?php echo $cars['brand_id'] ?>
</td>
<td>
<?php echo $cars['model'] ?>
</td>
<td>
<?php echo $cars['color_id'] ?>
</td>
<td>
<?php echo $cars['date'] ?>
</td>
<td class="bg-light bg-gradient bg-dark rounded-3">
<button class="bg-primary rounded-pill">Edit</button>
<button class="bg-danger border-5 rounded-3">X</button>
</td>
<?php endforeach; ?>
</tr>
</table>
<br><br>
<hr>
<form action="GalleryStore.php" method="post" class="container">
<div class="row">
<div class="col-md">
<div class="form-group">
<label for="brand">
Brand
</label>
<input type="text" id="brand" name="brand" value="" class="form-control">
</div>
</div>
<div class="col-md">
<div class="form-group">
<label for="model">
Model
</label>
<input type="text" id="model" name="model" value="" placeholder="Model" class="form-control">
</div>
</div>
</div>
<div class="row">
<div class="col-md">
<div class="form-group">
<label for="color">
Color
</label>
<input type="text" id="color" name="color" value="" placeholder="Color" class="form-control">
</div>
</div>
<div class="col-md">
<div class="form-group">
<label for="year">
Year
</label>
<input type="number" id="year" name="date" value="" placeholder="Year" class="form-control">
</div>
</div>
</div>
<div class="mt-2">
<button class="btn btn-primary w-100">
Save
</button>
</div>
</form>
</body>
</html>