This commit is contained in:
Alan
2026-02-14 19:34:54 +03:00
commit 5c3329238b
867 changed files with 214778 additions and 0 deletions

43
simpla/GroupAdmin.php Normal file
View File

@@ -0,0 +1,43 @@
<?PHP
require_once('api/Simpla.php');
class GroupAdmin extends Simpla
{
public function fetch()
{
if($this->request->method('post'))
{
$group->id = $this->request->post('id', 'integer');
$group->name = $this->request->post('name');
$group->discount = $this->request->post('discount');
if(empty($group->id))
{
$group->id = $this->users->add_group($group);
$this->design->assign('message_success', 'added');
}
else
{
$group->id = $this->users->update_group($group->id, $group);
$this->design->assign('message_success', 'updated');
}
$group = $this->users->get_group(intval($group->id));
}
else
{
$id = $this->request->get('id', 'integer');
if(!empty($id))
$group = $this->users->get_group(intval($id));
}
if(!empty($group))
{
$this->design->assign('group', $group);
}
return $this->design->fetch('group.tpl');
}
}