<?php
header('Content-Type: text/html; charset=UTF-8');
require('fpdf/fpdf.php');
require('alphapdf.php');
date_default_timezone_set("America/La_Paz");
include "core/autoload.php";
include "core/app/model/ReserveData.php";
include "core/app/model/UserData.php";
include "core/app/model/CategoryData.php";

class PDF extends AlphaPDF
{

	function Header()
	{
		$dia = date('d');
		$anio = date('Y');
		$mes = date('m');

		//Logo
		$this->SetFillColor(0, 0, 0);
		$this->Image('ser.png', 0, 5, 200);
		$this->Ln(40);
	}
	function Footer()
	{
		//Posici�n: a 1,5 cm del final
		$this->SetY(-25);
		//Arial italic 8
		//$this->SetFont('Arial','I',8);
		//N�mero de p�gina
		//$this->Cell(0,10,'',0,0,'C');
		$this->Cell(0, 5, 'Sergio Soria', 0, 1, 'C');
		$this->Cell(0, 5, 'Clínica Demo', 0, 1, 'C');
	}
}

$o = array();
$o = ReserveData::getById($_GET["id"]);;
$sdate = $o->created_at;
$dia = date('d', strtotime($sdate));
$anio = date('Y', strtotime($sdate));
$mes = date('m', strtotime($sdate));
$user  = UserData::getById(1);
//$user_id = $o->user_id;

$pdf  = new PDF('P', 'mm', 'letter');
$pdf->AliasNbPages();
$pdf->AddPage();
$pdf->SetAlpha(0.1);
//$pdf->Image('fondo.png', 16, 60, $fpdf->w, $fpdf->h);
$pdf->SetAlpha(1);

$pdf->SetFont('Arial', 'B', 16);
$pdf->Cell(0, 5, 'SOLICITUD DE ENTREVISTA ', 0, 1, 'C');
$pdf->Cell(189, 10, '', 0, 1); //end of line
//set font to arial, bold, 14pt
$pdf->SetFont('Arial', 'B', 12);

//$pdf->Cell(100 ,5,'Lugar y Fecha : La Paz, '.$fecha_l,0,1);//end of line
//$pdf->Cell(100 ,5,'Hora : '.date('H:i'),0,1);//end of line

$pdf->Cell(20, 5, 'Nombre: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, $o->name, 0, 1);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(20, 5, 'Edad: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, $o->age, 0, 1);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(20, 5, 'Fecha: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, $o->created_at, 0, 1);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(20, 5, 'Motivo: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, $o->reason, 0, 1);
$pdf->SetFont('Arial', 'B', 12);

$pdf->Cell(189, 10, '', 0, 1); //end of line
//invoice contents
$pdf->SetFont('Arial', 'B', 10);


$pdf->Output();
