noalyss Version-9
Public Member Functions | Private Attributes
Card_PDF Class Reference
+ Inheritance diagram for Card_PDF:
+ Collaboration diagram for Card_PDF:

Public Member Functions

 __construct ($p_card_id)
 
 export ()
 
 getCardId ()
 
 setCardId ($card_id)
 
- Public Member Functions inherited from PDF
 __construct (Database $p_cn, $orientation='P', $unit='mm', $format='A4')
 
 Footer ()
 
 get_tiers ($p_jr_id, $p_jrn_type)
 retrieve the client name and quick_code More...
 
 Header ()
 
 set_filter_operation ($filter_operation)
 
 setDossierInfo ($dossier="n/a")
 
- Public Member Functions inherited from PDF_Core
 __construct ( $orientation='P', $unit='mm', $format='A4')
 
 get_margin_bottom ()
 
 get_margin_left ()
 
 get_margin_right ()
 
 get_margin_top ()
 
 get_orientation ()
 
 get_page_size ()
 
 get_unit ()
 
 is_fill ($p_step)
 If the step is even then return 1 and set the backgroup color to blue , otherwise returns 0, and set the background color to white It is use to compute alternated colored row , it the parameter fill in write_cell and cell. More...
 
 line_new ($p_step=null)
 Print all the cell stored and call Ln (new line) More...
 
 LongLine ($w, $h, $txt, $border=0, $align='', $fill=false)
 
 write_cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
 

Private Attributes

 $card
 

Additional Inherited Members

- Data Fields inherited from PDF
 $cn = null
 
 $date = ""
 
 $dossier = "n/a"
 
 $own = null
 
 $soc = ""
 
- Protected Member Functions inherited from PDF_Core
 print_row ()
 print the current array of cell and reset it , if different colors are set on the same row you have to print it before changing More...
 

Detailed Description

Definition at line 11 of file card_pdf.class.php.

Constructor & Destructor Documentation

◆ __construct()

Card_PDF::__construct (   $p_card_id)

Definition at line 14 of file card_pdf.class.php.

15 {
16 global $cn;
17 $this->card=new \Fiche ($cn,$p_card_id);
18 $this->card->load();
19 parent::__construct($cn, "P");
20 $this->setDossierInfo($this->card->strAttribut(ATTR_DEF_QUICKCODE));
21 }
setDossierInfo($dossier="n/a")
Definition: pdf.class.php:52
const ATTR_DEF_QUICKCODE
Definition: constant.php:237

References PDF\$cn, ATTR_DEF_QUICKCODE, and PDF\setDossierInfo().

+ Here is the call graph for this function:

Member Function Documentation

◆ export()

Card_PDF::export ( )

Definition at line 40 of file card_pdf.class.php.

41 {
42 $nb_attribut = count($this->card->attribut);
43// var_dump(
44// $this->card->attribut
45// );
46 if ($nb_attribut == 0) {
47 throw new \Exception(_("card_pdf.044 , card_inexistante"));
48 }
49 $this->setTitle($this->card->get_quick_code()." ".strtoupper($this->card->strAttribut(1))
50 ." ".$this->card->strAttribut(32,0), true);
51 $this->SetAuthor('NOALYSS');
52 $this->AliasNbPages();
53 $this->AddPage();
54
55 $this->setFont("DejaVu", '', 7);
56 $this->SetDrawColor(214, 209, 209);
57 for ($i=0;$i<$nb_attribut;$i++)
58 {
59 $border="B";
60 $this->write_cell(60,5,$this->card->attribut[$i]->ad_text,$border);
61 $this->write_cell(100,5,$this->card->attribut[$i]->av_text,$border);
62 $this->line_new(5);
63 }
64
65
66 $filename=$this->card->strAttribut(1)."-".$this->card->strAttribut(23).".pdf";
67 $filename=sanitize_filename($filename);
68 $this->Output($filename,"D");
69 }
sanitize_filename($filename)
removed invalid character when computing a filename, the suffix is kept
Definition: ac_common.php:1784
line_new($p_step=null)
Print all the cell stored and call Ln (new line)
write_cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')

References $i, PDF_Core\line_new(), sanitize_filename(), and PDF_Core\write_cell().

+ Here is the call graph for this function:

◆ getCardId()

Card_PDF::getCardId ( )
Returns
mixed

Definition at line 26 of file card_pdf.class.php.

27 {
28 return $this->card->get_id();
29 }

◆ setCardId()

Card_PDF::setCardId (   $card_id)
Parameters
mixed$card_id

Definition at line 34 of file card_pdf.class.php.

35 {
36 $this->card->set_id($card_id);
37 $this->card->load();
38 }
$card_id

References $card_id.

Field Documentation

◆ $card

Card_PDF::$card
private

Definition at line 13 of file card_pdf.class.php.


The documentation for this class was generated from the following file: