The problem is this, I want to get 2 fields out of a table.
This is the part of the page that should show the results.
Here is the code for that part:
<div class="panel panel-info">
<div class="panel-heading text-center"><i class="fa fa-refresh fa-2x"></i><h3>Actualizar estado de pedido</h3></div>
<div class="table-responsive">
<table class="table table-bordered">
<thead class="">
<tr>
<th class="text-center">#</th>
<th class="text-center">Fecha</th>
<th class="text-center">Cliente</th>
<th class="text-center">Total</th>
<th class="text-center">Estado</th>
<th class="text-center">Banco</th>
<th class="text-center">Referencia</th>
<th class="text-center">opciones</th>
</tr>
</thead>
<tbody>
<?php
$pedidoU= ejecutarSQL::consultar("select * from venta");
$upp=1;
while($peU=mysql_fetch_array($pedidoU)){
echo '
<div id="update-pedido">
<form method="post" action="process/updatePedido.php" id="res-update-pedido-'.$upp.'">
<tr>
<td>'.$peU['NumPedido'].'<input type="hidden" name="num-pedido" value="'.$peU['NumPedido'].'"></td>
<td>'.$peU['Fecha'].'</td>
<td>';
$conUs= ejecutarSQL::consultar("select * from cliente where NIT='".$peU['NIT']."'");
while($UsP=mysql_fetch_array($conUs)){
echo $UsP['Nombre'];
}
echo '</td>
<td>'.$peU['TotalPagar'].'</td>
<td>
<select class="form-control" name="pedido-status">';
if($peU['Estado']=="Pendiente"){
echo '<option value="Pendiente">Pendiente</option>';
echo '<option value="Entregado">Entregado</option>';
}
if($peU['Estado']=="Entregado"){
echo '<option value="Entregado">Entregado</option>';
echo '<option value="Pendiente">Pendiente</option>';
}
echo '
<td>BANCO</td>
<td>REFERENCIA</td>
</td>
<td class="text-center">
<button type="submit" class="btn btn-sm btn-primary button-UPPE" value="res-update-pedido-'.$upp.'">Actualizar</button>
<div id="res-update-pedido-'.$upp.'" style="width: 100%; margin:0px; padding:0px;"></div>
</td>
</tr>
</form>
</div>
';
$upp=$upp+1;
}
?>
</tbody>
</table>
</div>
Here is an image of the tables and relationships
You have to make certain modifications and of all that is the one that has given me the most problems. I have no idea, I tried doing it with inner join
but it always throws me syntax error or some other error.
The queries are in AJAX , I do not understand that much.