PHP - problemas con mi calculadora de impuestos.

 
Vista:

problemas con mi calculadora de impuestos.

Publicado por Jorge (2 intervenciones) el 04/06/2013 05:16:59
Buenas noches

realice este codigo de una calculadora de impuestos y cargos aduaneros pero no me realiza los calculos por alguna razon si me pueden ayudar con el problema.

Gracias.

Codigo:( Dreamweaver)

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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>
<body>
<?php
$estado=$_POST["form3"];
$categoria=$_POST["form4"];
$peso=$_POST["form2"];
$valor=$_POST["form1"];
$envio= (1.1 * $peso);
$flete1= 9;
$flete2= (($peso*4)-9);
$flete=($flete1+$flete2);
$costo=($flete+$envio);
$seguro=3;
$iropa=($valor*0.4*0.3);
$ielec=($valor*0.6*0.3);
$icasa=($valor*0.4*0.3);
$icel=($valor*0.6*0.3);
$iotros=($valor*0.4*0.3);
$manejo=(($valor*0.1)+(1.51*$peso)+($valor*0.07));
$total=$costo+$seguro+$manejo
?>
 
<table width="306" border="0">
  <tr>
    <td width="131">Estado:</td>
    <td width="165"><form id="form3" name="form3" method="post" action="">
      <label>
        <select name="select">
          <option>Cali</option>
          <option>Bogota</option>
          <option>Barranquilla</option>
        </select>
        </label>
    </form>    </td>
  </tr>
  <tr>
    <td>Categoria:</td>
    <td><form id="form4" name="form4" method="post" action="">
      <label>
        <select name="select2">
          <option>Ropa</option>
          <option>Casa y cosina</option>
          <option>Electrodo</option>
          <option>Computadoras</option>
          <option>Celulares</option>
          <option>Otros</option>
        </select>
        </label>
    </form>    </td>
  </tr>
  <tr>
    <td>Valor (USD) : </td>
    <td><form id="form1" name="form1" method="post" action="">
      <label>
        <input type="text" name="textfield" />
        </label>
    </form>    </td>
  </tr>
  <tr>
    <td>Peso en Libras : </td>
    <td><form id="form2" name="form2" method="post" action="">
      <label></label>
      <label>
      <input type="text" name="textfield2" />
      </label>
    </form>    </td>
  </tr>
  <tr>
    <td><form id="form5" name="form5" method="post" action="">
      <label></label>
      <label></label>
      <input type="submit" name="Submit" value="Calcular" />
      <label></label>
    </form>    </td>
    <td><form id="form6" name="form6" method="post" action="">
      <label>
        <input type="reset" name="Submit2" value="Borrar" />
        </label>
    </form>
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>Costo de envio: </td>
    <td><p><?php
	echo "$costo";
 
	?></p></td>
  </tr>
  <tr>
    <td>Impuesto:</td>
    <td><?php
	if ($valor > 100 && $categoria == "Ropa")
	{
	 echo "$iropa";
	}
	if ($valor < 100 && $categoria == "Ropa")
	{
	echo "3";
	}
	if ($valor > 100 && $categoria == "electrodo")
	{
	 echo "$ielec";
	}
	if ($valor < 100 && $categoria == "electrodo")
	{
	echo "15";
	}
		if ($valor > 100 && $categoria == "casa")
	{
	 echo "$icasa";
	}
	if ($valor < 100 && $categoria == "casa")
	{
	echo "9";
	}
		if ($scategoria == "computadoras")
	{
	 echo "Libre de Impuesto";
	}
		if ($valor > 100 && $categoria == "celulares")
	{
	 echo "$icel";
	}
	if ($valor < 100 && $categoria == "celulares")
	{
	echo "No Aplica";
	}
		if ($valor > 100 && scategoria == "otros")
	{
	 echo "$iotros";
	}
	if ($valor < 100 && $categoria == "otros")
	{
	echo "No aplica";
	}
	?></td>
  </tr>
  <tr>
    <td>Seguro:</td>
    <td><p><?php
	echo "$seguro";
 
	?>
	</td>
  </tr>
  <tr>
    <td>Cargo por Manejo*: </td>
    <td><?php
	echo "$manejo";
 
	?></td>
  </tr>
  <tr>
    <td>Total:</td>
    <td><?php if ($categoria == "ropa")
	{
	$total= $total+iropa;
	 echo "$total";
	}
	if ($categoria == "electrodo")
	{
	$total= $total+ielec;
	 echo "$total";
	}
		if ($categoria == "casa")
	{
	$total= $total+icasa;
	 echo "$total";
	}
		if ($categoria == "computadoras")
	{
	$total= $total+icomp;
	 echo "$total";
	}
		if ($categoria == "celulares")
	{
	$total= $total+icel;
	 echo "$total";
	}
		if ($categoria == "otros")
	{
	$total= $total+iotros;
	 echo "$total";
	}
	?></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
</table>
<div align="center"></div>
</body>
</html>
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder
Imágen de perfil de xve
Val: 3.943
Oro
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

problemas con mi calculadora de impuestos.

Publicado por xve (6935 intervenciones) el 04/06/2013 07:32:55
Hola Jorge, que error te da? o que debería de hacer que no hace? si nos puedes indicar con detalle.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

problemas con mi calculadora de impuestos.

Publicado por Jorge (2 intervenciones) el 04/06/2013 16:40:27
No me esta mostrando los cálculos en la pantalla. le doy al botón calcular, pero no me regresa los resultados.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar