<?php
include_once '../php/config.php';
$id = $_POST["id_venta"];

?>

		   <div class="table-responsive border p-3">

					<table class="table"  style="width: 100%; font-weight:lighter;">


              <th>Monto</th>

              <th>Fecha</th>
              <th>Hora </th>
			 <th>Usuario</th>
              <th>Editar</th>


						<tbody>
            <?php
			
		
			$sql3 = mysql_query("select * from pagos_credito where id_factura='$id' order by fecha desc") or die(mysql_error());
			while($r=mysql_fetch_array($sql3)){?>
			<?php
			$c++;
			$monto+=$r["monto"];
			
			$id = $r["id"];
			?>
							<tr>

			<td><?php echo decimal($r["monto"])?></td>
                <td><?php echo fecha($r["fecha"])?></td>
				<td><?php echo ($r["hora"])?></td>
                <td><?php echo ($r["usuario"])?></td>


				

               <td><a class="text-rojo" href="#"  onClick='borrar(<?php echo $r["id"]?>)'><i class="bi bi-trash"></i> </a></td>


            </tr>
                                                        <?php }?>
						</tbody>
					</table>
        </form>
					<hr>
					
					<input type="hidden" id="tcosto" name="tcosto" value="<?php echo ($costo);?>">
					<input type="hidden" id="tprecio" name="tprecio" value="<?php echo ($precio);?>">
					
					
					<b>CANT. PAGOS:</b> <?php echo $c;?> |
					 <b>TOTAL:</b> <?php echo @decimal($monto);?>
					
				</div>
			