I have a page where the bank data is ready, I created an option so that it can print a "wallet" with details of the record but only for the selected line. The problem is that it only prints one by one wasting paper.
I need to create an option so that the user can print more than one record using the checkbox.
Expectedresultafterselectingfourrecords:
Codethatlistsdatabasedata
<?php $cpf_visitado=$ _SESSION[ 'usuarioCpf']; $result_solicitacao="
SELECT tb_movto_visitas.*, tb_cad_visitantes.nom_visitante, tb_cad_motivos.des_motivo, usuarios.nome FROM tb_movto_visitas
LEFT JOIN tb_cad_visitantes ON tb_movto_visitas.tb_cad_visitantes_cod_visitante = tb_cad_visitantes.cpf AND tb_movto_visitas.cod_visitado = tb_cad_visitantes.cpf_visitado
LEFT JOIN tb_cad_motivos ON tb_movto_visitas.tb_cad_motivos_cod_motivo = tb_cad_motivos.cod_motivo
LEFT JOIN usuarios ON tb_movto_visitas.cod_visitado = usuarios.id
WHERE tb_movto_visitas.'cod_visitado' = $cpf_visitado ORDER BY tb_movto_visitas.'sol_visita' DESC " ; $resultado_solicitacao=m ysqli_query($conn, $result_solicitacao); include_once( "adm/../functions.php"); ?>
<div class="container theme-showcase" role="main">
<div class="page-header">
<h1>Solicitações</h1>
</div>
<form name="cad_usuario" class="form-horizontal" method="POST" action="imprime_carteira_lote.php" enctype="multipart/form-data">
<div class="row">
<div class="col-md-12">
<div class="panel">
<div class="panel-body">
<div class="row">
<div class="pull-right">
<a href="colaborador.php?link=22">
<button type='button' class='btn btn-sm btn-success'>Cadastrar</button>
</a>
</div>
</div>
<br>
<div class="row">
<div id="lista_sol2">
<table id="lista_sol" class="table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
<th>Código</th>
<th>Visitante</th>
<th>Responsável</th>
<th>Chegada</th>
<th>Saída</th>
<th>Situação</th>
<th class="text-center">Ação</th>
<th class="text-center">#</th>
</thead>
<tbody>
<?php while ($row_solicitacao=m ysqli_fetch_assoc($resultado_solicitacao)) { ?>
<tr>
<td class="text-center">
<?php echo $row_solicitacao[ "sol_visita"]; ?>
</td>
<td>
<?php echo utf8_encode($row_solicitacao[ "nom_visitante"]); ?>
</td>
<td>
<?php echo utf8_encode($row_solicitacao[ "nom_solicitante"]); ?>
</td>
<td>
<?php echo date( 'd/m/Y', strtotime($row_solicitacao[ "dat_chegada"])); ?>
</td>
<td>
<?php echo date( 'd/m/Y', strtotime($row_solicitacao[ "dat_prev_saida"])); ?>
</td>
<td class="text-left">
<?php $status=$ row_solicitacao[ 'aprovado']; switch ($status) { case "": echo "Pendente"; break; case "A": echo "Aprovada"; break; case "R": echo "Rejeitada"; break; case "F": echo "Fechada"; break; } ?>
</td>
<td class="text-center">
<a href="colaborador.php?link=19&id=<?php echo $row_solicitacao[" sol_visita "]; ?>">
<button type="button" class="btn btn-xs btn-primary">Visualizar</button>
</a>
<?php if ($row_solicitacao[ "aprovado"]=="" && $row_solicitacao[ "dat_prorroga_1"]==n ull) : ?>
<a href="colaborador.php?link=21&id=<?php echo $row_solicitacao[" sol_visita "]; ?>&v1=<?php echo $row_solicitacao["tb_cad_visitantes_cod_visitante "]; ?>">
<button type="button" class="btn btn-xs btn-warning">Editar</button>
</a>
<button type="button" class="btn btn-xs btn-danger bootbox-delete" item-data="<?php echo $row_solicitacao[" sol_visita "]; ?>" id="apagar" name="apagar">Apagar</button>
<?php else : ?>
<button type="button" class="btn btn-xs btn-warning hasTooltip" title="Possui movimentos" disabled="disabled">Editar</button>
<button type="button" class="btn btn-xs btn-danger hasTooltip" title="Possui movimentos" disabled="disabled">Apagar</button>
<?php endif; ?>
<?php if ($row_solicitacao[ "aprovado"]=="A" && $row_solicitacao[ "dat_baixa"]==n ull) : ?>
<a href="colaborador.php?link=8&id=<?php echo $row_solicitacao[" sol_visita "]; ?>&v1=<?php echo $row_solicitacao["tb_cad_visitantes_cod_visitante "]; ?>">
<button type="button" class="btn btn-xs btn-info">Imprimir</button>
</a>
<?php endif; ?>
</td>
<td class="text-center">
<label class="form-checkbox form-normal form-primary form-text">
<input type="checkbox" id="imp_lote" name="imp_lote">
</label>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input type="submit" class="btn btn-success" value="imprimir Selecionados" onclick="return val_cad_nivel_acesso()">
</div>
</div>
</form>
</div>