Holger
03-01-2012, 10:04:48
Estimados amigos estoy realizando algunos proyectos en php, para poder imprimir los reportes en PDF con ezpdf tengo un problema no he manejado mucho los arrays porfavor si alguien me puede ayudar...
Es un reporte de notas de los estudiantes de una primaria el codigo para diseñar la estructura el el siguiente:
<?php
session_start();
require_once('class.ezpdf.php');
include_once("../Class/Master.class.php");
$objStudent=new Student();
$cnsStudent=$objStudent->reportStudent($lvId,$prId);
$objAvgCnt=new Notes();
$cnsAvgCnt=$objAvgCnt->listMstHeadAvgCnt();
while($datAvg = pg_fetch_assoc($cnsAvgCnt)) {
$dataAvg[] = array_merge($datAvg);
}
$con = 0;
while($datatmp = pg_fetch_assoc($cnsStudent)) {
$con = $con+1;
$data[] = array_merge($datatmp, array('num'=>$con));
}
$titles = array(
"num"=>"<b>ORDEN</b>",
"alu_apellido"=>"<b>APELLIDOS</b>",
"alu_nombre"=>"<b>NOMBRES</b>",
"Notas"=>array()
//aqui van un arreglo que tiene las notas de cada estudiante y deberia quedar asi:
Orden Apellidos Nombres N1 N2 N3 N4 N5
1 Caiza Holger 18 20 15 17 20
he intentado con un while con un array y no consigo que me despliegue las 9 notas que tiene cada uno, [/COLOR][/B][/COLOR]el problema es que cuando denomino una variable como array no me despliega nada
Desde ya Agradesco por su tiempo y ayuda.
);
$options = array(
"shadeCol"=>array(0.9,0.9,0.9),
"xOrientation"=>"center",
"width"=>500,
);
$txttit = "<b>JARDIN ESCUELA FISCAL MIXTA</b>\n";
$txttit.= "ANIO LECTIVO\n";
$txttit.= "Reportes de Notas: ".$anio." ".$prl."\n";
$pdf->ezText($txttit, 12);
$pdf->ezImage("../img/esc.jpg", 0, 420, 'none', 'left');
$pdf->ezTable($data, $titles, '', $options);
$pdf->ezText("\n\n\n", 10);
$pdf->ezText("<b>Fecha:</b> ".date("d/m/Y"), 10);
$pdf->ezText("<b>Hora:</b> ".date("H:i:s")."\n\n", 10);
$pdf->ezStream();
?>
Es un reporte de notas de los estudiantes de una primaria el codigo para diseñar la estructura el el siguiente:
<?php
session_start();
require_once('class.ezpdf.php');
include_once("../Class/Master.class.php");
$objStudent=new Student();
$cnsStudent=$objStudent->reportStudent($lvId,$prId);
$objAvgCnt=new Notes();
$cnsAvgCnt=$objAvgCnt->listMstHeadAvgCnt();
while($datAvg = pg_fetch_assoc($cnsAvgCnt)) {
$dataAvg[] = array_merge($datAvg);
}
$con = 0;
while($datatmp = pg_fetch_assoc($cnsStudent)) {
$con = $con+1;
$data[] = array_merge($datatmp, array('num'=>$con));
}
$titles = array(
"num"=>"<b>ORDEN</b>",
"alu_apellido"=>"<b>APELLIDOS</b>",
"alu_nombre"=>"<b>NOMBRES</b>",
"Notas"=>array()
//aqui van un arreglo que tiene las notas de cada estudiante y deberia quedar asi:
Orden Apellidos Nombres N1 N2 N3 N4 N5
1 Caiza Holger 18 20 15 17 20
he intentado con un while con un array y no consigo que me despliegue las 9 notas que tiene cada uno, [/COLOR][/B][/COLOR]el problema es que cuando denomino una variable como array no me despliega nada
Desde ya Agradesco por su tiempo y ayuda.
);
$options = array(
"shadeCol"=>array(0.9,0.9,0.9),
"xOrientation"=>"center",
"width"=>500,
);
$txttit = "<b>JARDIN ESCUELA FISCAL MIXTA</b>\n";
$txttit.= "ANIO LECTIVO\n";
$txttit.= "Reportes de Notas: ".$anio." ".$prl."\n";
$pdf->ezText($txttit, 12);
$pdf->ezImage("../img/esc.jpg", 0, 420, 'none', 'left');
$pdf->ezTable($data, $titles, '', $options);
$pdf->ezText("\n\n\n", 10);
$pdf->ezText("<b>Fecha:</b> ".date("d/m/Y"), 10);
$pdf->ezText("<b>Hora:</b> ".date("H:i:s")."\n\n", 10);
$pdf->ezStream();
?>