Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/09/2010, 19:09
edanalvi
 
Fecha de Ingreso: julio-2009
Mensajes: 77
Antigüedad: 14 años, 9 meses
Puntos: 0
Variable no pasa valores

Necesito que me ayuden a ver que esta pasando pues las variables no pasan los valores que mando en estas, pregunte en el foro de base de datos http://www.forosdelweb.com/f86/selec...nciona-840418/ pero me dijeron que mi problema no es de ahi, mas bien es la forma en que estoy creando mi codigo para hacer mi grafica.
Trabajo con Pchart, php y Mysql.
Las variables las ingreso en un text box y luego envio a hacer la consulta.
Agradezco a alguien que me lo revise y me diga.

Formulario:

Código PHP:
<?php
    
require_once('fondo.html');
echo
"
<html>
    <head>
        <title>Rango</title>
    </head>
        <body>
        
            <td valign='middle' align='center'>
            <form action='rangoedad.php' method='POST'> 
            <center><table border='1' cellpadding='5'></center>    <br><tr><td>
            <font color='purple' size='2' face='Helvetica'>
            <table align='center' width='200' cellspacing='1' cellpadding='3' border='0'> 
            <tr> "
;
echo
"<tr><td>
            <td bgcolor='#800080'>  <center font size=1 face='helvetica' span style='color:ffffff'>  <b>Ingrese Fechas</b></font></td></tr>"
;

echo
"             
            <tr><td align='right'><b><i><br><span style='color:800080'>De:</td> 
            <td><br><center><font color='purple' size='2' face='Helvetica'></center>
            <input type='Text' name='fecha1' size='20' </td> 
            </br></tr> 
            <tr> 
            <td align='right'><b><i><span style='color:800080'>A:</td> 
            <td><input type='Text' name='fecha2' size='20' </td> 
            </tr> 
            <td colspan='2' align='center'><input type='Submit' value='Consultar'></td> 
            </table> 
            </table> 
            </form> 
            </b></i>
        </body> 
</html>"
;
?>
Consulta

Código PHP:
<?php 
include "conexxion.php";
$cn=LibMySQL::getInstancia();
include(
"pChart/pData.class");
include(
"pChart/pChart.class");

    
    
$rs=$cn->consultar("SELECT COUNT(edad) as cedad, edad  FROM usuario_principal WHERE fecha BETWEEN '".$fecha1."' AND '".$fecha2."' GROUP BY edad;");
       
    
$edad=array();
    
$cedad=array();
    foreach(
$rs as $datos){
         
$edad[]=$datos['edad']."años";    
       
$cedad[]=$datos['cedad'];
    }
     
$DataSet = new pData;
 
$DataSet->AddPoint($edad,"Edad");
 
$DataSet->AddPoint($cedad,"Porcentajes");
 
$DataSet->AddAllSeries();
 
$DataSet->SetAbsciseLabelSerie("Edad"); 
 
$Test = new pChart(380,200);
 
$Test->drawFilledRoundedRectangle(7,7,373,193,5,240,240,240);
 
$Test->drawRoundedRectangle(5,5,375,195,5,230,230,230);
  
$Test->setGraphArea(50,30,585,200);
$Test->setFontProperties("Fonts/tahoma.ttf",10);
$Test->drawTitle(10,20,"EDADES",100,100,100);
 
$Test->setFontProperties("Fonts/tahoma.ttf",8);
 
$Test->drawPieGraph($DataSet->GetData(),$DataSet->GetDataDescription(),150,90,110,PIE_PERCENTAGE,TRUE,50,20,5);
 
$Test->drawPieLegend(310,15,$DataSet->GetData(),$DataSet->GetDataDescription(),250,250,250);
   
$Test->Render("Reporteedad.png");
?>
Código PHP:
<?php 

if(isset($_POST['ver'])){
     include(
"rangoedad.php");
     echo 
"<img src='Reporteedad.png' width='380' height='200' />";
    }
?>