PHP - problema con PHP al cambiar la version

   
Vista:

problema con PHP al cambiar la version

Publicado por Rosy (64 intervenciones) el 28/09/2011 22:03:28
Hola, me vi en la necesidad de instalar una nueva version de wampServer y que viene con PHP 5.3.5, esto probocó que en algunas página que me funcionaban bien con la version anterior (que lamentablemente no recuerdo que version era) ahora no me funcionana del todo bien. por ejemplo

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
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
<html>
<head>
<?php
include("cabecera.html");
?>
<style type="text/css">
<!--
.Estilo1 {color: #990000}
-->
</style>
 
<link rel="STYLESHEET" type="text/css" href="estadistica.css">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /><style type="text/css">
<!--
body {
	background-image: url(img/bg92.gif);
    }
.Estilo1 {
	color: #006699;
	font-weight: bold;
	font-size: 14px  ;
}
-->
</style>
<h1 class="pag_tit">Boletin Estadistico Mensual - Consultas Medicas </h1>
 
</head>
 
<script language="JavaScript" type="text/JavaScript">
 
function Selec_mes() {
  var a = document.f1.anno.value;
  if (a != "null") {
 /*     document.f1.action="";*/
	 document.f1.submit();  }
  else { alert("Seleccione un valor."); }
}
 
function Seleccionar() {
  var a = document.f1.especiali.value;
  if (a != "null") {
      document.f1.action="";
	 document.f1.submit();  }
  else { alert("Seleccione un valor."); }
}
 
</script>
 
 
<?php
function tabla_encabezado($valor) {
  echo "<table border='1' width='900'>";
  echo "<tr>";
  echo "<td><span class='Estilo1'>$valor</span></td>";
  echo "<td class='tb_tit'>&nbsp;</td>";
  echo "<td colspan='5' class='tb_tit'>NUEVO</td>";
  echo "<td colspan='3' class='tb_tit'>CONTROL</td>";
  echo "<td colspan='3' class='tb_tit'>NSP</td>";
  echo "<td class='tb_tit'>&nbsp;</td>";
  echo "<tr><td width='250' class='tb_tit'>Profesional</td>";
  echo "<td width='50' class='tb_tit'>TOTAL</td>";
  echo "<td width='50' class='tb_tit'>Total</td>";
  echo "<td width='50' class='tb_tit'>Aps</td>";
  echo "<td width='50' class='tb_tit'>Cae</td>";
  echo "<td width='50' class='tb_tit'>Urg</td>";
  echo "<td width='50' class='tb_tit'>% Aps</td>";
  echo "<td width='50' class='tb_tit'>Total</td>";
  echo "<td width='50' class='tb_tit'>Altas</td>";
  echo "<td width='50' class='tb_tit'>% Altas</td>";
  echo "<td width='50' class='tb_tit'>Total</td>";
  echo "<td width='50' class='tb_tit'>Nuevo</td>";
  echo "<td width='50' class='tb_tit'>Control</td>";
  echo "<td width='50' class='tb_tit'>H.tra</td>";
  echo "</tr>";
}
 
if(!(isset($_POST['envio'])))
{
   $request_method = $_SERVER["REQUEST_METHOD"];
   if ($request_method == "POST")
   {
       $mes = @$_POST['mes'];
       $anno = @$_POST['anno'];
	   $especiali = @$_POST['especiali'];
    }
    else
    {
        $mes = "";
        $anno = "";
    }
 
   // if reqmet
 
  ?>
   <form name="f1" action="boletin.php" method="POST">
   <table border="0" width="600" align="center">
   <tr>
   	  <td width="115"><span class="Estilo1">Mes de Consulta:</span> </td>
	  <td width="475"><select name="mes">
	  				    <option value="01" <?php if($mes=='01') echo " selected "; ?>>Enero</option>
						<option value="02" <?php if($mes=='02') echo " selected "; ?>>Febrero</option>
						<option value="03" <?php if($mes=='03') echo " selected "; ?>>Marzo</option>
						<option value="04" <?php if($mes=='04') echo " selected "; ?>>Abril</option>
						<option value="05" <?php if($mes=='05') echo " selected "; ?>>Mayo</option>
						<option value="06" <?php if($mes=='06') echo " selected "; ?>>Junio</option>
						<option value="07" <?php if($mes=='07') echo " selected "; ?>>Julio</option>
						<option value="08" <?php if($mes=='08') echo " selected "; ?>>Agosto</option>
						<option value="09" <?php if($mes=='09') echo " selected "; ?>>Septiembre</option>
						<option value="10" <?php if($mes=='10') echo " selected "; ?>>Octubre</option>
						<option value="11" <?php if($mes=='11') echo " selected "; ?>>Noviembre</option>
						<option value="12" <?php if($mes=='12') echo " selected "; ?>>Diciembre</option>
					  </select>
	 </td>
    </tr>
  <tr>
	  <td width="126"><span class="Estilo1">Año de Consulta:</span></td>
	  <td width="464"><select name="anno" onChange="javascript:Selec_mes();">
	 				 <option value="9999" <?php if($anno=='9999') echo " selected "; ?>>Seleccione un Año</option>
                     <option value="2011" <?php if($anno=='2011') echo " selected "; ?>>2011</option>
                     <option value="2010" <?php if($anno=='2010') echo " selected "; ?>>2010</option>
                     <option value="2009" <?php if($anno=='2009') echo " selected "; ?>>2009</option>
	 				 <option value="2008" <?php if($anno=='2008') echo " selected "; ?>>2008</option>
					 </select>
	  </td>
  </tr>
 
	
	<!-- AQUI AHORA ME SALE UN MENSAJE  y que coloco mas abajo -->
 
	  <td width="115"><span class="Estilo1">Especialidad:</span> </td>
       <td width="475"><select name="especiali" onChange="javascript:Seleccionar();">
   	                  <option selected value=' '>Selecciona una opcion</option>"
					  <?php
                       include("conectar.php");
   		               $nom_arch = "boletin_" . $anno;
                       $sql = "SELECT Servicio from " . $nom_arch . " group by servicio";
                       $result = mysql_query($sql, $conexion);
                       while ($myrow = mysql_fetch_array($result))
                       {
					    if($myrow[0] == $especiali)
						  {
							echo "<option selected value='$myrow[0]'>$myrow[0]</option>";
						  } 
						else 
						  {  
   					        echo '<option value="'.$myrow[0].'">'.$myrow[0].'</option>';
						  }	
                       }
                       ?>
        </select></td>
   </tr>
	  <td width="115"><span class="Estilo1">Sub Especialidad:</span> </td>
	  <td width="475"><select name="sub_espe">
					  <option selected value="0">Selecciona una opcion</option>
				   <?php  
					   include("conectar.php");
   		               $nom_arch = "boletin_" . $anno;
					   $sql = "SELECT Especialidad from " . $nom_arch . " where servicio = '" . $especiali . "' group by especialidad";
					   $result = mysql_query($sql, $conexion);
					   while ($myrow = mysql_fetch_array($result))
				       {
						echo "<option value='$myrow[0]'>$myrow[0]</option>";
					}	
                   ?>
        </select></td>
   </tr>
   <TR>
   	 <td width="115"></td>
	 <td width="475"><input type="submit" name="envio" value="Consultar" /></td>
   </TR>
   </table>
   </form>
   <div align="center">
   <div align='center'><a href='index.php'><img src='img/flecha_izq.gif' alt='Volver' width='200' height='40' border='0'> </a></div>
     <?php
}
else
{
  require("funciones.php");
  $especiali = $_POST['especiali'];
  $mes = $_POST['mes'];
  $sub_espe = $_POST['sub_espe'];
  $nommes = dice_mes($mes);
  $anno = $_POST['anno'];  
  
  echo "<table border='1' width='400'>";
  echo "<tr>";
  echo "<td width='100' class='tb_tit'>Mes</td>";
  echo "<td width='300' class='tb_tit'>$nommes $anno </td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td width='100' class='tb_tit'>Especialidad</td>";
  echo "<td width='300' class='tb_tit'>$especiali</td>";
  echo "</tr>";
  echo "<tr>";
  echo "<td width='100' class='tb_tit'>Sub Especialidad</td>";
  echo "<td width='300' class='tb_tit'>$sub_espe</td>";
  echo "</tr>";
  echo "</table>";
  echo "<br>";
  
  include("conectar.php");
  $nom_arch = "boletin_" . $anno;
  $sql = "SELECT * from " . $nom_arch . " where mes = '" . $mes . "' and especialidad = '" . $sub_espe . "' order by accion";
  $result = mysql_query($sql, $conexion);
  $myrow = mysql_fetch_array($result);
  tabla_encabezado($myrow['accion']);
  $accion_ant = $myrow['accion'];
  
   $tot_total = 0;
   $tot_nvotot = 0;
   $tot_nvoaps = 0;
   $tot_nvocae = 0;
   $tot_nvourg = 0;
   $tot_ctrltot = 0;
   $tot_ctrlaltas = 0;
   $tot_nsptot = 0;
   $tot_nspnvos = 0;
   $tot_nspctrl = 0;
  
  	do {
	
	    if ($myrow['accion'] <> $accion_ant) {
		   echo "</table>";  // cerrar la tabla anterior
		   tabla_encabezado($myrow['accion']);
   	       $accion_ant = $myrow['accion'];
		}
 
	    $xtotal = $myrow['nvo_tot'] + $myrow['ctrl_total'];
		$h_tra = $xtotal /4;
	    $aps_porcen  = 0;
		if (($myrow['nvo_tot']) > '0') {
		   $aps_porcen = ($myrow['nvo_aps'] / $myrow['nvo_tot'])*100;
		   $aps_porcen = redondear_dos_decimal($aps_porcen);
		 }
 
	    $altas_porcen  = 0;
		if (($myrow['ctrl_altas']) > '0') {
		   $altas_porcen = ($myrow['ctrl_altas'] / $myrow['ctrl_total'])*100;
		   $altas_porcen = redondear_dos_decimal($altas_porcen);
		 }
 
		echo "<tr> ";
        echo "<td width='250' class='tb_dat' >$myrow[nom_medico]</td>";
        echo "<td width='50' class='tb_dat2'>$xtotal</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[nvo_tot]</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[nvo_aps]</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[nvo_cae]</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[nvo_urg]</td>";
        echo "<td width='50' class='tb_dat2'>$aps_porcen</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[ctrl_total]</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[ctrl_altas]</td>";
		echo "<td width='50' class='tb_dat2'>$altas_porcen</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[nsp_total]</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[nsp_nvos]</td>";
        echo "<td width='50' class='tb_dat2'>$myrow[nsp_ctrl]</td>";
        echo "<td width='50' class='tb_dat2'>$h_tra</td>";
		echo "</tr>";
 
		$tot_total = $tot_total + $xtotal;
		$tot_nvotot = $tot_nvotot + $myrow['nvo_tot'];
		$tot_nvoaps = $tot_nvoaps + $myrow['nvo_aps'];
		$tot_nvocae = $tot_nvocae + $myrow['nvo_cae'];
		$tot_nvourg = $tot_nvourg + $myrow['nvo_urg'];
		$tot_ctrltot = $tot_ctrltot + $myrow['ctrl_total'];
		$tot_ctrlaltas = $tot_ctrlaltas + $myrow['ctrl_altas'];
		$tot_nsptot = $tot_nsptot + $myrow['nsp_total'];
		$tot_nspnvos = $tot_nspnvos + $myrow['nsp_nvos'];
		$tot_nspctrl = $tot_nspctrl + $myrow['nsp_ctrl'];
 
	} while($myrow = mysql_fetch_array($result));
 
	$h_tra = $tot_total /4;
    $tot_aps_porcen  = 0;
	if (($tot_total) > '0') {
	   $tot_aps_porcen = ($tot_nvoaps / $tot_total)*100;
	   $tot_aps_porcen = redondear_dos_decimal($tot_aps_porcen);
     }
    $altas_porcen  = 0;
	if (($tot_ctrlaltas) > '0') {
	   $altas_porcen = ($tot_ctrlaltas / $tot_ctrltot)*100;
	   $altas_porcen = redondear_dos_decimal($altas_porcen);
	 }
 
	echo "</table>";
	echo "<br><br>";
    echo "<table border='1' width='900'>";
	echo "<tr> ";
    echo "<td width='250' class='tb_tit' >TOTAL $especiali</td>";
    echo "<td width='50' class='tb_tit'>$tot_total</td>";
    echo "<td width='50' class='tb_tit'>$tot_nvotot</td>";
    echo "<td width='50' class='tb_tit'>$tot_nvoaps</td>";
    echo "<td width='50' class='tb_tit'>$tot_nvocae</td>";
    echo "<td width='50' class='tb_tit'>$tot_nvourg</td>";
    echo "<td width='50' class='tb_tit'>$tot_aps_porcen</td>";
    echo "<td width='50' class='tb_tit'>$tot_ctrltot</td>";
    echo "<td width='50' class='tb_tit'>$tot_ctrlaltas</td>";
	echo "<td width='50' class='tb_tit'>$altas_porcen</td>";
    echo "<td width='50' class='tb_tit'>$tot_nsptot</td>";
    echo "<td width='50' class='tb_tit'>$tot_nspnvos</td>";
    echo "<td width='50' class='tb_tit'>$tot_nspctrl</td>";
    echo "<td width='50' class='tb_tit'>$h_tra</td>";
	echo "</tr>";
 
	echo "</table>";
	echo "<div align='center'><a href='boletin.php'><img src='img/flecha_izq.gif' alt='Volver' width='200' height='40' border='0'></a></div>";
 
}
?>



(
MENSAJE QUE APARECE
! ) Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in D:\wamp\www\estadistica\rem07_op.php on line 143
Call Stack
# Time Memory Function Location
1 0.0026 449144 {main}( ) ..\rem07_op.php:0
2 0.0181 456352 mysql_fetch_array ( ) ..\rem07_op.php:143



Este mensaje me aparece porque está esperando que seleccione el Año de Consulta, sin embargo, en la version anterior me esperaba a que ingresara el Año, luego me pedia el dato de Especialidad, ahora no, no espera y pasa de largo y como aun no ingreso el año, sale el error.

Espero que me haya hecho entender y que sea simple la solucion.......muchas gracias
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