<?php include dirname(__FILE__) . '\\..\\Modelo\\Persona.php'; include dirname(__FILE__) . '\\..\\Modelo\\Mapeador.php'; include dirname(__FILE__) . '\\..\\dao\\docenteDAO.php'; $docente = new Docente(); $mensaje = ""; $datos = array('idDocente' => $_POST['Docente']['idDocente'], 'Nombres' => $_POST['Docente']['Nombres'], 'Apellidos' => $_POST['Docente']['Apellidos'], 'Telefono' => $_POST['Docente']['Telefono'], 'Email' => $_POST['Docente']['Email'], 'Direccion' => $_POST['Docente']['Direccion'], 'Fecha' => $_POST['Docente']['Fecha']); Mapeador::mapearDocente($docente, $datos); $docenteDAO = new docenteDAO(); try { if (array_key_exists("agregar", $_POST)) { $retorno = $docenteDAO->insertarDocente($docente); } elseif (array_key_exists("modificar", $_POST)) { $retorno = $docenteDAO->actualizarDocente($docente); } elseif (array_key_exists("eliminar", $_POST)) { $retorno = $docenteDAO->eliminarDocente($docente); } } catch (Exception $ex) { $mensaje = "HA OCURRIDO UN ERROR!!!: " . $ex->getMessage(); } echo $mensaje . "<p/><a href='../indexDocente.php'>Regresar al inicio</a>";
function hayOpcionChequeada(frm) { arrObjs = frm.elements; for(i=0; i < arrObjs.length; i++){ if(arrObjs[i].type === 'radio' && arrObjs[i].checked === true){ return true; } } return false; } </script> </head> <body> <?php $ddao = new docenteDAO(); $docente = $ddao->leerTodos(); ?> <form name="form1" method="post" action=""> <table width="757" border="1" cellspacing="1" cellpadding="1"> <caption> DOCENTES </caption> <tr> <th width="34" align="center" scope="col"> </th> <th width="139" scope="col">idDocente</th> <th width="135" scope="col">Nombres</th> <th width="137" scope="col">Apellidos</th> <th width="131" scope="col">Telefono</th> <th width="140" scope="col">email</th> <th width="148" scope="col">Dirección</th>