From 0f6feb123a09ce38b6b3597cc748064af9f2b1c6 Mon Sep 17 00:00:00 2001 From: themohooks <81331307+themohooks@users.noreply.github.com> Date: Sun, 6 Oct 2024 23:03:55 +0300 Subject: [PATCH] load models --- .../Api/Admin/GetVehicleInputs.php | 26 ++++ app/Controllers/ApiController.php | 4 + app/Core/Routes.php | 1 + views/pages/Admin/EntityCreate.php | 9 +- views/pages/Admin/ModelsCreate.php | 121 ++++++------------ 5 files changed, 77 insertions(+), 84 deletions(-) create mode 100644 app/Controllers/Api/Admin/GetVehicleInputs.php diff --git a/app/Controllers/Api/Admin/GetVehicleInputs.php b/app/Controllers/Api/Admin/GetVehicleInputs.php new file mode 100644 index 0000000..5204f9a --- /dev/null +++ b/app/Controllers/Api/Admin/GetVehicleInputs.php @@ -0,0 +1,26 @@ +$id))[0]; + $data = json_decode($vehicle['sampledata'], true); + foreach ($data as $d) { + echo ' +
+ + +
'; + } + } +} diff --git a/app/Controllers/ApiController.php b/app/Controllers/ApiController.php index 99870c8..77c497f 100644 --- a/app/Controllers/ApiController.php +++ b/app/Controllers/ApiController.php @@ -22,6 +22,7 @@ use \App\Controllers\Api\Users\LoadUser as UserLoad; use \App\Controllers\Api\Admin\Images\SetVisibility as AdminPhotoSetVisibility; use \App\Controllers\Api\Admin\CreateNews as AdminCreateNews; use \App\Controllers\Api\Admin\LoadNews as AdminLoadNews; +use \App\Controllers\Api\Admin\GetVehicleInputs as AdminGetVehicleInputs; class ApiController { @@ -83,6 +84,9 @@ class ApiController public static function adminloadnews() { return new AdminLoadNews(); } + public static function admingetvehicleinputs() { + return new AdminGetVehicleInputs(); + } } \ No newline at end of file diff --git a/app/Core/Routes.php b/app/Core/Routes.php index 37128f5..7075d6c 100644 --- a/app/Core/Routes.php +++ b/app/Core/Routes.php @@ -65,6 +65,7 @@ class Routes Router::any('/api/admin/images/setvisibility', 'ApiController@adminsetvis'); Router::any('/api/admin/createnews', 'ApiController@admincreatenews'); Router::any('/api/admin/loadnews', 'ApiController@adminloadnews'); + Router::any('/api/admin/getvehicleinputs/$id', 'ApiController@admingetvehicleinputs'); } Router::get('/logout', 'MainController@logout'); Router::get('/404', 'ExceptionRegister@notfound'); diff --git a/views/pages/Admin/EntityCreate.php b/views/pages/Admin/EntityCreate.php index fc80aa7..12aba5f 100644 --- a/views/pages/Admin/EntityCreate.php +++ b/views/pages/Admin/EntityCreate.php @@ -38,10 +38,11 @@ if (isset($_POST['create'])) { -
- - -
+
+ + +
+

Вводимые переменные

-
- - -
-

Вводимые переменные

- -
-
-
- - -
-
-
-
- - -
-
-
- - -
-
- - -
-
- - - + + + + + + + + \ No newline at end of file