Beispiel #1
0
 public function agregar()
 {
     $db = Bd::getInstance();
     $sql = $db->ejecutar("INSERT INTO alumnos \n                                VALUES ('','{$this->nombre}',\n                                      '{$this->apellido}',\n                                      '{$this->correo}',\n                                      '{$this->numero}',\n                                      '{$this->institucion}',\n                                      '{$this->pass}',\n                                      '1',\n                                      'A')");
     // mysql_query($sql);
     // echo $sql;
     // echo mysql_error();
     // exit();
     if ($sql) {
         echo " <script type='text/javascript'>\n                    alert('El registro ha sido guardado correctamente');\n                    window.location='../servicio/login.php';\n                    </script> ";
     } else {
         echo " <script type='text/javascript'>\n                    alert('Error al Guardar los datos');\n                    window.location='../index.php';\n                    </script> ";
     }
 }
Beispiel #2
0
 public function loginA()
 {
     $db = Bd::getInstance();
     $consulta = $db->ejecutar("SELECT * FROM administrador\n                                      WHERE correo='{$this->user}' AND pass='******';");
     $dato = $db->recorrer($consulta);
     // $sql = $bd->ejecutar("SELECT * FROM privilegios
     //  WHERE id_Privilegio='$dato[privilegio]';");
     // $pri = $bd->recorrer($sql);
     if (strtolower($dato['correo']) == strtolower($this->user) and $dato['pass'] == $this->passw) {
         session_start();
         $_SESSION['user'] = $dato['nombre'];
         $_SESSION['privilegio'] = $dato['privilegio'];
         // $_SESSION['privi'] = $pri['id_Privilegio'];
         $_SESSION["autentificado"] = "SI";
         header('location: accesoadmi.php');
     } else {
         header('location:../paneladmi.php');
     }
 }
Beispiel #3
0
				<input class="na" type="text" name="nombre" size="25" maxlength="20" placeholder= "Nombre Completo" required style=""><br><br>
								
				<label id="ema">APELLIDO:</label> <br>
				<input class="na"  type="text" name="apellido" size="23" maxlength="20" required placeholder= "Apellidos"  style=""><br><br>
							
				<label id="ema">E-MAIL:</label> <br>
				<input class="na" type="email" name="email" size="20"  placeholder= "*****@*****.**" required style=""><br><br>

				<label id="ema">NÙMERO TELEFÒNICO:</label><br>
				<input class="na"  type="text" name="nt" size="20" maxlength="20" placeholder= "Numero Celular" required style=""><br><br>

				<label id="ema">INSTITUCIÒN:</label> <br>
				<select class="na" name="institucion" id="">
					<option value="0">Elige Opción</option>
					<?php 
$bd = Bd::getInstance();
$sql = $bd->ejecutar("SELECT id_Institucion,nombre FROM institucion");
while ($row = mysql_fetch_array($sql)) {
    echo "<option value=" . $row['id_Institucion'] . ">";
    echo $row['nombre'];
    echo "</option>";
}
?>
				</select><br><br>

				<label id="ema">CONTRASEÑA:</label> <br>
				<input class="na"  type="text" name="contrasena" size="20" maxlength="20" placeholder= "Contraseña" required style=""><br>

				<!-- <a class="registrar" href="sesion.php">REGISTRAR</a> <br><br><br> -->
				<input type="hidden" name="registro" value="1">
				<input  class="registrar" type="submit" value="REGISTRAR"><br><br>