<?php
class appendiceHelper
{
public $document;
public $documentDealer;
public $documentDate;
public $Luglio2015;
public $Ottobre2015;
public $special;
public function __construct($dealer,$date) {
$this->documentDealer = $dealer;
$this->documentDate = new DateTime($date);
$this->document = "pdf/appendice_EM.pdf";
$this->special = 0;
$this->IsSpecial();
$this->Luglio2015 = new DateTime();
$this->Luglio2015->setDate(2015, 7, 1);
$this->Luglio2015->setTime(00, 01);
$this->Ottobre2015 = new DateTime();
$this->Ottobre2015->setDate(2015, 10, 1);
$this->Ottobre2015->setTime(00, 01);
}
private function IsSpecial()
{
//Dealer Stracciari - Authos
if ($this->documentDealer == 882) $this->special = 1;
if ($this->documentDealer == 1821) $this->special = 1;
if ($this->documentDealer == 2633) $this->special = 1;
if ($this->documentDealer == 3194) $this->special = 1;
if ($this->documentDealer == 3206) $this->special = 1;
if ($this->documentDealer == 3210) $this->special = 1;
if ($this->documentDealer == 3218) $this->special = 1;
if ($this->documentDealer == 3223) $this->special = 1;
}
public function getDocument()
{
$this->document = "pdf/app_cert_4.pdf";
$intervalLuglio2015 = $this->Luglio2015->diff($this->documentDate)->invert;
$intervalOttobre2015 = $this->Ottobre2015->diff($this->documentDate)->invert;
if($intervalOttobre2015 == 1) $this->document = "pdf/app_cert_2.pdf";
if($intervalLuglio2015 == 1) $this->document = "pdf/app_cert_1.pdf";
if($this->special == 1)
{
$this->document = "pdf/app_cert_5_special.pdf";
if($intervalOttobre2015 == 1) $this->document = "pdf/app_cert_3_special.pdf";
if($intervalLuglio2015 == 1) $this->document = "pdf/app_cert_1.pdf";
}
return $this->document;
}
}
$test = new appendiceHelper(1, new DateTime();)
?>
- Output for 7.0.0 - 7.0.1
- Parse error: syntax error, unexpected ';', expecting ',' or ')' in /in/VHdEj on line 66
Process exited with code 255. - Output for 5.5.24 - 5.5.30, 5.6.8 - 5.6.16
- Parse error: syntax error, unexpected ';' in /in/VHdEj on line 66
Process exited with code 255.
preferences:
156.01 ms | 1395 KiB | 25 Q