mirror of
https://github.com/claradex/nativegallery.git
synced 2024-11-15 11:39:07 +03:00
29 lines
861 B
PHP
29 lines
861 B
PHP
<?php
|
|
|
|
namespace App\Controllers\Api\Admin;
|
|
|
|
|
|
|
|
use App\Services\{Auth, Router, GenerateRandomStr, DB, Json, EXIF};
|
|
use App\Models\{User, Vote, Photo};
|
|
|
|
|
|
class GetVehicleInputs
|
|
{
|
|
public function __construct()
|
|
{
|
|
$id = explode('/', $_SERVER['REQUEST_URI'])[4];
|
|
$vehicle = DB::query('SELECT * FROM entities WHERE id=:id', array(':id' => $id))[0];
|
|
$data = json_decode($vehicle['sampledata'], true);
|
|
foreach ($data as $d) {
|
|
if ($d['important'] === "1") {
|
|
$imp = 'required';
|
|
}
|
|
echo '
|
|
<div class="mb-3">
|
|
<label for="exampleFormControlInput1" class="form-label">' . $d['name'] . '</label>
|
|
<input type="text" name="title" class="form-control" id="exampleFormControlInput1" placeholder="'.$d['name'].'" '.$imp.'>
|
|
</div>';
|
|
}
|
|
}
|
|
}
|