Image('imagenes/TBC.jpg',12,20,40);
//$this->Image('imagenes/hgo.jpg',247,19,23);
$area=$_POST['nareaentrega'];
$fentrega=$_POST['fechaentr'];
//$area='1';
//$fentrega='3003/2015';
pg_connect("dbname='inv_expedientes' port='5432' user='telerin' password='aplicaciones'") or die ("Error en la conexion");
$queryma="select nom_area,titular_area from cat_area where cve_area='$area'";
$dato=pg_query($queryma);
$nomar=pg_fetch_result($dato,0,0);
$titular=pg_fetch_result($dato,0,1);
$this->SetFont('Arial','B',10);
$this->SetFillColor(200,200,200);
$this->Rect(10,9,260,9,'FD');
$this->SetXY(10,10);
$this->MultiCell(260,3.2,"DOCUMENTOS Y ARCHIVOS",0,'C');
$this->SetXY(10,13.5);
$this->MultiCell(260,3.2,"RELACIÓN DE EXPEDIENTES DOCUMENTALES Y ARCHIVOS MAGNÉTICOS",0,'C');
$this->SetXY(10,25);
$this->MultiCell(260,3.2,"BACHILLERATO DEL ESTADO DE HIDALGO",0,'C');
$this->SetXY(40,35);
$this->MultiCell(150,3.2,"ÁREA: $nomar",0,'J');
$this->SetXY(40,43);
$this->MultiCell(150,3.2,"RESPONSABLE: MTRO. JOSÉ SEBASTIÁN MALDONADO",0,'J');
$this->SetXY(210,35);
$this->MultiCell(40,3.2,"FECHA: $fentrega",0,'J');
$this->SetXY(210,43);
$this->Cell(40,3.2,'HOJA '.$this->PageNo().' DE {nb}',0,0,'J');
$this->Rect(10,18,260,39,'');
$this->SetFont('Arial','',9);
$this->SetFillColor(200,200,200);
$this->Rect(10,46,260,11,'FD');
$this->SetXY(10,49);
$this->MultiCell(60,3.2,"REFERENCIA DE LA UBICACIÓN DEL EXPEDIENTE O ARCHIVO",0,'C');
$this->SetXY(70,46.7);
$this->MultiCell(55,3.2,"CLASIFICACIÓN, NÚMERO DE CONTROL DEL EXPEDIENTE O NOMBRE DEL ARCHIVO",0,'C');
$this->SetXY(125,48);
$this->MultiCell(70,3.2,"DESCRIPCIÓN DEL EXPEDIENTE O ARCHIVO MAGNÉTICO",0,'C');
$this->SetXY(195,50);
$this->MultiCell(20,3.2,"TOMOS",0,'C');
$this->SetXY(215,48);
$this->MultiCell(55,3.2,"PERIODO COMPRENDIDO O FECHAS DE ELABORACIÓN",0,'C');
$this->Rect(10,46,60,11,'');
$this->Rect(70,46,55,11,'');
$this->Rect(125,46,70,11,'');
$this->Rect(195,46,20,11,'');
$this->Rect(215,46,55,11,'');
//Salto de línea
$this->Ln(0);
}
//Pie de página
function Footer()
{
$area=$_POST['nareaentrega'];
//$area="1";
$nombrer=$_POST['recibe'];
pg_connect("dbname='inv_expedientes' port='5432' user='telerin' password='aplicaciones'") or die ("Error en la conexion");
$queryma="select nom_area,titular_area from cat_area where cve_area='$area'";
$dato=pg_query($queryma);
$nomar=pg_fetch_result($dato,0,0);
$titular=pg_fetch_result($dato,0,1);
$search = array("Á", "É", "Í", "Ó", "Ú", "á", "é", "í", "ó", "ú", "Ñ", "ñ");
$replace = array("Á", "É", "Í", "Ó", "Ú", "Á", "É", "Í", "Ó", "Ú", "Ñ", "Ñ");
$concatn1=str_replace($search, $replace, $nombrer);
$this->SetXY(245,179);
$this->MultiCell(25,3.2,"ANEXO III-1",0,'J');
$this->SetFont('Arial','B',9);
$this->SetXY(50,198);
$this->Line(25,198,125,198);
$this->SetXY(10,185);
$this->MultiCell(130,3.2,"ENTREGA",0,'C');
$this->SetXY(10,200);
$this->MultiCell(130,3.2,'MTRO. JOSÉ SEBASTIÁN MALDONADO',0,'C');
$this->SetXY(140,185);
$this->Line(158,197,255,197);
$this->SetXY(140,185);
$this->MultiCell(130,3.2,"RECIBE",0,'C');
$this->SetXY(140,200);
$this->MultiCell(130,3.2, 'L.C. HUMBERTO SÁNTOS GONZÁLEZ',0,'C');
}
}
//Creación del objeto de la clase heredada
$pdf=new PDF('L','mm','Letter');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetFont('Arial','',11);
//$dir=$_POST['nareaentrega'];
$area1=$_POST['nareaentrega'];
// $area="1";
pg_connect("dbname='inv_expedientes' port='5432' user='telerin' password='aplicaciones'") or die ("Error en la conexion");
$query="SELECT lugar||' '||lugar1||' '||no_caja as ubicacion,asunto,codigo,fecha_inicio||' al '||fecha_final as fecha,fecha_inicio,fecha_final from
datos_generales where cve_area='$area1' and baja_por_error isnull order by cve_area,ano,cve_serie,codigo";
//echo"$query";
$dato=pg_query($query);
$fila=pg_num_rows($dato);
$c=0;
for($b=0;$b<$fila;$b++){
$lugar=pg_fetch_result($dato,$b,0);
$asunto=pg_fetch_result($dato,$b,1);
$codigo=pg_fetch_result($dato,$b,2);
$fecha=trim(pg_fetch_result($dato,$b,3));
$fechai=pg_fetch_result($dato,$b,4);
$fechaf=pg_fetch_result($dato,$b,4);
$pdf->SetFont('Arial','',9);
$pdf->SetXY(10,($c+2.6)*23.7);
$pdf->MultiCell(60,3.40,$lugar,0,'J');
$pdf->Rect(10,($c+2.4)*23.7,60,23.7,'');
$pdf->SetXY(70,($c+2.6)*23.7);
$pdf->MultiCell(60,3.49,$codigo,0,'J');
$pdf->Rect(70,($c+2.4)*23.7,55,23.7,'');
$pdf->SetXY(125,($c+2.6)*23.7);
$pdf->MultiCell(70,3.49,$asunto,0,'J');
$pdf->Rect(125,($c+2.4)*23.7,70,23.7,'');
$pdf->Rect(195,($c+2.4)*23.7,20,23.7,'');
$pdf->SetXY(203,($c+2.6)*23.7);
$pdf->MultiCell(4,3.49,1,0,'','C');
if($fechai!=isnull AND $fechaf!=null){
$pdf->SetXY(225,($c+2.6)*23.7);
$pdf->MultiCell(60,3.49,$fecha,0,'J');
}else{
}
$pdf->Rect(215,($c+2.4)*23.7,55,23.7,'');
$c++;
if ($c>=5){
$c=0;
$pdf->AddPage();
}
//$pdf->Ln(0);
}
$pdf->Output();
?>