<?php

include('pdf/fpdf.php');
session_cache_limiter('private');
session_start();
$com = "I";
include("DMMYSQLG.php");
include("DSA3000.php");
include("DMMYSQLG.php");
include("DF80000.php");

class PDF extends FPDF
{
	function Header()
	{
	   include("DYIM_VER.php");
	}
	function Footer()
	{
	    $this->SetY(-15);
	    $this->SetFont('Arial','I',8);
	    $this->Cell(0,0, $this->PageNo().'/{nb}',0,0,'C');
	}
}

$pdf=new PDF('P','mm','A4');
$pdf->AddPage();
$pdf->AliasNbPages();

$pdf->SetFont('Arial','B',8);
$pdf->SetFillColor(192,192,192);

$sql=mysqli_query($con ,"SELECT * FROM dntrab_a WHERE no_trab='".$_SESSION['no_nom']."'");
$row=mysqli_fetch_array($sql);

$fotografia = 'foto/NO_'.$row['no_nom'] .'.JPG';
if (file_exists($fotografia)) {
    $pdf->Image('foto/NO_'.$row['no_nom'].'.JPG',24,60,35,45);
}else{
    $pdf->Image('foto/Sin_Foto.jpg',24,60,35,45);
}
	  
$mar=mysqli_query($con ,"SELECT * FROM  dntrab_g  WHERE id_emp='".$_SESSION['no_nom']."'");
$r=75;
while($cha=mysqli_fetch_array($mar))
{
$pdf->Cell(5,9,'',0,1,'C');
$pdf->Cell(62,5,'',0,0,'C');
$pdf->Cell(125,5,'NOMINA   '.'( ' . $row["no_nom"] . ' - ' . $row["nom"] . ' ' . $row["ape_pat"] . ' ' . $row["ape_mat"] . ' )',0,1,'C',1);


$pdf->Cell(62,2,'',0,1,'C');
$pdf->Cell(62,5,'',0,0,'C');
$pdf->Cell(125,5,'NOMBRE DEL DOCUMENTO:   '.$cha["con"],0,1,'L');


	$fotodoc='foto/doc_trab/'.$cha['doc'];
	//echo $fotografia;
	if (file_exists($fotodoc)) {
	$pdf->Image($fotodoc,90,$r,35,40);
	}else{
	$pdf->Image('foto/Sin_Doc.jpg' ,90,$r,35,40);
	}
	$pdf->Cell(5,40,'',0,1,'C');
	$r+=60;
	}
$pdf->Output("Datos_Documentacion.pdf","D");
?> 