include "../func.php"; $fecha = $_POST['fecha']; $hora = $_POST['hora']; $area = $_POST['area']; $year = $_POST['year']; $numero = $_POST['numero']; $muni = $_POST['muni']; $pobla = $_POST['pobla']; $insta = $_POST['insta']; $entidap = $_POST['entidap']; $colon = $_POST['colon']; $tinst = $_POST['tinst']; $deten = $_POST['deten']; $deleg = $_POST['deleg']; $calle = $_POST['calle']; $siglas = $_POST['siglas']; $bienaf = $_POST['bienaf']; $nume = $_POST['nume']; $montoaf = $_POST['montoaf']; $seraf = $_POST['seraf']; $causa = $_POST['causa']; $codpos = $_POST['codpos']; $conn = conectarDB(); mysql_query("UPDATE eventos SET\nfecha_e='{$fecha}', \nhora_e='{$hora}',\ntipo_e='{$causa}',\ndelegacion_e='{$deleg}', \nmunicipio_e='{$muni}', \npoblacion_e='{$pobla}', \ncolonia_e='{$colon}', \ncalle_e='{$calle}', \nnumero_e='{$nume}', \ninstalacion_e='{$insta}', \ntipoinst_e='{$tinst}', \nsiglasinst_e='{$siglas}', \nmontod_e='{$montoaf}', \nentidad_ap='{$entidap}', \ndetenidos_e='{$deten}', \nbienesaf_e='{$bienaf}', \nservaf_e='{$seraf}',\ncp_e='{$codpos}'\nWHERE id_e ='{$numero}'"); echo "Se guardo el registro"; desconectarDB($conn); ?>
} </style> <script language="JavaScript"> </script> </head> <body> <?php include "funcionesComunes.php"; $conexion = conectarDB(); $Query = "SELECT A.*, C.NombreCargo, R.nombre FROM altas A inner join cargos C on C.idCargo = A.sol_cargo " . "inner join roles R on R.idRol = A.al_rol " . "WHERE idReg = " . $_GET["id"]; $Res = mysql_query($Query, $conexion); $row = mysql_fetch_array($Res); ?> <br/> <table class="tabla"> <tr><td><H3>Colegio<H3></td></tr> <tr> <td><label class="tipo">Nombre =</label></td> <td><label class="dato"><?php echo $row['col_nombre']; ?> </label></td> </tr>
/** * Realiza una transaccion de multiples consultas<br> * Al iniciar la transaccion se deshabilita el modo Autocommit de la * DB impidiendo que las transacciones queden permanentemente en memoria<br> * Si TODAS las transacciones fueron exitosas, se realiza el COMMIT de todo * el proceso. <br>De lo contrario se realiza un ROLLBACK para dejar todo en * su estado anterior * @param array $arrayQuery <p>Array con todas las consultas que se desean ejecutar</p> * @return boolean <b>TRUE</b> si se realizo el COMMIT <br><b>FALSE</b> si se realizo el ROLLBACK */ function ejecutarTransaccion($arrayQuery) { global $archivoPHP; $retorno = false; $procesoOK = true; $conn = conectarDB(); if ($conn != false) { mysql_query("BEGIN"); foreach ($arrayQuery as $query) { //$query = @mysql_real_escape_string($query); $resultado = mysql_query($query); if ($resultado == false) { $procesoOK = false; gestionarError($archivoPHP, mysql_error(), $query); break; } } if ($procesoOK == true) { mysql_query("COMMIT"); $retorno = true; } else { mysql_query("ROLLBACK"); $retorno = false; } desconectarDB($conn); } else { //Este error ya esta contemplado en la funcion conectarDB $retorno = false; } return $retorno; }
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="es"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <script type="text/javascript" src="librerias/Libreria.js" language="javascript"></script> <link rel="stylesheet" type="text/css" href="css/estilo.css"> <title>Sistema de Registro de Entrada y Salida, Lineas Unidas</title> </head> <body> <?php include_once "librerias/Libreria.php"; conectarDB(); ?> <div id="header" align="center"> <?php addHeader(); ?> </div> <div id="main" align="center"> <?php if ($Cedula != null and $Clave == null) { $check = updateAsistencia($Cedula); } elseif ($Cedula != null and $Clave != null) { $check = initControlAsistencia($Cedula, $Clave); } elseif ($Control == "1") { initLoginControl(); } elseif ($persona != null and ($mes >= 0 or $fecha1 != null and $fecha2 != null)) { $check = showControlAsistencia($persona, $mes, $fecha1, $fecha2); } else { addMainRegister(); }
<?php include "../_coneccion/conectarDB.php"; $cn = conectarDB(); include "../_config/Globales.php"; if (isset($_POST["txhId"])) { $nId = $_POST["txhId"]; } else { $nId = ""; } if (isset($_POST["txtnombre"])) { $nombre = $_POST["txtnombre"]; } else { $nombre = ""; } if (isset($_POST["txtcorreo"])) { $correo = $_POST["txtcorreo"]; } else { $correo = ""; } if (isset($_POST["txtcorreo1"])) { $correo1 = $_POST["txtcorreo1"]; } else { $correo1 = ""; } if (isset($_POST["txtConsulta"])) { $comment = $_POST["txtConsulta"]; } else { $comment = ""; } if (isset($_POST["txtRespuesta"])) {
public function __construct() { $this->_db = conectarDB(); }
<?php include_once 'config.php'; include_once 'funciones.php'; include_once 'View.php'; require_once 'GoogleAuthenticator.php'; $usuario = $_POST['user']; $clave = sha1($_POST['pass']); $ga = new PHPGangsta_GoogleAuthenticator(); $token = $ga->createSecret(); $coneccion = conectarDB($parametrosGlobales['db']); $resultado = $coneccion->query("INSERT INTO usuario (`user`, `pass`, `token`) VALUES ('{$usuario}', '{$clave}', '{$token}')"); if (!$resultado) { echo "Falló la creación del usuario: (" . $coneccion->errno . ") " . $coneccion->error; } else { $ultimoID = $coneccion->insert_id; header("Location: verUsuario.php?id={$ultimoID}"); } ?> <br><br><br><a href="index.php">Ir al Login</a>
function consultanombreenbd($nombreconsulta) { global $tipoDB; if ($tipoDB === 'sqlite') { $conexion = conectarDBnombres(); } else { if ($tipoDB === 'mysql') { $conexion = conectarDB(); } } $rsql = $conexion->query("SELECT * FROM nombresobjetos WHERE codigo like '%%" . $nombreconsulta . "%%' OR numerico like '%%" . $nombreconsulta . "%%' OR nombre like '%%" . $nombreconsulta . "%%'"); if ($tipoDB === 'sqlite') { $fila = $rsql->fetchArray(); } else { if ($tipoDB === 'mysql') { $rsql->data_seek(0); $fila = $rsql->fetch_assoc(); } } // $rsql -> data_seek(0); // $fila = $rsql->fetch_assoc(); if (count($fila) > 0) { $filabuena = array_values($fila); } else { $filabuena = array('', '', ''); } return $filabuena; }