Exemplo n.º 1
0
<? 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>