nativegallery/views/pages/Vehicle.php

60 lines
1.4 KiB
PHP
Raw Normal View History

<?php
use \App\Services\{Auth, DB, Date};
use \App\Models\Vehicle;
$id = explode('/', $_SERVER['REQUEST_URI'])[2];
$data = DB::query('SELECT * FROM entities_data WHERE id=:id', array(':id' => $id))[0];
$vehicle = new Vehicle($data['entityid']);
$vehicledatavariables = json_decode($data['content'], true);
?>
2024-09-14 23:55:42 +03:00
<!DOCTYPE html>
<html lang="ru">
<head>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/LoadHead.php'); ?>
2024-09-14 23:55:42 +03:00
</head>
<body>
<div id="backgr"></div>
<table class="tmain">
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Navbar.php'); ?>
<tr>
<td class="main">
<h1><?= $data['title'] ?></h1>
2024-09-14 23:55:42 +03:00
<table class="horlines">
<col width="150">
<col>
<?php
$vehiclevariables = json_decode($vehicle->getvehicle('sampledata'), true);
$num = 1;
foreach ($vehiclevariables as $vb) {
echo '<tr class="h21"><td class="ds nw">' . $vb['name'] . ':</td><td class="d"><b>' . $vehicledatavariables[$num]['value'] . '</b></td></tr>';
$num++;
}
?>
2024-09-14 23:55:42 +03:00
</table><br>
2024-09-14 23:55:42 +03:00
<tr>
<?php include($_SERVER['DOCUMENT_ROOT'] . '/views/components/Footer.php'); ?>
2024-09-14 23:55:42 +03:00
</tr>
</table>
</body>
</html>