Файловый менеджер - Редактировать - /home2/cocinasdalloway/public_html/lotes/Home/DetalleEdoCuenta.php
Назад
<?php include("../models/connection/config.php"); mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT); try{ //Crear Objeto para conexion $conexion = new mysqli($host, $user, $pass, $db); } catch (Exception $e) { //echo $e->getMessage(); $arr = array('status' => 100, 'detail' => 'error', 'message' => 'Error de conexion. Contacte a TI'); echo json_encode($arr); exit; } $IdCliente=$_POST['Cliente']; if($IdCliente!=''){ $query_ordenes1 = " SELECT * FROM clientes WHERE numero_cliente='".$IdCliente."'"; $consu_ordenes1 = $conexion -> query($query_ordenes1); $execu_ordenes1 = $consu_ordenes1->fetch_array(MYSQLI_BOTH); ?> <table class="table table-striped"> <thead> <tr> <th>#</th> <th>Cliente</th> <th>Cantidad</th> <th>Fecha</th> </tr> </thead> <tbody> <?php $Total=0; $cont=1; $query_pagos = " SELECT * FROM pagos WHERE numero_cliente = '".$IdCliente."'"; $consu_pagos = $conexion -> query($query_pagos); while($execu_pagos = $consu_pagos->fetch_array(MYSQLI_BOTH)){ ?> <tr> <th scope="row"><?php echo $cont;?></th> <td><?php echo $execu_ordenes1['nombre']; ?></td> <td><?php echo number_format($execu_pagos['cantidad'],2); $Total=$Total+$execu_pagos['cantidad'];?></td> <td><?php echo date('d-m-Y',strtotime($execu_pagos['fecha']))?></td> </tr> <?php $cont++; } $query_ventas = " SELECT * FROM ventas WHERE numero_cliente = '".$IdCliente."'"; $consu_ventas = $conexion -> query($query_ventas); $execu_ventas = $consu_ventas->fetch_array(MYSQLI_BOTH); ?> <tr> <th style="text-align: right;" colspan="2">Pagos:</th> <td><?php echo number_format($Total,2); ?></td> <td></td> </tr> <tr> <th style="text-align: right;" colspan="2">Enganche:</th> <td><?php echo number_format($execu_ventas['enganche'],2); ?></td> <td></td> </tr> <tr> <th style="text-align: right;" colspan="2">Enganche + Pagos:</th> <td><?php echo number_format($Total+$execu_ventas['enganche'],2); ?></td> <td></td> </tr> <tr> <th style="text-align: right;" colspan="2">Precio Lote:</th> <td><?php echo number_format($execu_ventas['precio'],2); ?></td> <td></td> </tr> <tr> <th style="text-align: right;" colspan="2">Saldo:</th> <td><?php echo number_format($execu_ventas['precio']-($Total+$execu_ventas['enganche']),2); ?></td> <td></td> </tr> </tbody> </table> <?php }else{ ?> <table class="table table-striped"> <thead> <tr> <th>ERROR</th> </tr> </thead> <tbody> <tr> <td>No existe ID de cliente</td> </tr> </tbody> </table> <?php } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.2.22 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка