Files
AtomicOld/simpla/ModelsAdmin.php
2026-02-14 19:34:54 +03:00

38 lines
699 B
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?PHP
require_once('api/Simpla.php');
class ModelsAdmin extends Simpla
{
function fetch()
{
// Обработка действий
if($this->request->method('post'))
{
// Действия с выбранными
$ids = $this->request->post('check');
if(is_array($ids))
switch($this->request->post('action'))
{
case 'delete':
{
foreach($ids as $id)
$this->model->delete_model($id);
break;
}
}
}
$brands = $this->model->get_models();
foreach($brands as $model) $model->marka = $this->model->getMarka($model);
$this->design->assign('brands', $brands);
return $this->body = $this->design->fetch('models.tpl');
}
}