<?php
/****************************************************************************************
SMI (Services Maintenance Interventions) est une gestion libre de maintenance et de SAV

Version 0.9.7

Copyright (C) 2006-2007  Sylvain FATOME
This program is free software; you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation; 
either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program
(in the directory docs); 
if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 
Boston, MA  02110-1301, USA.

Contact : galawa@free.fr

Web : http://smitst.homelinux.com
****************************************************************************************/


// Vérification des tentatives de hack
$pos=strpos($_SERVER['PHP_SELF'],"inc.php");
if ($pos===FALSE)
	$ok_inc=TRUE;
else
	$ok_inc=FALSE;
if ($ok_inc==FALSE) header("Location: ../index.php");

include_once("../inc/config.inc.php");
include_once("../inc/func_log.inc.php");
include_once("../inc/func_txt.inc.php");
include_once("../inc/func_geo.inc.php");
include_once("../inc/fic_age.inc.php");
include_once("../inc/fic_cli.inc.php");
Archivelog(@$_SESSION["code_log"]);

$tfr = strip_tags(trim($_GET['tfr']));	// Récupération type Fiche Relevé
$cc = strip_tags(trim($_GET['cc']));	// Récupération Code Client
$agence = @$_SESSION["code_age"]; // Récupération code agence

function datefr($dateang) 
{
	$split = split("-",$dateang);
	$annee = $split[0];
	$mois = $split[1];
	$jour = $split[2];
	return "$jour"."-"."$mois"."-"."$annee";
}

function formatedate($dte)
{
	$date = "";

	if (($dte <> "") AND ($dte <> "0000-00-00"))
		$date = datefr($dte);
	else
		$date = "";
		
	return $date;
}

// Test si date1 supérieure à date2 (Format Anglais)

function echeance_depassee_date($date1,$date2) 
{
  $depasse = FALSE;

  $tDeb = explode("-", $date1);
  $tFin = explode("-", $date2);

  if (mktime(0, 0, 0, $tDeb[1], $tDeb[2], $tDeb[0]) > mktime(0, 0, 0, $tFin[1], $tFin[2], $tFin[0]))
	$depasse = TRUE;
  
  return $depasse;

}

if (($tfr <> "") AND ($cc <> "") AND (($tfr == 1) OR ($tfr == 2)))
{
	// Récupération des données agence
	$row = lit_enr_age(@$_SESSION["code_age"]);
	extract ($row);

	$cp_age = Retournecp_openId($age_ville,TRUE);
	$ville_age = Retourneville_openId($age_ville,TRUE);

	// Récupération des données client
	$row = lit_enr_cli($cc);
	extract ($row);

	include_once('../classes/fpdf/fpdf.php');
	include_once('../inc/fpdf_ext.inc.php');

	$pdf=new PDF();
	$pdf->FPDF('L','mm','A4');
	$pdf->SetDisplayMode('real');
	$pdf->AliasNbPages();
	$pdf->SetTitle('Relevé N°'.$rel_code);
	$pdf->SetSubject('Relevé N°'.$rel_code);
	$pdf->settheader("relv");
	$pdf->AddPage();

	$pv_det_cli = $pv_ent_age; // Récupération de la position sous l'entête agence pour le pointeur détail client
	$pv_det_rel = $pv_ent_age; // Récupération de la position sous l'entête agence pour le pointeur détail intervention

	$pdf->SetLineWidth(0.4);

	// Impression du détail client

	$pdf->SetY($pv_det_cli); // Renvoie le pointeur SOUS l'entête agence

	$pdf->SetFont('Arial','BU',12); // Titre
	$pdf->Cell(138,5,'CLIENT','LTR',1,'C');
	
	$ent_cli = ""; // Détail
	if ($cli_ste <>"") 
	{
		$ent_cli.=$cli_ste."\n";
		$ent_cli.= $cli_civilite." ".$cli_prenom." ".$cli_nom."\n";
	}
	else
	{
		$ent_cli.= $cli_civilite." ".$cli_prenom." ".$cli_nom."\n\n"; // Double saut pour compenser le manque de la société
	}
	$pdf->SetFont('Arial','B',10);
	$pdf->MultiCell(138,4,$ent_cli,'LR','L');

	$ent_cli = $cli_adr1."\n"; // Suite...
	$ent_cli.= $cli_adr2."\n";
	$ent_cli.= Retournecp_openId($cli_ville,TRUE)." ".Retourneville_openId($cli_ville,TRUE)."\n";
	$ent_cli.= "Tel : ".$cli_telf."\n";
	$ent_cli.= "Fax : ".$cli_fax;
	$pdf->SetFont('Arial','',10);
	$pdf->MultiCell(138,4,$ent_cli,'LRB','L');

	// Impression du détail relevé

	$pdf->SetY($pv_det_rel); // Renvoie le pointeur SOUS l'entête agence

	$pdf->Cell(138);

	$pdf->SetFont('Arial','BU',12);
	$pdf->Cell(139,5,'DETAIL','LTR',1,'C');

	$pdf->Cell(138);

	$pdf->SetFont('Arial','',8);
	$ent_rel = "\n";
	$ent_rel.= "Racine codage :\n";
	$ent_rel.= "Dernier n° machine :\n";
	$ent_rel.= "\n";
	$ent_rel.= "\n";
	$ent_rel.= "\n";
	$ent_rel.= "\n";

	$pdf->MultiCell(30,4,$ent_rel,'B','R');

	$pdf->SetY($pv_det_rel+5); // Renvoie le pointeur SOUS l'entête agence + 5mm (cellule niveau urgence)
	$pdf->Cell(168);

	$pdf->SetFont('Arial','',8);
	$ent_rel = "\n";
	$ent_rel.= str_repeat("_",20)."\n";
	$ent_rel.= str_repeat("_",8)."\n";
	$ent_rel.= "\n";
	$ent_rel.= "\n";
	$ent_rel.= "\n";
	$ent_rel.= "\n";

	$pdf->MultiCell(109,4,$ent_rel,'BR','L');

	$pdf->SetDrawColor(0);
	$pdf->SetLineWidth(0.2);

	$pdf->Ln(1);

	$pdf->SetFont('Arial','B',8);
	$pdf->Cell(30,4,'Site utilisation : ',0,0,'R');
	$pdf->SetFont('Arial','',8);
	$pdf->SetDrawColor(125);
	$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
	$pdf->SetDrawColor(0);

	switch ($tfr)
	{
	 case 1 :
		//
		// Impression des fiches licences
		//

		// Marque
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Marque : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Modèle
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Modèle : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Version
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Version : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",10),0,1,'L');

		// Type
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Type : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Maximum de postes
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Maximum de postes : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",4).' (Utilisé : '.str_repeat("_",4).')',0,1,'L');

		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Détail utilisation : ',0,0,'R');
		$pdf->SetFont('Arial','',7);
		$pdf->SetDrawColor(125);
		$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		$pdf->SetDrawColor(0);
		$pdf->Cell(30,4,'(Noter les n° de folios produits) : ',0,0,'R');
		$pdf->SetDrawColor(125);
		$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');

		for ($i=0; $i <1; $i++)
		{         
			$pdf->Cell(30);
			$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		}
		$pdf->SetDrawColor(0);

		// Média
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Média : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Numéro
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Numéro : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Clef
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Clef d\'activation : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// A jour / Légale ?
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'A jour / Légale : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,'___/___',0,1,'L');

		// Date Validité
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Date de validité : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,'__/__/____',0,1,'L');

		/********************************/
		/* Informations complémentaires */
		/********************************/
		$pdf->Ln(2);
		$pdf->SetFont('Arial','BU',10);
		$pdf->Cell(277,5,'INFORMATIONS COMPLEMENTAIRES','',1,'L');
		$pdf->Ln(2);

		/*********/
		/* Notes */
		/*********/
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Notes : ',0,0,'R');
		$pdf->SetFont('Arial','',7);
		$pdf->SetDrawColor(125);
		$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		for ($i=0; $i <2; $i++)
		{         
			$pdf->Cell(30);
			$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		}
		$pdf->Ln(2);

		/*******************/
		/* Télémaintenance */
		/*******************/
		$pdf->SetFont('Arial','IB',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'Télémaintenance : ','LTR',0,'R');

		$pdf->SetFont('Arial','I',8);

		// Type d'accès
		$pdf->Cell(30,4,'Type d\'accès : ','LTR',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'LTR',1,'L');

		// Mode d'accès
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Mode d\'accès : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'R',1,'L');

		// Logiciel télémaintenance
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Logiciel télém. : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'R',1,'L');

		// Mode Service
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Mode service ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non',R,1,'L');

		// Lien d'accès
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Lien d\'accès : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",80),'R',1,'L');

		// Login/MDP
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Login / MDP : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",20)." / ".str_repeat("_",20),'R',1,'L');

		// Arrêt exploitation
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Arrêt exploitation ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non','R',1,'L');

		// Redémarrage
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Redémarrage ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non','R',1,'L');

		$PosY = $pdf->GetY();
		$pdf->Line(17,$PosY,221,$PosY); // On "ferme" le tableau

		$pdf->Ln(2);

		/****************/
		/* Mises à jour */
		/****************/
		$pdf->SetFont('Arial','IB',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'Mises à jour : ','LTR',0,'R');

		$pdf->SetFont('Arial','I',8);

		// Mode
		$pdf->Cell(30,4,'Mode : ','LTR',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'LTR',1,'L');

		// Fréquence/type
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Fréquence : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40)." -> type ".str_repeat("_",20),R,1,'L');

		// Date échéance
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Echéance : ','R',0,'R');
		$pdf->Cell(144,4,'__/__/____',R,1,'L');

		// Date mise à jour
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Dernière MAJ : ','R',0,'R');
		$pdf->Cell(144,4,'__/__/____',R,1,'L');

		// Arrêt exploitation
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Arrêt exploitation ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non',R,1,'L');

		// Redémarrage
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Redémarrage ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non',R,1,'L');

		$PosY = $pdf->GetY();
		$pdf->Line(17,$PosY,221,$PosY); // On "ferme" le tableau

		$pdf->Ln(2);

		/*************/
		/* Problèmes */
		/*************/
		$pdf->SetFont('Arial','BU',10);
		$pdf->Cell(277,5,'PROBLEMES',0,1,'C');
		$pdf->Ln(1);
		$pdf->SetFont('Arial','',7);
		$pdf->SetDrawColor(125);
		for ($i=0; $i <5; $i++)
		{         
			$pdf->Cell(200,4,str_repeat("_",200),0,1,'L');
		}

		$pdf->Ln(5);

		// Validation
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Validé par : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(100,4,str_repeat("_",50),0,0,'L');
		$pdf->Cell(3);

		// Signature
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Signature & Tampon : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->MultiCell(100,4,str_repeat("\n",3),0,'L');

		break;
		
	case 2 :
		//
		// Impression des fiches Matériels 
		//

		// Catégorie
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Catégorie : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Marque
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Marque : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Modèle & NS
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Modèle / NS : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40).' / '.str_repeat("_",40),0,1,'L');

		// Emplacement
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Emplacement : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Codage
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Codage Produit : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",20),0,1,'L');

		// Utilisateur
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Utilisateur : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,str_repeat("_",40),0,1,'L');

		// Date Achat
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Date d\'achat : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,'__/__/____',0,1,'L');

		// Fin de Garantie
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Date d\'achat : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,'__/__/____',0,1,'L');

		// Gtie Sur site / propriétaire
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'G. site / Propriétaire : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(247,4,'___ / ___',0,1,'L');
		
		
		/********************************/
		/* Informations complémentaires */
		/********************************/

		$pdf->Ln(2);
		$pdf->SetFont('Arial','BU',10);
		$pdf->Cell(277,5,'INFORMATIONS COMPLEMENTAIRES','',1,'L');
		$pdf->Ln(2);

		/*********/
		/* Notes */
		/*********/
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Notes : ',0,0,'R');
		$pdf->SetFont('Arial','',7);
		$pdf->SetDrawColor(125);
		$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		for ($i=0; $i <2; $i++)
		{         
			$pdf->Cell(30);
			$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		}

		$pdf->Ln(2);

		/************/
		/* Licences */
		/************/
		$pdf->SetFont('Arial','IB',8);
		$pdf->Cell(30,4,'Détail licences : ',0,0,'R');
		$pdf->SetFont('Arial','',7);
		$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		$pdf->Cell(30,4,'(Noter les n° de folios licences) : ',0,0,'R');
		$pdf->SetFont('Arial','',7);
		$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');

		for ($i=0; $i <1; $i++)
		{         
			$pdf->Cell(30);
			$pdf->Cell(150,4,str_repeat("_",150),0,1,'L');
		}

		$pdf->Ln(2);

		/**********/
		/* Réseau */
		/**********/
		$pdf->SetFont('Arial','IB',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'Réseau : ','LTR',0,'R');

		// Nom du poste
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Nom du poste : ','LTR',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",20),'LTR',1,'L');

		// Groupe Travail
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Groupe de Travail : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",40),'R',1,'L');

		// Domaine
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Domaine : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",40),'R',1,'L');

		// Login / MDP
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Login / MDP : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",40)." / ".str_repeat("_",40),'R',1,'L');

		// MAC
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Adresse MAC : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",40),'R',1,'L');

		// Mode IP
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Mode IP : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,'IP Fixe / IP dynamique','R',1,'L');

		// serveur DHCP
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Serveur DHCP : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,'Oui / Non','R',1,'L');

		// Plage IP / Masque
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Plage IP / Masque : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",20)." / ".str_repeat("_",20)." / ".str_repeat("_",20),R,1,'L');

		// IP / Masque / Passerelle
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'IP / Masque / Pass. : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",20)." / ".str_repeat("_",20)." / ".str_repeat("_",20),R,1,'L');

		// Numéros de prises
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Numéro de prise: ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,'Murale : '.str_repeat("_",15)." / Baie : ".str_repeat("_",15)." / Commutateur : ".str_repeat("_",15),R,1,'L');

		// SNMP / WOL
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'SNMP / WEP : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4," ______ / ______",'R',1,'L');

		// SID / WEP
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'SID / WEP : ','R',0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(144,4,str_repeat("_",42)." / ".str_repeat("_",42),'R',1,'L');

		$PosY = $pdf->GetY();
		$pdf->Line(17,$PosY,221,$PosY); // On "ferme" le tableau

		$pdf->Ln(2);

		/*******************/
		/* Télémaintenance */
		/*******************/
		$pdf->SetFont('Arial','IB',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'Télémaintenance : ','LTR',0,'R');

		$pdf->SetFont('Arial','I',8);

		// Type d'accès
		$pdf->Cell(30,4,'Type d\'accès : ','LTR',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'LTR',1,'L');

		// Mode d'accès
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Mode d\'accès : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'R',1,'L');

		// Logiciel télémaintenance
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Logiciel télém. : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'R',1,'L');

		// Mode Service
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Mode service ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non',R,1,'L');

		// Lien d'accès
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Lien d\'accès : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",80),'R',1,'L');

		// Login/MDP
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Login / MDP : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",20)." / ".str_repeat("_",20),'R',1,'L');

		// Arrêt exploitation
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Arrêt exploitation ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non','R',1,'L');

		// Redémarrage
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Redémarrage ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non','R',1,'L');

		$PosY = $pdf->GetY();
		$pdf->Line(17,$PosY,221,$PosY); // On "ferme" le tableau

		$pdf->Ln(2);

		/****************/
		/* Mises à jour */
		/****************/
		$pdf->SetFont('Arial','IB',8);
		$pdf->Cell(7);
		$pdf->Cell(30,4,'Mises à jour : ','LTR',0,'R');

		$pdf->SetFont('Arial','I',8);

		// Mode
		$pdf->Cell(30,4,'Mode : ','LTR',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40),'LTR',1,'L');

		// Fréquence/type
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Fréquence : ','R',0,'R');
		$pdf->Cell(144,4,str_repeat("_",40)." -> type ".str_repeat("_",20),R,1,'L');

		// Date échéance
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Echéance : ','R',0,'R');
		$pdf->Cell(144,4,'__/__/____',R,1,'L');

		// Date mise à jour
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Dernière MAJ : ','R',0,'R');
		$pdf->Cell(144,4,'__/__/____',R,1,'L');

		// Arrêt exploitation
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Arrêt exploitation ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non',R,1,'L');

		// Redémarrage
		$pdf->Cell(7);
		$pdf->Cell(30,4,'','LR',0,'R');
		$pdf->Cell(30,4,'Redémarrage ? : ','R',0,'R');
		$pdf->Cell(144,4,'Oui / Non',R,1,'L');

		$PosY = $pdf->GetY();
		$pdf->Line(17,$PosY,221,$PosY); // On "ferme" le tableau

		$pdf->Ln(2);

		/*************/
		/* Problèmes */
		/*************/
		$pdf->SetFont('Arial','BU',10);
		$pdf->Cell(277,5,'PROBLEMES',0,1,'C');
		$pdf->Ln(2);
		$pdf->SetFont('Arial','',7);
		$pdf->SetDrawColor(125);
		for ($i=0; $i <5; $i++)
		{         
			$pdf->Cell(200,4,str_repeat("_",200),0,1,'L');
		}

		$pdf->Ln(5);

		// Validation
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Validé par : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->Cell(100,4,str_repeat("_",50),0,0,'L');
		$pdf->Cell(3);

		// Signature
		$pdf->SetFont('Arial','B',8);
		$pdf->Cell(30,4,'Signature & Tampon : ',0,0,'R');
		$pdf->SetFont('Arial','',8);
		$pdf->MultiCell(100,4,str_repeat("\n",4),0,'L');

		break;

	default :
		break;
	}
	$pdf->Output('releve_vierge','I');
}
?>