ayuda para que al ejecutar un boton ejecute un update
Publicado por cesar (24 intervenciones) el 13/11/2015 17:26:17
hola buenas tardes tengo el siguiente codigo el cual todo funciona pero el update se ejecuta solo lo cual no deseo que sea asi quiero que al ejecutar un boton hay si realice el update.
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
<?php
include("../prueba/conexion2.php");
$link = Conectarse();
$liquidado="$row[9]";
$suma=0;
if(isset($_POST["btn1"])){
$btn=$_POST["btn1"];
$bus=$_POST["txtbus"];
if($btn=="Buscar"){
$result = mysql_query("SELECT * FROM servicios WHERE Domiciliario = '$bus' ORDER BY Fecha ASC", $link);
$numero = mysql_num_rows($result);
if ($row[9]=0){
echo "ya liquido" ;}
else {
echo "<table width='100%' border='1'>";
echo "<tr>";
echo "<th>Servicio</th>";
echo "<th>Cliente</th>";
echo "<th>Descripcion</th>";
echo "<th>Valor</th>";
echo "<th>Fecha</th>";
echo "</tr>";
$nom=0;
$sql="update servicios set Liquidar='$nom' where servicio='$row[0]'";
$cs=mysql_query($sql,$cn);
while ($row = mysql_fetch_row($result)){
echo "<tr>";
echo "<td >$row[0]</td>";
echo "<td >$row[2]</td>";
echo "<td >$row[6]</td>";
echo "<td width='5%'>$row[7]</td>";
echo "<td width='19%'>$row[1]</td>";
echo "</tr>";
$suma = $suma+$row[7];
$n1="$suma";
$n2=$_POST["txtbus2"];
$por="";
$cen="";
$n3=100;
$n4="";
$por = $n1*$n2;
$cen = $por/$n3;
$n4 = $suma-$cen;
}
echo "</table>";
echo "<br>";
echo "<th>Domiciliario:</th>";
echo "<td>$bus</td>";
echo "<br>";
echo "<th>Servicios Realizados:</th>";
echo "<td>$numero</td>";
echo "<br>";
echo "<th>Total Servicios:</th>";
echo "<td>$suma</td>";
echo "<br>";
echo "<th>Ganancia Mensajero:</th>";
echo "<td>$n4</td>";
echo "<br>";
echo "<th>Valor a Pagar:</th>";
echo "<td>$cen</td>";
}
}
}
?>
Valora esta pregunta
0