5 include_once("include/session.php");
7 * The user is already logged in, not allowed to register.
9 /*if($session->logged_in){
10 echo "<h1>Registered</h1>";
11 echo "<p>We're sorry <b>$session->username</b>, but you've already registered. "
12 ."<a href=\"main.php\">Main</a>.</p>";
15 * The user has submitted the registration form and the
16 * results have been processed.
18 if(isset($_SESSION['regsuccess']) && isset($_SESSION['regsuccess'])){
19 /* Registration was successful */
20 if($_SESSION['regsuccess']){
21 echo "<h3>Registrado.</h3>";
22 echo "<p><b>'".$_SESSION['reguname']."'</b> ha sido agregado a la base de datos.</p>";
24 /* Registration failed */
26 echo "<h3>Registro fallido</h3>";
27 echo "<p>Lo sentimos pero el registro para el usuario <b>".$_SESSION['reguname']."</b> a fallado.</p>";
29 unset($_SESSION['regsuccess']);
30 unset($_SESSION['reguname']);
33 * The user has not filled out the registration form yet.
34 * Below is the page with the sign-up form, the names
35 * of the input fields are important and should not
40 <h3
>Registros de Instructores
</h3
>
42 if($form->num_errors
> 0){
43 echo "$form->num_errors error(s) found";
46 <form action
="process.php" method
="POST">
48 <tr
><td
>Carné
:</td
><td
><input type
="text" name
="user" maxlength
="30" value
="<? echo $form->value("user
"); ?>"></td
><td
><?
echo $form->error("user"); ?
></td
></tr
>
49 <tr
><td
>Clave
:</td
><td
><input type
="password" name
="pass" maxlength
="30" value
="<? echo $form->value("pass
"); ?>"></td
><td
><?
echo $form->error("pass"); ?
></td
></tr
>
50 <tr
><td
>Email
:</td
><td
><input type
="text" name
="email" maxlength
="50" value
="<? echo $form->value("email
"); ?>"></td
><td
><?
echo $form->error("email"); ?
></td
></tr
>
51 <tr
><td
>Nombre
:</td
><td
><input type
="text" name
="nombre" maxlength
="100" value
=""></td
></tr
>
52 <tr
><td
>Encargado
:</td
><td
><input type
="text" name
="encargado" maxlength
="100" value
=""></td
></tr
>
53 <tr
><td
>Catedrático
:</td
><td
><input type
="text" name
="catedratico" maxlength
="100" value
=""></td
></tr
>
57 <option value
="0">Asistente de Catedrático
58 <option value
="1">Asistente de Taller
59 <option value
="2">Encargado de Taller
60 <option value
="3">Instructor de Materia
63 <tr
><td
>Departamento
:</td
>
65 <select name
="departamento">
66 <option value
="0">Dpto
. Electrónica
67 <option value
="1">Dpto
. Informática
70 <tr
><td colspan
="2" align
="right">
71 <input type
="hidden" name
="subjoin" value
="1">
72 <input type
="submit" value
="Registrar"></td
></tr
>