PHP - pasar variable con POST

 
Vista:
sin imagen de perfil
Val: 557
Bronce
Ha mantenido su posición en PHP (en relación al último mes)
Gráfica de PHP

pasar variable con POST

Publicado por zendi (1056 intervenciones) el 16/08/2016 01:21:51
Estoy llamando un formulario a traves de otro formulario y lo esta haciendo, pero el grafico no se imprime

Este es el primer formulario desde donde envio el name (anio) año.

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
<?php
$conn_string = "host=localhost port=5432 dbname=pediatria user=postgres password=movilnet";
 
$connect = pg_connect($conn_string);
 
?>
<!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>
<title>Mantenimiento y Revisión</title>
	<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
      <script language="JavaScript" src="calendario.js"></script>
      <script language="JavaScript" src="overlib_mini.js"></script>
<!-- Este script permite Máscara de entrada de la fecha (en 
./) -->
 
</head>
<style type="text/css">
  .sr {
    background-color: #FFFFCF;
    color: #000000;
    font-family: Arial;
    font-size: 12px;
  }
</style>
<body>
   <div id="overDiv" style="position:absolute; z-index:1000;"></div>
<form  name="form1" action="examples\3d-column-interactive\kip.php" method="POST"><fieldset style="width:auto"><LEGEND>Listados por Fecha y Ubicación</LEGEND>
<TABLE align="center" class="div1">
<!--<TR>
	<td>Hasta</td>
    <td><input type="text" size=10 maxlength=10 name="fechah" onKeyUp="mascara(this,'-',patron,true)" ; onFocus="siguienteCampo ='direccion'"><a href=javascript:show_calendar('form1.fechah'); onMouseOver="window.status='Date Picker'; overlib('Haga Click aqui para escoger una fecha del calendario.'); return true;" onMouseOut="window.status=''; nd(); return true;"><img src="iconos/calendar.gif" align=center width=24 height=22 border=0></a></td>
</TR>-->
<TR>
	<td>Año de Revisión:</td>
    <td><input type="text" size=4 maxlength=4 name="anio"></td>
</TR>
   <tr>
      <td><input TYPE="submit" NAME="buscar" VALUE="Buscar"></td>
      <td><INPUT TYPE="BUTTON" VALUE="Salir" ONCLICK="window.location.href='menu.html'">
   </TD>
   </tr>
</TABLE>
</fieldset><br />
</form>
</body>
</html>

y este es el que recibe:

la idea es crear el grafico por años de manera que si el usuario pide el año 2015 solo debe traerlo.

Si alguien puede ayudarme por favor.
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
204
205
206
207
208
<?php
error_reporting(E_ALL ^ E_WARNING ^ E_NOTICE);
$conn_string = "host=localhost port=5432 dbname=pediatria user=postgres password=movilnet";
 
$connect = pg_connect($conn_string);
 
 
$anio = $_POST['anio'];
 
 
$result = "SELECT fecha, peso, talla, circunfcefalica, circunfbrazo FROM consultas WHERE substring(public.consultas.fecha::text,0,4) = '$anio'";
 
$res=@pg_query($connect,$result);
 
while($registros = pg_fetch_array($res))
 
{
 
  $data[] = "[{$registros['fecha']},{$registros['peso']},{$registros['talla']},{$registros['circunfcefalica']},{$registros['circunfbrazo']}]";
 
  echo  $data;
 
}
?>
 
<!DOCTYPE HTML>
 
<html>
 
    <head>
 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
 
        <title>Highcharts Example</title>
 
        <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
 
        <style type="text/css">
 
#container, #sliders {
 
    min-width: 310px;
 
    max-width: 800px;
 
    margin: 0 auto;
 
}
 
#container {
 
    height: 400px;
 
}
 
        </style>
 
        <script type="text/javascript">
 
$(function () {
 
    // Set up the chart
 
    var chart = new Highcharts.Chart({
 
        chart: {
 
            renderTo: 'container',
 
            type: 'column',
 
            options3d: {
 
                enabled: true,
 
                alpha: 15,
 
                beta: 15,
 
                depth: 50,
 
                viewDistance: 25
 
            }
 
        },
 
        title: {
 
            text: 'Chart rotation demo'
 
        },
 
        subtitle: {
 
            text: 'Test options by dragging the sliders below'
 
        },
 
         xAxis: {
                    categories: ['Peso', 'Talla', 'Circunferencia Cefálica', 'Brazo']
                },
 
        plotOptions: {
 
            column: {
 
                depth: 25
            }
 
        },
 
 
series: [<?php for($i=0,$s=count($data);$i<$s;$i++) {
 
    echo "{data: {$data[$i]}}";
 
    if (($i+1)!=$s) echo ',';
 
}?>]
 
 
 
    });
 
 
 
    function showValues() {
 
        $('#alpha-value').html(chart.options.chart.options3d.alpha);
 
        $('#beta-value').html(chart.options.chart.options3d.beta);
 
        $('#depth-value').html(chart.options.chart.options3d.depth);
 
    }
 
 
 
    // Activate the sliders
 
    $('#sliders input').on('input change', function () {
 
        chart.options.chart.options3d[this.id] = this.value;
 
        showValues();
 
        chart.redraw(false);
 
    });
 
 
 
    showValues();
 
});
 
        </script>
 
    </head>
 
    <body>
 
<script src="https://code.highcharts.com/highcharts.js"></script>
 
<script src="https://code.highcharts.com/highcharts-3d.js"></script>
 
<script src="https://code.highcharts.com/modules/exporting.js"></script>
 
 
 
<div id="container"></div>
 
<div id="sliders">
 
    <table>
 
        <tr>
 
            <td>Alpha Angle</td>
 
            <td><input id="alpha" type="range" min="0" max="45" value="15"/> <span id="alpha-value" class="value"></span></td>
 
        </tr>
 
        <tr>
 
            <td>Beta Angle</td>
 
            <td><input id="beta" type="range" min="-45" max="45" value="15"/> <span id="beta-value" class="value"></span></td>
 
        </tr>
 
        <tr>
 
            <td>Depth</td>
 
            <td><input id="depth" type="range" min="20" max="100" value="50"/> <span id="depth-value" class="value"></span></td>
 
        </tr>
 
    </table>
 
</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