Generar Qr de una página con variable
Publicado por Zarza (1 intervención) el 29/09/2021 06:43:44
Buenos días, estoy intentando generar un codigo QR de una dirección con variables. Cuando me genera el QR lo hace sin la variable de esa página. ( la variable es $fila['no'],)
Necesitaría ayuda de cómo hacerlo.
Gracias de antemano.
<?php
$consulta=ConsultarProducto($_GET['no']);
function ConsultarProducto( $no_prod )
{
include 'conexion.php';
$sentencia="SELECT * FROM pedidosyrutas WHERE no='".$no_prod."' ";
$resultado= $conexion->query($sentencia) or die ("Error al consultar producto".mysqli_error($conexion));
$fila=$resultado->fetch_assoc();
return [
$fila['no'],
$fila['entrega'],
$fila['zona'],
$fila['cliente'],
$fila['comercial'],
$fila['descarga'],
$fila['pedido']
];
}
?>
<!DOCTYPE html>
<html><head>
<style type="text/css" media="print">
@page {
size: auto; /* auto is the initial value */
margin-bottom: 0mm; /* this affects the margin in the printer settings */
}
</style>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ETIQUETA</title>
<style type="text/css" media="print">
@media print {
#noprint {display:none;}
#parte2 {display:none;}
}
</style>
</style>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style type="text/css">
#pedido {
font-family: arial, verdana, ms sans serif;
font-size: 14pt;
width:375px;
}
</style>
<body>
<BODY onLoad="window.print()">
<div class="todo">
<div id="cabecera"></div>
<div id="contenido">
<div style="margin: auto; width: 800px; border-collapse: separate; border-spacing: 10px 5px;">
<span>
<p class="text-danger">
<img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://panelesalcalat.com/almacen_camioneros/modif_prod1.php?no=$fila['no']" width="90" height="90" alt="Código QR" >
</span>
</body>
</html>
Necesitaría ayuda de cómo hacerlo.
Gracias de antemano.
<?php
$consulta=ConsultarProducto($_GET['no']);
function ConsultarProducto( $no_prod )
{
include 'conexion.php';
$sentencia="SELECT * FROM pedidosyrutas WHERE no='".$no_prod."' ";
$resultado= $conexion->query($sentencia) or die ("Error al consultar producto".mysqli_error($conexion));
$fila=$resultado->fetch_assoc();
return [
$fila['no'],
$fila['entrega'],
$fila['zona'],
$fila['cliente'],
$fila['comercial'],
$fila['descarga'],
$fila['pedido']
];
}
?>
<!DOCTYPE html>
<html><head>
<style type="text/css" media="print">
@page {
size: auto; /* auto is the initial value */
margin-bottom: 0mm; /* this affects the margin in the printer settings */
}
</style>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>ETIQUETA</title>
<style type="text/css" media="print">
@media print {
#noprint {display:none;}
#parte2 {display:none;}
}
</style>
</style>
<link href="css/bootstrap.css" rel="stylesheet" type="text/css">
<!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<style type="text/css">
#pedido {
font-family: arial, verdana, ms sans serif;
font-size: 14pt;
width:375px;
}
</style>
<body>
<BODY onLoad="window.print()">
<div class="todo">
<div id="cabecera"></div>
<div id="contenido">
<div style="margin: auto; width: 800px; border-collapse: separate; border-spacing: 10px 5px;">
<span>
<p class="text-danger">
<img src="https://chart.googleapis.com/chart?chs=150x150&cht=qr&chl=https://panelesalcalat.com/almacen_camioneros/modif_prod1.php?no=$fila['no']" width="90" height="90" alt="Código QR" >
</span>
</body>
</html>
Valora esta pregunta


0