<?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 FPDF
{

	function Header()
	{
		$dia = date('d');
		$anio = date('Y');
		$mes = date('m');

		//Logo
		$this->SetFillColor(0, 0, 0);
		$this->Image('ser.png', 0, 5, 50);
		$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, '_________________', 0, 1, 'C');
		$this->Cell(0, 5, 'Encargado SER', 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('L', 'mm', array(150, 216), true, 'UTF-8', false);
$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->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->SetFont('Arial', 'B', 12);
$pdf->Cell(30, 5, 'PACIENTE: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, $o->name, 0, 1);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(30, 5, 'EDAD: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, $o->age, 0, 1);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(30, 5, 'FUENTE: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, 'WHATSAPP', 0, 1);
$pdf->SetFont('Arial', 'B', 12);
$pdf->Cell(35, 5, 'CELULAR: ', 0, 0);
$pdf->SetFont('Arial', '', 12);
$pdf->Cell(0, 5, $o->resp_id, 0, 1);

$pdf->Output();
