app=$app; $this->acquireData($briefId); //print_r($this->senderData); $this->assemblePDF(); //$this->displayDocument(); } function acquireData($briefId) { // Briefdetails $query = "SELECT * FROM brief WHERE id=".$briefId; $this->letterData = $this->app->DB->SelectArr($query); $this->letterData = $this->letterData[0]; // Emfänger //$query = "SELECT * FROM adresse WHERE id=".$this->letterData['adresse']; //$this->recipientData = $this->app->DB->SelectArr($query); //$this->recipientData = $this->recipientData[0]; $this->setRecipientDB($this->letterData['adresse']); // Sender $query = "SELECT * FROM adresse WHERE id=".$this->letterData['bearbeiter']; $this->senderData = $this->app->DB->SelectArr($query); $this->senderData = $this->senderData[0]; } function displayDocument() { if($this->recipientData['typ']=="person") { $this->setDocumentDetails( "recipient", array("enterprise"=>"","firstname"=>$this->recipientData['vorname'],"familyname"=>$this->recipientData['name'],"address1"=>$this->recipientData['strasse'],"address2"=>$this->recipientData['adresszusatz'],"areacode"=>$this->recipientData['plz'],"city"=>$this->recipientData['ort'],"country"=>$this->recipientData['land'],"phone1"=>$this->recipientData['telefon'],"fax"=>$this->recipientData['telefax'],"email"=>$this->recipientData['email'],"web"=>"","taxnr"=>"", "ustid"=>$this->recipientData['ustid']) ); } else { $this->setDocumentDetails( "recipient", array("enterprise"=>$this->recipientData['name'],"firstname"=>"","familyname"=>"","address1"=>$this->recipientData['strasse'],"address2"=>"","areacode"=>$this->recipientData['plz'],"city"=>$this->recipientData['ort'],"country"=>$this->recipientData['land'],"phone1"=>$this->recipientData['telefon'],"fax"=>$this->recipientData['telefax'],"email"=>$this->recipientData['email'],"web"=>"","taxnr"=>"", "ustid"=>$this->recipientData['ustid']) ); } if($this->senderData['typ']=="person") { $this->setDocumentDetails( "sender", array("enterprise"=>"","firstname"=>$this->senderData['vorname'],"familyname"=>$this->senderData['name'],"address1"=>$this->senderData['strasse'],"address2"=>$this->senderData['adresszusatz'],"areacode"=>$this->senderData['plz'],"city"=>$this->senderData['ort'],"country"=>$this->senderData['land'],"phone1"=>$this->senderData['telefon'],"fax"=>$this->senderData['telefax'],"email"=>$this->senderData['email'],"web"=>"","taxnr"=>"", "ustid"=>$this->senderData['ustid']) ); } else { $this->setDocumentDetails( "sender", array("enterprise"=>$this->senderData['name'],"firstname"=>"","familyname"=>"","address1"=>$this->senderData['strasse'],"address2"=>"","areacode"=>$this->senderData['plz'],"city"=>$this->senderData['ort'],"country"=>$this->senderData['land'],"phone1"=>$this->senderData['telefon'],"fax"=>$this->senderData['telefax'],"email"=>$this->senderData['email'],"web"=>"","taxnr"=>"", "ustid"=>$this->senderData['ustid']) ); } $this->setDocumentDetails( "letterDetails", array('subject' => $this->letterData['betreff'], 'salutation' => BEGRUESSUNG, 'body' => $this->letterData['nachricht'], 'valediction' => SCHLUSSFORMEL) ); $this->setLogo("logo_briefkopf.jpg"); parent::displayDocument(); } }