mostrar datos del cliente seleccionado en mi ventana emergen
Publicado por Elizabeth Laguna (8 intervenciones) el 19/12/2019 16:49:37
como puedo poner la instruccion en este codigo php para que me muestre solo datos del cliente seleccionado me pueden ayudar por favor
ESTO ES LO QUE HACE MI BOTÓN DE AGREGAR Y EL CTE LO SELECCIONO ANTES DE AGREGAR CON ESTE BOTÓN
ESTO ES LO QUE HACE MI BOTÓN DE AGREGAR Y EL CTE LO SELECCIONO ANTES DE AGREGAR CON ESTE BOTÓN
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<?php
include('is_logged.php');//Archivo verifica que el usario que intenta acceder a la URL esta logueado
$session_id= session_id();
if (isset($_POST['id'])){$id=$_POST['id'];}
if (isset($_POST['cantidad'])){$cantidad=$_POST['cantidad'];}
if (isset($_POST['precio_venta'])){$precio_venta=$_POST['precio_venta'];}
/* Connect To Database*/
require_once ("../config/db.php");//Contiene las variables de configuracion para conectar a la base de datos
require_once ("../config/conexion.php");//Contiene funcion que conecta a la base de datos
//Archivo de funciones PHP
include("../funciones.php");
if (!empty($id) and !empty($cantidad) and !empty($precio_venta))
{
$insert_tmp=mysqli_query($con, "INSERT INTO tmp (id_producto,cantidad_tmp,precio_tmp,session_id) VALUES ('$id','$cantidad','$precio_venta','$session_id')");
}
if (isset($_GET['id']))//codigo elimina un elemento del array
{
$id_tmp=intval($_GET['id']);
$delete=mysqli_query($con, "DELETE FROM tmp WHERE id_tmp='".$id_tmp."'");
}
$simbolo_moneda=get_row('perfil','moneda', 'id_perfil', 1);
?>
<table class="table">
<tr>
<th class='text-center'>CODIGO</th>
<th class='text-center'>CANT.</th>
<th>DESCRIPCION</th>
<th class='text-right'>PRECIO UNIT.</th>
<th class='text-right'>PRECIO TOTAL</th>
<th></th>
</tr>
<?php
$sumador_total=0;
$sql=mysqli_query($con, "select * from products, tmp where products.id_producto=tmp.id_producto and tmp.session_id='".$session_id."'");
while ($row=mysqli_fetch_array($sql))
{
$id_tmp=$row["id_tmp"];
$codigo_producto=$row['codigo_producto'];
$cantidad=$row['cantidad_tmp'];
$nombre_producto=$row['nombre_producto'];
$precio_venta=$row['precio_tmp'];
$precio_venta_f=number_format($precio_venta,2);//Formateo variables
$precio_venta_r=str_replace(",","",$precio_venta_f);//Reemplazo las comas
$precio_total=$precio_venta_r*$cantidad;
$precio_total_f=number_format($precio_total,2);//Precio total formateado
$precio_total_r=str_replace(",","",$precio_total_f);//Reemplazo las comas
$sumador_total+=$precio_total_r;//Sumador
?>
<tr>
<td class='text-center'><?php echo $codigo_producto;?></td>
<td class='text-center'><?php echo $cantidad;?></td>
<td><?php echo $nombre_producto;?></td>
<td class='text-right'><?php echo $precio_venta_f;?></td>
<td class='text-right'><?php echo $precio_total_f;?></td>
<td class='text-center'><a href="#" onclick="eliminar('<?php echo $id_tmp ?>')"><i class="glyphicon glyphicon-trash"></i></a></td>
</tr>
<?php
}
$impuesto=get_row('perfil','impuesto', 'id_perfil', 1);
$subtotal=number_format($sumador_total,2,'.','');
$total_iva=($subtotal * $impuesto )/100;
$total_iva=number_format($total_iva,2,'.','');
$total_factura=$subtotal+$total_iva;
?>
<tr>
<td class='text-right' colspan=4>SUBTOTAL <?php echo $simbolo_moneda;?></td>
<td class='text-right'><?php echo number_format($subtotal,2);?></td>
<td></td>
</tr>
<tr>
<td class='text-right' colspan=4>IVA (<?php echo $impuesto;?>)% <?php echo $simbolo_moneda;?></td>
<td class='text-right'><?php echo number_format($total_iva,2);?></td>
<td></td>
</tr>
<tr>
<td class='text-right' colspan=4>TOTAL <?php echo $simbolo_moneda;?></td>
<td class='text-right'><?php echo number_format($total_factura,2);?></td>
<td></td>
</tr>
</table>
<div class="form-group row">
<label for="validez" class="col-md-2 control-label" value="">Validez de la oferta:</label>
<div class="col-md-2">
<select class="form-control" id="validez">
<option value='5 días'>5 días</option>
<option value='10 días'>10 días</option>
<option value='15 días' selected>15 días</option>
<option value='30 días'>30 días</option>
<option value='60 días'>60 días</option>
</select>
</div>
<label for="entrega" class="col-md-1 control-label">Tiempo:</label>
<div class="col-md-2">
<input type="text" class="form-control" id="entrega" placeholder="Tiempo de entrega" value="">
</div>
</div>
Valora esta pregunta


0