public function crearLibro($r, $imgLibro, $libro) { try { $pdo = AccesoDB::getConnectionPDO(); //$url = "null" ; if (!isset($r['enlace'])) { $r['enlace'] = ""; } // if(!isset($libro)){ $libro="";} if (!isset($r['Editorial'])) { $r['Editorial'] = ""; } if (!isset($r['Pais'])) { $r['Pais'] = ""; } $sql = 'INSERT INTO cv_Libro(titulo,autor,edicion,FechaLanzamiento,Descripcion,Imagen,Enlace,Archivo,Pais,Editorial,CatalogoDeLibros,Fecha) VALUES("' . $r['titulo'] . '","' . $r['autor'] . '","' . $r['edicion'] . '","' . $r['date'] . '","' . $r['descripcion'] . '","' . $imgLibro . '","' . $r['enlace'] . '","' . $libro . '","' . $r['Pais'] . '","' . $r['Editorial'] . '","' . $r['categorias'] . '",now() )'; // titulo autor edicion date categorias descripcion // echo $sql; $stmt = $pdo->prepare($sql); $stmt->execute(); } catch (Exeption $e) { throw $e; } // fin del catch }
public function datosUsuario($idusuario) { try { $pdo = AccesoDB::getConnectionPDO(); $sql = 'SELECT * FROM mt_usuario WHERE idmtusuario="' . $idusuario . '" '; $stmt = $pdo->prepare($sql); $stmt->execute(); $return = $stmt->fetchAll(); return $return; } catch (Exeption $e) { throw $e; } // fin del catch }
public function verificaRegistro($correo) { try { $pdo = AccesoDB::getConnectionPDO(); $sql = 'SELECT Correo AS email FROM cv_Usuario WHERE Correo="' . $correo . '"'; $stmt = $pdo->prepare($sql); $stmt->execute(); $response = $stmt->fetchAll(); //echo $response[0]['email']; return $response; } catch (Exeption $e) { throw $e; } // fin del catch }
public function registraEncuesta($r) { try { $pdo = AccesoDB::getConnectionPDO(); $ds = ""; // data: { nombre: ("#encuestaid").val() , encuesta: "registra" }, $sql = 'INSERT INTO cv_encuesta(idSesionGrupo,nombre,descripcion,PlantillaSesion,fechaCreacion) VALUES("' . $r['ide'] . '","' . $r['nombre'] . '","' . $ds . '",1, now())'; // echo $sql; $stmt = $pdo->prepare($sql); $stmt->execute(); return $pdo->lastInsertId(); } catch (Exeption $e) { throw $e; } // fin del catch }