<? require_once './view/html.php'; $menu = new Menu(); $submenu = new SubMenu(); $permiso = new Permiso(); $submenu->setOrder(" ORDER BY orden"); if ($_GET['op']=='insert') { $submenu->setIdMenu($_POST['id_menu']); $submenu->setVer($_POST['ver']); $submenu->setLink($_POST['link']); $submenu->insert(); $id_menu=$submenu->findLast(); $permiso->setId($id_menu[0]['id']); $permiso->setIdMenu($id_menu[0]['id_menu']); $permiso->insertPermisoMenu(); } if ($_GET['op']=='delete') { $submenu->delete($_GET['id']); $permiso->deletePermisoMenu($_GET['id']); } $m = $menu->find($_GET['id']); ?> <!DOCTYPE html> <html> <head> <?php
<? require_once './view/html.php'; $rol = new Rol(); $permiso = new Permiso(); if ($_GET['op']=='insert') { $rol->setNom($_POST['nom']); $rol->insert(); $id_rol=$rol->findLast(); $permiso->setId($id_rol[0]['id']); $permiso->insertPermisoRol(); } if ($_GET['op']=='delete') { $rol->delete($_GET['id']); $permiso->deletePermisoRol($_GET['id']); } ?> <!DOCTYPE html> <html> <head> <?php head_html(); ?> <script type="text/javascript"> var nameTable='rol'; function cargarRoles(id) { window.frames.subwin.location.href = "./permiso.php?id="+id; } </script>