I have a table that shows the records of orders delivered, and to finish the registration there is a "Add referral" button to save the referral in the database. I want to do that when the table reloads and if the referral has value that does not show the button to attach the referral.
This is my query:
$consulta="SELECT * FROM registros where estado = 'entregado'";
$registros=mysqli_query($conexion,$consulta) or die ("Problemas con la consulta");
And here is where I create the rows of the table with the results of the query:
while ($reg=mysqli_fetch_array($registros))
{
$pu = toMoney($reg['pu']);
$padd = toMoney($reg['padd']);
$folio= $reg['id'];
echo "<tr id='head' data-toggle='modal' data-id='$folio' data-target='#orderModal' style='background: #aaffb3; cursor: pointer;'>
<td>".$reg['hora']."</td>
<td>".$reg['cliente']."</td>
<td>".$reg['dir_obra']."<br/>".$reg['indicaciones']."</td>
<td>".$reg['fecha_entrega']."</td>
<td>".$reg['resistencia']." </td>
<td>".$reg['remision']." </td>
<td style='display:none;'>".$reg['m3']." </td>
<td style='display:none;'>".$reg['id']." </td>
<td style='display:none;'>".$reg['metodo_pago']." </td>
<td style='display:none;'>".$reg['fecha_registro']." </td>
<td style='display:none;'>".$pu." </td>
<td style='display:none;'>".$reg['tiro']." </td>
<td style='display:none;'>".$reg['ton']." </td>
<td style='display:none;'>".$reg['elem_colar']." </td>
<td style='display:none;'>".$reg['revenimiento']." </td>
<td style='display:none;'>".$reg['adicionales']." </td>
<td style='display:none;'>".$padd." </td>
<td>
<button class='btn btn-success btn-sm btnRemision' aria-label='Left Align' value='$folio'> Agregar remision</button>
</td>
</tr>";
}
Thank you in advance for your comments.