Init
This commit is contained in:
37
simpla/ModelsAdmin.php
Normal file
37
simpla/ModelsAdmin.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user