insert('groups', $_POST); redirect('admin/groups.php'); break; case 'edit' : $id = $_POST['id']; $mysql->update('groups', $_POST, $id); redirect('admin/groups.php'); break; } switch (GET_ACTION) { case 'add' : $data['title'] = 'Новая категория'; $data['list'] = $mysql->select('id')->from('pages')->order_by('title')->fetch_dbda('Page', false); $page = '_add'; break; case 'edit' : $data['group'] = new Group($_GET['id']); $data['title'] = 'Редактировать'; if ($data['group']->type == 'page') { $data['list'] = $mysql->select('id')->from('pages')->order_by('title')->fetch_dbda('Page', false); } elseif ($data['group']->type == 'list') { $data['list'] = $mysql->select('id')->from('lists')->order_by('title')->fetch_dbda('pList', false); } else { $data['list'] = $mysql->select('id')->from('products')->order_by('title')->fetch_dbda('Product', false); } $page = '_edit'; break; } load_template('admin/group' . $page, $data); ?>