<div> <input class="button" type="submit" name="bt_send" value="Registrar"> </div> </form> </div> </div> </div> </body> </html> <?php if (isset($_POST['bt_send'])) { $clave2 = "sometimes we break the unbreakable, sometimes. can we ever have what we had then? a friendship unbreakable"; $enigma = new Enigma_rojas1($clave2); $nom_user = $_POST['nom_user']; $ape_user = $_POST['ape_user']; $ced_user = $_POST['tp_ced'] . $_POST['ced_user']; $log_user = $_POST['log_user']; $pw_user = $_POST['pw_user']; $pw_cryp = $enigma->cifrar($pw_user); $level = $_POST['level']; $scr_qutn = $_POST['scr_qutn']; $qutn_cryp = $enigma->cifrar($scr_qutn); $scr_anw = $_POST['scr_anw']; $anw_cryp = $enigma->cifrar($scr_anw); $timezone = date_default_timezone_set('America/Santo_Domingo'); $crt_date = date('o-m-j') . " " . date('g:i:s'); $cmd = pg_query($con, "INSERT INTO users(nom_user, ape_user, ced_user, log_user, pw_user, level, scr_qutn, scr_anw) VALUES('{$nom_user}','{$ape_user}','{$ced_user}','{$log_user}','{$pw_cryp}', {$level}, '{$qutn_cryp}', '{$anw_cryp}')"); $odontolib = new Odontoiut2(); print $odontolib->redireccion("index.php", "Registro exitoso"); }
<?php include 'lib.php'; ?> <!DOCTYPE html> <html lang="es"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <link href="favicon.ico" rel="shortcut icon"> <link rel="stylesheet" href="assets/css/animate.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/font-awesome.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/nexus.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/responsive.css" rel="stylesheet"> <link rel="stylesheet" href="assets/css/custom.css" rel="stylesheet"> <title> Odonto-IUT </title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" type="text/css" href="src/css/custom/hist_custom.css"> <link rel="stylesheet" type="text/css" href="src/css/bootstrap.css"> <link rel="stylesheet" href="src/css/jquery-ui.css"> <script type="text/javascript" src="src/js/jquery.min.js"></script> <script type="text/javascript" src="src/js/sketch.js"></script> <script type="text/javascript" src="src/js/bootstrap.min.js"></script> <script src="src/js/jquery-ui.js"></script> <script src="src/js/odontoiut_hist.js"></script> </head> <body> <div id="header"> <div class="container"> <div class="row">
include 'lib.php'; session_start(); if (isset($_POST['log_user']) && isset($_POST['pw_user'])) { $clave2 = "sometimes we break the unbreakable, sometimes. can we ever have what we had then? a friendship unbreakable"; $enigma = new Enigma_rojas1($clave2); $_SESSION['log_user'] = $_POST["log_user"]; $_SESSION['pw_user'] = $enigma->cifrar($_POST["pw_user"]); $timezone = date_default_timezone_set('America/Santo_Domingo'); $_SESSION['f_act'] = date('o-m-j'); $_SESSION['h_act'] = date('g:i:s'); $_SESSION['tp_audi'] = 5; $db = new Database_pro(); $con = $db->conecta(); $query = pg_query($con, "select * from users where log_user = '******'log_user'] . "' and pw_user = '******'pw_user'] . "'"); if (pg_num_rows($query) > 0) { while ($var = pg_fetch_row($query)) { $_SESSION['id_user'] = $var[0]; $_SESSION['nom_user'] = $var[1]; $_SESSION['ape_user'] = $var[2]; $_SESSION['ced_user'] = $var[3]; $_SESSION['level'] = $var[6]; } /*AUDITORIAS DE LOG-IN O ACCESO AL SISTEMA*/ $dt_audi = "El usuario " . $_SESSION['nom_user'] . " " . $_SESSION['ape_user'] . " de nivel " . $_SESSION['level'] . " a iniciado sesión el: " . $_SESSION['f_act'] . " a las " . $_SESSION['h_act'] . "."; $sql = "INSERT INTO auditoria (tp_audi,id_user,dt_audi,f_audi,h_audi) \n\t\t\t VALUES('" . $_SESSION['tp_audi'] . "'," . $_SESSION['id_user'] . ",'{$dt_audi}','" . $_SESSION['f_act'] . "','" . $_SESSION['h_act'] . "')"; $resul = pg_query($con, $sql); } else { $odontolib = new Odontoiut2(); print $odontolib->redireccion("index.php", "Datos Incorrectos"); } }