public function modificarCertificado($idEdicion, $idCertificado, $firmaFacilitador, $firmasExras, $fondo, $logoExtra) { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "UPDATE certificados SET\r\n\t\t\t\t\tfirma_facilitador = '{$firmaFacilitador}',\r\n\t\t\t\t\tfirmas_extras = '{$firmasExras}',\r\n\t\t\t\t\tfondo = '{$fondo}',\r\n\t\t\t\t\tlogo_extra = '{$logoExtra}'\r\n\t\t\t\t\tWHERE id_edicion = '{$idEdicion}' and id_certificado = '{$idCertificado}'"; $retorna = $GBD->insertarQuery($query); $GBD->cerrarConexion(); return $retorna; }
public function restablecerClave($idUsuario) { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "UPDATE usuarios SET clave = '123456', estado = 'restablecer' WHERE id_usuario = '{$idUsuario}'"; $idGenerado = $GBD->insertarQuery($query); $GBD->cerrarConexion(); return $idGenerado; }
private static function _usuarioEstadoActual() { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "SELECT estado FROM usuarios WHERE id_usuario = '" . $_SESSION['session']['id'] . "'"; $datosQuery = $GBD->resultadoQuery($query); $GBD->cerrarConexion(); return $datosQuery[0]['estado']; }
public function modificarPersona($id, $documento, $nombre, $apellido, $sexo, $fechaNacimiento, $telefono, $direccion, $correo) { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "UPDATE personas SET documento = '{$documento}', nombre = '{$nombre}', apellido = '{$apellido}', sexo = '{$sexo}',\r\n\t\t\t\t\tfecha_nacimiento = '{$fechaNacimiento}', telefono = '{$telefono}', direccion = '{$direccion}', correo = '{$correo}'\r\n\t\t\t\t\tWHERE id_persona = '{$id}'"; $idGenerado = $GBD->insertarQuery($query); $GBD->cerrarConexion(); return $idGenerado; }
function cargarUsuario($id) { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "SELECT * FROM usuarios WHERE id_usuario = '" . $id . "'"; $retorna = $GBD->resultadoQuery($query); $GBD->cerrarConexion(); return $retorna; }
public function registrarMensaje($idusuario, $asunto, $mensaje) { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "INSERT INTO contacto \n\t\t\t\t\t(id_usuario, asunto, mensaje) \n\t\t\t\t\tVALUES \n\t\t\t\t\t('{$idusuario}', '{$asunto}', '{$mensaje}')"; $idGenerado = $GBD->insertarQuery($query); $GBD->cerrarConexion(); return $idGenerado; }
public function modificarIdentificador($idEdicion, $idIdentificador, $fondo) { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "UPDATE identificadores SET\r\n\t\t\t\t\tfondo = '{$fondo}'\r\n\t\t\t\t\tWHERE id_edicion = '{$idEdicion}' and id_identificador = '{$idIdentificador}'"; $retorna = $GBD->insertarQuery($query); $GBD->cerrarConexion(); return $retorna; }
public function dameEdicion($idCurso, $idEdicion) { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "SELECT * FROM ediciones WHERE id_curso = '{$idCurso}' and id_edicion='{$idEdicion}'"; $retorna = $GBD->resultadoQuery($query); $GBD->cerrarConexion(); return $retorna; }
public function eventosPasados() { $GBD = new baseDatosGestor(); $GBD->abrirConexion(); $query = "SELECT e.*, \r\n\t\t\t\t\tp.id_persona AS p_id_persona, p.documento AS p_documento, p.nombre AS p_nombre, p.apellido AS p_apellido, p.sexo AS p_sexo, p.fecha_nacimiento AS p_fecha_nacimiento, p.telefono AS p_telefono, p.direccion AS p_direccion,\r\n\t\t\t\t\tc.id_curso AS e_id_curso, c.nombre AS e_nombre, c.descripcion AS e_descripcion\r\n\t\t\t\t\tFROM ediciones AS e\r\n\t\t\t\t\tLEFT JOIN personas AS p ON e.id_facilitador = p.id_persona \r\n\t\t\t\t\tLEFT JOIN cursos AS c ON e.id_edicion = c.id_curso WHERE NOW() > fecha_inicio\r\n\t\t\t\t\tORDER BY fecha_inicio DESC LIMIT 5"; $retorna = $GBD->resultadoQuery($query); $GBD->cerrarConexion(); return $retorna; }
public function generarHtmlCertificado($imprimir, $codigoGenerado, $tituloCurso, $duracionEdicion, $fechaEdicion, $nombreFacilitador) { //Instanciando Librería para hacer el codigo QR. $GBD = new baseDatosGestor(); $miFondo = 'background: url("recursos/certificados/' . $this->_fondo . '") no-repeat'; $valorLogoExtra = $this->dameLogoExtra(); $qr = '<div id="qr"></div>'; if ($valorLogoExtra != 'ninguno') { $miLogoExtra = '<div class="logo"><img src="recursos/certificados/' . $this->_logoExtra . '"></img></div>'; } else { $miLogoExtra = ''; } $firmasExtras = $this->dameFirmasExtras(); if (empty($firmasExtras)) { $numeroDeFrimas = 1; } else { $numeroDeFrimas = count(explode('(#=P=#)', $firmasExtras)) + 1; } $tamanoTdFirma = 1000 / $numeroDeFrimas; $tamanoTdFirma = floor($tamanoTdFirma); $colFirmantes = explode('(#=P=#)', $firmasExtras); $tdFirmantes = ''; $tdFirmantesCargos = ''; $firmaFacilitador = $this->dameFirmaFacilitador(); list($calificativoFacilitador, $cargoFacilitador) = explode('(#=D=#)', $firmaFacilitador); $tdFirmantes .= '<td class="firmante">' . $calificativoFacilitador . ' ' . $nombreFacilitador . '</td>'; $tdFirmantesCargos .= '<td class="firmante">' . $cargoFacilitador . '</td>'; foreach ($colFirmantes as $firma) { list($calificativo, $nombre, $cargo) = explode('(#=D=#)', $firma); $tdFirmantes .= '<td class="firmante">' . $calificativo . ' ' . $nombre . '</td>'; $tdFirmantesCargos .= '<td class="firmante">' . $cargo . '</td>'; } foreach ($imprimir as $persona) { $nombre = $persona['nombre']; $documento = $persona['documento']; $tipo = $persona['tipo']; $idPersona = $persona['id']; if ($tipo == 'facilitador') { $datoTipo = 'COMO FACILITADOR'; } else { if ($tipo == 'participacion') { $datoTipo = 'POR SU PARTICIPACIÓN'; } elseif ($tipo > 59) { $datoTipo = 'POR APROBACIÓN'; } elseif ($tipo < 60 and $tipo > 0) { $datoTipo = 'POR PARTICIPACIÓN'; } elseif ($tipo == 0) { //NADA } else { exit("ERROR: NINGUN TIPO DE CERTIFICADO COINCIDE"); } } if ($tipo != 0 or $tipo == 'facilitador' or $tipo == 'participacion') { //link $explode = $GBD->dameURL(); $enlace = explode("?", $explode); $linkk = $enlace[0] . "verificacionCod.php?id=" . $codigoGenerado . "-" . $idPersona; qrcode::link($linkk); $link = qrcode::get_link(); $cuerpoRepetitivo .= '<div class="cuerpoCompleto"> <table class="cabesera"> <tr> <td class="lado" align="center"> <div class="logo"> <img src="recursos/logoUPTA.jpeg"></img> </div> </td> <td class="centro"> <p style="font-size: 20px; margin: 0px;" > REPÚBLICA BOLIVARIANA DE VENEZUELA<br/> MINISTERIO DEL PODER POPULAR PARA LA EDUCACIÓN UNIVERSITARIA<br/> UNIVERSIDAD POLITÉCNICA TERRITORIAL DEL ESTADO ARAGUA "FEDERICO BRITO FIGUEROA" <br/> </td> <td class="lado" align="center"> ' . $miLogoExtra . '</td> </tr> <tr> <td class="lado"> </td> <td class="centro" style="font-size: 22px;"> <br/><br/> <div class="tituloCurso"> OTORGA EL PRESENTE CERTIFICADO<br/> ' . $datoTipo . ' A: <br/><br/> <p style="font-size: 36px; margin: 0px;" >' . $nombre . ' </p> <p style="font-size: 32px; margin: 0px;" >' . $documento . '</p><br/> <p style="font-size: 32px; margin: 0px;">' . $tituloCurso . '</p> </div><br/> <p style="font-size: 20px; margin: 0px;">Venezuela - Estado Aragua<br/> DURACIÓN: ' . $duracionEdicion . '<br/> ' . $fechaEdicion . '</p> </td> <td class="lado"> </td> </tr> </table> <table class="firmas" style="font-size: 22px;"> <tr> ' . $tdFirmantes . ' </tr> <tr> ' . $tdFirmantesCargos . ' </tr> </table> <div class="codigoQR"> <img src=' . $link . ' border="0"/> </div> <table class="codigoGenerado"><tr><td><p style="font-size: 20px; margin: 0px;">Código Verificación: ' . $codigoGenerado . '-' . $idPersona . '</p></td></tr></table> </div>'; } } $htmlPDF = ' <html> <head> <script type="text/javascript" src="media/js/jquery/qrcode.js"></script> <style type="text/css"> body * { overflow: hidden; font-family: kartika; font-weight: bold; } @page { margin: 0px; } body { margin: 0px; ' . $miFondo . ' } div.cuerpoCompleto { margin: 0px; width: 1000px; height: 700px; } table { width: 1000px; padding: 50px; } div.tituloCurso { font-size: 16; } table.cabesera { position:absolute; left:0px; top:0px; } table.firmas { position:absolute; left:0px; top:600px; } div.logo { width: 150px; height: 120px; } table td.lado { padding-top:30px; width: 150px; height: 120px; } table td.centro { width: 700px; height: 100px; text-align: center; } table td.firmante { width: ' . $tamanoTdFirma . 'px; text-align: center; vertical-align: text-top; } table.codigoGenerado { position: absolute; top: 700px; left: 0px; width: 1100px; } div.codigoQR img{ position: absolute; top: 680px; float: right; right: 40%; } table.codigoGenerado td { text-align: center; } </style> </head> <body onload="update_qrcode()"> ' . $html1 . $cuerpoRepetitivo . ' </body> </html>'; return $htmlPDF; }