$action = $_REQUEST['action']; include_once MODELS_ADMIN . "/" . $model . "_model.php"; switch (strtoupper($action)) { case 'ADD': if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'save') { $objUsr = new users(); $objUsr->setUsers($_REQUEST); $objComm->redirect('index.php?model=' . $model); } break; case 'VIEW': case 'EDIT': if (isset($_REQUEST['btn_submit']) && $_REQUEST['btn_submit'] == 'update') { $objUsr = new users(); $objUsr->setUsers($_REQUEST); $objComm->redirect('index.php?model=' . $model . '&action=edit&id=' . $_REQUEST['pk_id']); } else { $objUsr = new users(); $row = $objUsr->getUsers($_REQUEST['id']); } break; case 'DELETE': $objUsr = new users(); $objUsr->delUsers($_REQUEST['id']); $objComm->redirect('index.php?model=' . $model); break; default: $objUsr = new users(); $Records = $objUsr->getAllUsers(); break; }
/** * protected Функция удаления пользователей по выражению WHERE * Ф-я удаляет данные пользователей из таблиц: user, conf_users * * @param (array) $strWhere - строка для выражения WHERE * * @return bool */ public function delUsers($strWhere) { return parent::delUsers($strWhere); }
$smarty->assign('email', $data['email']); } if (isset($_POST['level'])) { $data['level'] = $_POST['level']; } if ($data['level'] == 1) { $smarty->assign('s1', "selected"); } else { $smarty->assign('s2', "selected"); } } $template = "user_add_edit.tpl"; break; case "delete": if ($_POST['delete']) { if ($usr->delUsers()) { $smarty->assign('pesan', "User/s Deleted !" . $meta); $smarty->assign('dshowMe', true); } else { $smarty->assign('pesan', "Failed to delete User/s !"); } } break; default: $template = "user.tpl"; } // user list $doAksi2 = false; if ($listUsers = $usr->showUsers()) { $smarty->assign('paging', $usr->pageMe()); $smarty->assign('listUsers', $listUsers);