Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/03/2008, 08:05
barto3x
 
Fecha de Ingreso: enero-2008
Mensajes: 33
Antigüedad: 17 años
Puntos: 0
problema con notice undefined offset

hola a todos, tengo el siguiente problema. estoy realizando un sistema de estadisticas en el cual cargo los datos de una planilla excel y los muestro en pantalla para su posterior almacenamiento en una base de datos. la carga de datos la realizo en la siguiente funcion:
Código PHP:
    function guardar()
    {
        
error_reporting(15);
        if ( isset(
$_FILES['archivo']) && is_uploaded_file($_FILES['archivo']['tmp_name']) && is_readable($_FILES['archivo']['tmp_name']) ) {

            require_once(
$_SERVER['DOCUMENT_ROOT']."/includes/php/excel_php/reader.php");
            
//require_once($_SERVER['DOCUMENT_ROOT']."/includes/php/funciones.php");

            
$excel = new Spreadsheet_Excel_Reader();
            
$excel->setOutputEncoding("CP1251");
            
$excel->read($_FILES['archivo']['tmp_name']);
            
            
// numero de filas y columnas
            
$posf 0;
            
$filas $excel->sheets[0]['numRows'];
            
$columnas $excel->sheets[0]['numCols'];
            
            
$filas_f $filas 1;
            
$columnas_f $columnas 1;
            
            echo 
"Filas: " .$filas;
            echo 
"Columnas" .$columnas;
            
            
// Notice: Undefined offset: 16 in \index.php on line 147
            // No hay nada en la linea 16 de la planilla excel
            
            // Buscando el nombre del canal
            
for($posf 1$posf <= $filas_f $posf++ ){
            
                 if( 
$excel->sheets[0]['cells'][$posf][1] == "" ){
              print 
"No hay nada";
           }
           
           if( 
$excel->sheets[0]['cells'][$posf][1] == "Nombre del Canal" ){
              
$inicio $posf 1;
              break;
          }
      }
      
      for(
$fil $inicio$fil <= $filas_f $fil++ ){

            for(
$col 1$col <= $col++){

              
// Comprobando si existen elementos N/A
              // de ser asi, lo deja en 0.
              
if( $excel->sheets[0]['cells'][$fil][$col] == "N/A"  ){
                  
$excel->sheets[0]['cells'][$fil][$col] = 0;
              }
              
              
//echo "\"".$excel->sheets[0]['cells'][$i][$j]."\",";
              
print $excel->sheets[0]['cells'][$fil][$col]."<br>";
              
            } 
// fin 1° for

            
if( $excel->sheets[0]['cells'][$fil][$col] == "" ){
              break;
            }

            echo 
"\n";
            
      } 
// fin 2° for

    
// fin if

// fin guardar 
utlizo la funcion excelreader para php. me muestra los datos pero al imprimir tambien me muestran los siguientes resultados:

Filas: 31Columnas6
Notice: Undefined offset: 5 in C:\produccion2\wwwrootES\estadisticas\index.php on line 155
No hay nada
Notice: Undefined offset: 5 in C:\produccion2\wwwrootES\estadisticas\index.php on line 159

Notice: Undefined offset: 17 in C:\produccion2\wwwrootES\estadisticas\index.php on line 155
No hay nada
Notice: Undefined offset: 17 in C:\produccion2\wwwrootES\estadisticas\index.php on line 159
General
34702
28487
Desarrollos
0
0
Recomienda-Newsletters
0
0
Cartas-Al-Editor
0
0
Mail
112
80
Santander Universidades
317
280
Politicas
0
0
Etica
0
0
Recomendar
0
0
Investigacion
65
25
html
34208
28131

Notice: Undefined offset: 30 in C:\produccion2\wwwrootES\estadisticas\index.php on line 171

Notice: Undefined offset: 30 in C:\produccion2\wwwrootES\estadisticas\index.php on line 176


Notice: Undefined offset: 30 in C:\produccion2\wwwrootES\estadisticas\index.php on line 171

Notice: Undefined offset: 30 in C:\produccion2\wwwrootES\estadisticas\index.php on line 176


Notice: Undefined offset: 30 in C:\produccion2\wwwrootES\estadisticas\index.php on line 171

Notice: Undefined offset: 30 in C:\produccion2\wwwrootES\estadisticas\index.php on line 176



Notice: Undefined offset: 30 in C:\produccion2\wwwrootES\estadisticas\index.php on line 180

ojala me puedan orientar para solucionar este problema. de antemano muchas gracias.

Última edición por GatorV; 10/03/2008 a las 08:44 Razón: Agregar tags PHP