<?php
include_once('../core/basededatos.php');
include_once('../core/Paciente.php');
include_once('./class.ezpdf.php');
session_start();
$paciente=new Paciente();
$paciente->id=$_GET['Pac'];
$paciente->obtenerdatos();
header("Content-Type:application/xhtml+xml; charset=ISO-8859-1;");

$pdf=&new Cezpdf('letter');
$pdf->selectFont('./fonts/Helvetica.afm');
$datacreator = array (
					'Title'=>'CECOM - FACTURA',
					'Author'=>'CECOM',
					'Subject'=>'Factura',					
					);
$pdf->addInfo($datacreator);

$pdf->addJpegFromFile('./Cabecera.jpeg',0,696,612);
$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->addText(100,660,10,"PACIENTE: ",0,0);
$pdf->selectFont('./fonts/Helvetica-Bold.afm');
$pdf->addText(200,660,10,$paciente->nombre." ".$paciente->apellidop." ".$paciente->apellidom,0,0);
$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->addText(100,640,10,"DIRECCION: ",0,0);
$pdf->selectFont('./fonts/Helvetica-Bold.afm');
$pdf->addText(200,640,10,$paciente->direccion,0,0);
$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->addText(240,610,10,"CANTIDAD ------------------------------ ",0,0);
$pdf->selectFont('./fonts/Helvetica-Bold.afm');
$pdf->addText(400,610,10,"$ ".number_format($_GET['cantidad'],2),0,0);
$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->addText(200,580,10,"CONCEPTO: ",0,0);
$pdf->selectFont('./fonts/Helvetica-Bold.afm');
$pdf->addText(300,580,10,$_GET['concepto'],0,0);
$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->addText(200,560,10,"PACIENTE: ",0,0);
$pdf->selectFont('./fonts/Helvetica-Bold.afm');
$pdf->addText(300,560,10,$paciente->nombre." ".$paciente->apellidop." ".$paciente->apellidom,0,0);
$pdf->addText(300,520,10,"LA PAZ, B.C.S. A ".$_GET['dia']." DE ".$_GET['mes']." DE ".$_GET['ano'],0,0);
$pdf->selectFont('./fonts/Helvetica.afm');
$pdf->ezText("\n\n\n\n\n\n",8,array('justification' => 'center'));

$pdf->ezStream();
?>
