@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier-BoldOblique'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier-Bold'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -3,6 +3,7 @@ |
||
3 | 3 | $name = 'Courier-Oblique'; |
4 | 4 | $up = -100; |
5 | 5 | $ut = 50; |
6 | -for ($i = 0; $i <= 255; $i++) |
|
7 | - $cw[chr($i)] = 600; |
|
6 | +for ($i = 0; $i <= 255; $i++) { |
|
7 | + $cw[chr($i)] = 600; |
|
8 | +} |
|
8 | 9 | ?> |
@@ -407,8 +407,7 @@ discard block |
||
407 | 407 | { |
408 | 408 | $this->width = $this->orig_height; |
409 | 409 | $this->height = $this->orig_width; |
410 | - } |
|
411 | - else |
|
410 | + } else |
|
412 | 411 | { |
413 | 412 | $this->width = $this->orig_width; |
414 | 413 | $this->height = $this->orig_height; |
@@ -502,8 +501,7 @@ discard block |
||
502 | 501 | { |
503 | 502 | $create = 'imagecreatetruecolor'; |
504 | 503 | $copy = 'imagecopyresampled'; |
505 | - } |
|
506 | - else |
|
504 | + } else |
|
507 | 505 | { |
508 | 506 | $create = 'imagecreate'; |
509 | 507 | $copy = 'imagecopyresized'; |
@@ -1010,25 +1008,27 @@ discard block |
||
1010 | 1008 | // invert the offset. Note: The horizontal |
1011 | 1009 | // offset flips itself automatically |
1012 | 1010 | |
1013 | - if ($this->wm_vrt_alignment == 'B') |
|
1014 | - $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
1011 | + if ($this->wm_vrt_alignment == 'B') { |
|
1012 | + $this->wm_vrt_offset = $this->wm_vrt_offset * -1; |
|
1013 | + } |
|
1015 | 1014 | |
1016 | - if ($this->wm_hor_alignment == 'R') |
|
1017 | - $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
1015 | + if ($this->wm_hor_alignment == 'R') { |
|
1016 | + $this->wm_hor_offset = $this->wm_hor_offset * -1; |
|
1017 | + } |
|
1018 | 1018 | |
1019 | 1019 | // Set font width and height |
1020 | 1020 | // These are calculated differently depending on |
1021 | 1021 | // whether we are using the true type font or not |
1022 | 1022 | if ($this->wm_use_truetype == TRUE) |
1023 | 1023 | { |
1024 | - if ($this->wm_font_size == '') |
|
1025 | - $this->wm_font_size = '17'; |
|
1024 | + if ($this->wm_font_size == '') { |
|
1025 | + $this->wm_font_size = '17'; |
|
1026 | + } |
|
1026 | 1027 | |
1027 | 1028 | $fontwidth = $this->wm_font_size - ($this->wm_font_size / 4); |
1028 | 1029 | $fontheight = $this->wm_font_size; |
1029 | 1030 | $this->wm_vrt_offset += $this->wm_font_size; |
1030 | - } |
|
1031 | - else |
|
1031 | + } else |
|
1032 | 1032 | { |
1033 | 1033 | $fontwidth = imagefontwidth($this->wm_font_size); |
1034 | 1034 | $fontheight = imagefontheight($this->wm_font_size); |
@@ -1065,13 +1065,15 @@ discard block |
||
1065 | 1065 | case "L": |
1066 | 1066 | break; |
1067 | 1067 | case "R": |
1068 | - if ($this->wm_use_drop_shadow) |
|
1069 | - $x_shad += ($this->orig_width - $fontwidth * strlen($this->wm_text)); |
|
1068 | + if ($this->wm_use_drop_shadow) { |
|
1069 | + $x_shad += ($this->orig_width - $fontwidth * strlen($this->wm_text)); |
|
1070 | + } |
|
1070 | 1071 | $x_axis += ($this->orig_width - $fontwidth * strlen($this->wm_text)); |
1071 | 1072 | break; |
1072 | 1073 | case "C": |
1073 | - if ($this->wm_use_drop_shadow) |
|
1074 | - $x_shad += floor(($this->orig_width - $fontwidth * strlen($this->wm_text)) / 2); |
|
1074 | + if ($this->wm_use_drop_shadow) { |
|
1075 | + $x_shad += floor(($this->orig_width - $fontwidth * strlen($this->wm_text)) / 2); |
|
1076 | + } |
|
1075 | 1077 | $x_axis += floor(($this->orig_width - $fontwidth * strlen($this->wm_text)) / 2); |
1076 | 1078 | break; |
1077 | 1079 | } |
@@ -1400,8 +1402,7 @@ discard block |
||
1400 | 1402 | if ($vals['new_width'] == 0) |
1401 | 1403 | { |
1402 | 1404 | $vals['new_width'] = ceil($vals['width'] * $vals['new_height'] / $vals['height']); |
1403 | - } |
|
1404 | - elseif ($vals['new_height'] == 0) |
|
1405 | + } elseif ($vals['new_height'] == 0) |
|
1405 | 1406 | { |
1406 | 1407 | $vals['new_height'] = ceil($vals['new_width'] * $vals['height'] / $vals['width']); |
1407 | 1408 | } |
@@ -369,8 +369,7 @@ |
||
369 | 369 | |
370 | 370 | $tb_array = explode('=', $tb_end); |
371 | 371 | $tb_id = $tb_array[count($tb_array) - 1]; |
372 | - } |
|
373 | - else |
|
372 | + } else |
|
374 | 373 | { |
375 | 374 | $url = rtrim($url, '/'); |
376 | 375 |
@@ -1062,9 +1062,11 @@ |
||
1062 | 1062 | { |
1063 | 1063 | $output = array(); |
1064 | 1064 | @exec('file --brief --mime-type '.escapeshellarg($file['tmp_path']), $output, $return_code); |
1065 | - if ($return_code === 0 && strlen($output[0]) > 0) // A return status code != 0 would mean failed execution |
|
1065 | + if ($return_code === 0 && strlen($output[0]) > 0) { |
|
1066 | + // A return status code != 0 would mean failed execution |
|
1066 | 1067 | { |
1067 | 1068 | $this->file_type = rtrim($output[0]); |
1069 | + } |
|
1068 | 1070 | return; |
1069 | 1071 | } |
1070 | 1072 | } |
@@ -274,8 +274,7 @@ discard block |
||
274 | 274 | if (is_array($val)) |
275 | 275 | { |
276 | 276 | $output .= "<pre>".htmlspecialchars(stripslashes(print_r($val, true)))."</pre>"; |
277 | - } |
|
278 | - else |
|
277 | + } else |
|
279 | 278 | { |
280 | 279 | $output .= htmlspecialchars(stripslashes($val)); |
281 | 280 | } |
@@ -322,8 +321,7 @@ discard block |
||
322 | 321 | if (is_array($val)) |
323 | 322 | { |
324 | 323 | $output .= "<pre>".htmlspecialchars(stripslashes(print_r($val, TRUE)))."</pre>"; |
325 | - } |
|
326 | - else |
|
324 | + } else |
|
327 | 325 | { |
328 | 326 | $output .= htmlspecialchars(stripslashes($val)); |
329 | 327 | } |
@@ -11,25 +11,25 @@ discard block |
||
11 | 11 | |
12 | 12 | |
13 | 13 | $this->page++; |
14 | - if(!isset($this->pages[$this->page])) // solves the problem of overwriting a page if it already exists |
|
14 | + if ( ! isset($this->pages[$this->page])) // solves the problem of overwriting a page if it already exists |
|
15 | 15 | $this->pages[$this->page] = ''; |
16 | - $this->state =2; |
|
16 | + $this->state = 2; |
|
17 | 17 | $this->x = $this->lMargin; |
18 | 18 | $this->y = $this->tMargin; |
19 | 19 | $this->FontFamily = ''; |
20 | 20 | // Check page size and orientation |
21 | - if($orientation=='') |
|
21 | + if ($orientation == '') |
|
22 | 22 | $orientation = $this->DefOrientation; |
23 | 23 | else |
24 | 24 | $orientation = strtoupper($orientation[0]); |
25 | - if($size=='') |
|
25 | + if ($size == '') |
|
26 | 26 | $size = $this->DefPageSize; |
27 | 27 | else |
28 | 28 | $size = $this->_getpagesize($size); |
29 | - if($orientation!=$this->CurOrientation || $size[0]!=$this->CurPageSize[0] || $size[1]!=$this->CurPageSize[1]) |
|
29 | + if ($orientation != $this->CurOrientation || $size[0] != $this->CurPageSize[0] || $size[1] != $this->CurPageSize[1]) |
|
30 | 30 | { |
31 | 31 | // New size or orientation |
32 | - if($orientation=='P') |
|
32 | + if ($orientation == 'P') |
|
33 | 33 | { |
34 | 34 | $this->w = $size[0]; |
35 | 35 | $this->h = $size[1]; |
@@ -39,28 +39,28 @@ discard block |
||
39 | 39 | $this->w = $size[1]; |
40 | 40 | $this->h = $size[0]; |
41 | 41 | } |
42 | - $this->wPt = $this->w*$this->k; |
|
43 | - $this->hPt = $this->h*$this->k; |
|
44 | - $this->PageBreakTrigger = $this->h-$this->bMargin; |
|
42 | + $this->wPt = $this->w * $this->k; |
|
43 | + $this->hPt = $this->h * $this->k; |
|
44 | + $this->PageBreakTrigger = $this->h - $this->bMargin; |
|
45 | 45 | $this->CurOrientation = $orientation; |
46 | 46 | $this->CurPageSize = $size; |
47 | 47 | } |
48 | - if($orientation!=$this->DefOrientation || $size[0]!=$this->DefPageSize[0] || $size[1]!=$this->DefPageSize[1]) |
|
48 | + if ($orientation != $this->DefOrientation || $size[0] != $this->DefPageSize[0] || $size[1] != $this->DefPageSize[1]) |
|
49 | 49 | $this->PageSizes[$this->page] = array($this->wPt, $this->hPt); |
50 | 50 | } |
51 | 51 | |
52 | 52 | function Footer() { |
53 | 53 | // Check if Footer for this page already exists (do the same for Header()) |
54 | - if(!isset($this->footerset[$this->page])) { |
|
54 | + if ( ! isset($this->footerset[$this->page])) { |
|
55 | 55 | $this->SetY(-15); |
56 | 56 | // Page number |
57 | - $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); |
|
57 | + $this->Cell(0, 10, 'Page '.$this->PageNo().'/{nb}', 0, 0, 'C'); |
|
58 | 58 | // set footerset |
59 | 59 | $this->footerset[$this->page] = true; |
60 | 60 | } |
61 | 61 | } |
62 | 62 | |
63 | -function morepagestable($datas, $lineheight=8) { |
|
63 | +function morepagestable($datas, $lineheight = 8) { |
|
64 | 64 | // some things to set and 'remember' |
65 | 65 | $l = $this->lMargin; |
66 | 66 | $startheight = $h = $this->GetY(); |
@@ -68,32 +68,32 @@ discard block |
||
68 | 68 | |
69 | 69 | // calculate the whole width |
70 | 70 | $fullwidth = 0; |
71 | - foreach($this->tablewidths AS $width) { |
|
71 | + foreach ($this->tablewidths AS $width) { |
|
72 | 72 | $fullwidth += $width; |
73 | 73 | } |
74 | 74 | |
75 | 75 | // Now let's start to write the table |
76 | - foreach($datas AS $row => $data) { |
|
76 | + foreach ($datas AS $row => $data) { |
|
77 | 77 | $this->page = $currpage; |
78 | 78 | // write the horizontal borders |
79 | 79 | |
80 | 80 | // write the content and remember the height of the highest col |
81 | - foreach($data AS $col => $txt) { |
|
81 | + foreach ($data AS $col => $txt) { |
|
82 | 82 | $this->page = $currpage; |
83 | - $this->SetXY($l,$h); |
|
83 | + $this->SetXY($l, $h); |
|
84 | 84 | |
85 | - if($col == 5) |
|
86 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
85 | + if ($col == 5) |
|
86 | + $this->MultiCell($this->tablewidths[$col], $lineheight, $txt, 0, "R"); |
|
87 | 87 | else |
88 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
88 | + $this->MultiCell($this->tablewidths[$col], $lineheight, $txt); |
|
89 | 89 | $l += $this->tablewidths[$col]; |
90 | 90 | |
91 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
91 | + if ( ! isset($tmpheight[$row.'-'.$this->page])) |
|
92 | 92 | $tmpheight[$row.'-'.$this->page] = 0; |
93 | - if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
93 | + if ($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
94 | 94 | $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
95 | 95 | } |
96 | - if($this->page > $maxpage) |
|
96 | + if ($this->page > $maxpage) |
|
97 | 97 | $maxpage = $this->page; |
98 | 98 | } |
99 | 99 | |
@@ -107,17 +107,17 @@ discard block |
||
107 | 107 | // draw the borders |
108 | 108 | // we start adding a horizontal line on the last page |
109 | 109 | $this->page = $maxpage; |
110 | - $this->Line($l,$h,$fullwidth+$l,$h); |
|
110 | + $this->Line($l, $h, $fullwidth + $l, $h); |
|
111 | 111 | // now we start at the top of the document and walk down |
112 | - for($i = $startpage; $i <= $maxpage; $i++) { |
|
112 | + for ($i = $startpage; $i <= $maxpage; $i++) { |
|
113 | 113 | $this->page = $i; |
114 | 114 | $l = $this->lMargin; |
115 | 115 | $t = ($i == $startpage) ? $startheight : $this->tMargin; |
116 | - $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin; |
|
117 | - $this->Line($l,$t,$l,$lh); |
|
118 | - foreach($this->tablewidths AS $width) { |
|
116 | + $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; |
|
117 | + $this->Line($l, $t, $l, $lh); |
|
118 | + foreach ($this->tablewidths AS $width) { |
|
119 | 119 | $l += $width; |
120 | - $this->Line($l,$t,$l,$lh); |
|
120 | + $this->Line($l, $t, $l, $lh); |
|
121 | 121 | } |
122 | 122 | } |
123 | 123 | // set it to the last page, if not it'll cause some problems |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | |
128 | 128 | |
129 | -function table_total($datas, $lineheight=8) { |
|
129 | +function table_total($datas, $lineheight = 8) { |
|
130 | 130 | // some things to set and 'remember' |
131 | 131 | $l = $this->lMargin; |
132 | 132 | $startheight = $h = $this->GetY(); |
@@ -134,37 +134,37 @@ discard block |
||
134 | 134 | |
135 | 135 | // calculate the whole width |
136 | 136 | $fullwidth = 0; |
137 | - foreach($this->tablewidths AS $width) { |
|
137 | + foreach ($this->tablewidths AS $width) { |
|
138 | 138 | $fullwidth += $width; |
139 | 139 | } |
140 | 140 | |
141 | 141 | // Now let's start to write the table |
142 | - foreach($datas AS $row => $data) { |
|
142 | + foreach ($datas AS $row => $data) { |
|
143 | 143 | $this->page = $currpage; |
144 | 144 | // write the horizontal borders |
145 | - if($data != "") |
|
146 | - $this->Line(100,$h,200,$h); |
|
145 | + if ($data != "") |
|
146 | + $this->Line(100, $h, 200, $h); |
|
147 | 147 | // write the content and remember the height of the highest col |
148 | - foreach($data AS $col => $txt) { |
|
148 | + foreach ($data AS $col => $txt) { |
|
149 | 149 | $this->page = $currpage; |
150 | - $this->SetXY($l,$h); |
|
150 | + $this->SetXY($l, $h); |
|
151 | 151 | |
152 | - if($col == 3) |
|
152 | + if ($col == 3) |
|
153 | 153 | $this->SetFont('Arial', 'B', 8); |
154 | 154 | else |
155 | 155 | $this->SetFont('Arial', '', 8); |
156 | - if($col == 5) |
|
157 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
156 | + if ($col == 5) |
|
157 | + $this->MultiCell($this->tablewidths[$col], $lineheight, $txt, 0, "R"); |
|
158 | 158 | else |
159 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
159 | + $this->MultiCell($this->tablewidths[$col], $lineheight, $txt); |
|
160 | 160 | $l += $this->tablewidths[$col]; |
161 | 161 | |
162 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
162 | + if ( ! isset($tmpheight[$row.'-'.$this->page])) |
|
163 | 163 | $tmpheight[$row.'-'.$this->page] = 0; |
164 | - if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
164 | + if ($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
165 | 165 | $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
166 | 166 | } |
167 | - if($this->page > $maxpage) |
|
167 | + if ($this->page > $maxpage) |
|
168 | 168 | $maxpage = $this->page; |
169 | 169 | } |
170 | 170 | |
@@ -179,21 +179,21 @@ discard block |
||
179 | 179 | // we start adding a horizontal line on the last page |
180 | 180 | $this->page = $maxpage; |
181 | 181 | |
182 | - $this->Line(100,$h,200,$h); |
|
182 | + $this->Line(100, $h, 200, $h); |
|
183 | 183 | |
184 | 184 | // now we start at the top of the document and walk down |
185 | - for($i = $startpage; $i <= $maxpage; $i++) { |
|
185 | + for ($i = $startpage; $i <= $maxpage; $i++) { |
|
186 | 186 | $this->page = $i; |
187 | 187 | $l = $this->lMargin; |
188 | 188 | $t = ($i == $startpage) ? $startheight : $this->tMargin; |
189 | - $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin; |
|
189 | + $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; |
|
190 | 190 | |
191 | - foreach($this->tablewidths AS $width) { |
|
191 | + foreach ($this->tablewidths AS $width) { |
|
192 | 192 | $l += $width; |
193 | - if($width != '30') |
|
193 | + if ($width != '30') |
|
194 | 194 | { |
195 | - $this->Line(100,$t,100,$lh); |
|
196 | - $this->Line($l,$t,$l,$lh); |
|
195 | + $this->Line(100, $t, 100, $lh); |
|
196 | + $this->Line($l, $t, $l, $lh); |
|
197 | 197 | } |
198 | 198 | } |
199 | 199 | } |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | } |
203 | 203 | |
204 | 204 | |
205 | -function export_pdf($datas, $lineheight=8) { |
|
205 | +function export_pdf($datas, $lineheight = 8) { |
|
206 | 206 | // some things to set and 'remember' |
207 | 207 | $l = $this->lMargin; |
208 | 208 | $startheight = $h = $this->GetY(); |
@@ -210,32 +210,32 @@ discard block |
||
210 | 210 | |
211 | 211 | // calculate the whole width |
212 | 212 | $fullwidth = 0; |
213 | - foreach($this->tablewidths AS $width) { |
|
213 | + foreach ($this->tablewidths AS $width) { |
|
214 | 214 | $fullwidth += $width; |
215 | 215 | } |
216 | 216 | |
217 | 217 | // Now let's start to write the table |
218 | - foreach($datas AS $row => $data) { |
|
218 | + foreach ($datas AS $row => $data) { |
|
219 | 219 | $this->page = $currpage; |
220 | 220 | // write the horizontal borders |
221 | - $this->Line($l,$h,$fullwidth+$l,$h); |
|
221 | + $this->Line($l, $h, $fullwidth + $l, $h); |
|
222 | 222 | // write the content and remember the height of the highest col |
223 | - foreach($data AS $col => $txt) { |
|
223 | + foreach ($data AS $col => $txt) { |
|
224 | 224 | $this->page = $currpage; |
225 | - $this->SetXY($l,$h); |
|
225 | + $this->SetXY($l, $h); |
|
226 | 226 | |
227 | - if($col == 5) |
|
228 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
227 | + if ($col == 5) |
|
228 | + $this->MultiCell($this->tablewidths[$col], $lineheight, $txt, 0, "R"); |
|
229 | 229 | else |
230 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
230 | + $this->MultiCell($this->tablewidths[$col], $lineheight, $txt); |
|
231 | 231 | $l += $this->tablewidths[$col]; |
232 | 232 | |
233 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
233 | + if ( ! isset($tmpheight[$row.'-'.$this->page])) |
|
234 | 234 | $tmpheight[$row.'-'.$this->page] = 0; |
235 | - if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
235 | + if ($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
236 | 236 | $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
237 | 237 | } |
238 | - if($this->page > $maxpage) |
|
238 | + if ($this->page > $maxpage) |
|
239 | 239 | $maxpage = $this->page; |
240 | 240 | } |
241 | 241 | |
@@ -249,17 +249,17 @@ discard block |
||
249 | 249 | // draw the borders |
250 | 250 | // we start adding a horizontal line on the last page |
251 | 251 | $this->page = $maxpage; |
252 | - $this->Line($l,$h,$fullwidth+$l,$h); |
|
252 | + $this->Line($l, $h, $fullwidth + $l, $h); |
|
253 | 253 | // now we start at the top of the document and walk down |
254 | - for($i = $startpage; $i <= $maxpage; $i++) { |
|
254 | + for ($i = $startpage; $i <= $maxpage; $i++) { |
|
255 | 255 | $this->page = $i; |
256 | 256 | $l = $this->lMargin; |
257 | 257 | $t = ($i == $startpage) ? $startheight : $this->tMargin; |
258 | - $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin; |
|
259 | - $this->Line($l,$t,$l,$lh); |
|
260 | - foreach($this->tablewidths AS $width) { |
|
258 | + $lh = ($i == $maxpage) ? $h : $this->h - $this->bMargin; |
|
259 | + $this->Line($l, $t, $l, $lh); |
|
260 | + foreach ($this->tablewidths AS $width) { |
|
261 | 261 | $l += $width; |
262 | - $this->Line($l,$t,$l,$lh); |
|
262 | + $this->Line($l, $t, $l, $lh); |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | // set it to the last page, if not it'll cause some problems |
@@ -11,21 +11,25 @@ discard block |
||
11 | 11 | |
12 | 12 | |
13 | 13 | $this->page++; |
14 | - if(!isset($this->pages[$this->page])) // solves the problem of overwriting a page if it already exists |
|
14 | + if(!isset($this->pages[$this->page])) { |
|
15 | + // solves the problem of overwriting a page if it already exists |
|
15 | 16 | $this->pages[$this->page] = ''; |
17 | + } |
|
16 | 18 | $this->state =2; |
17 | 19 | $this->x = $this->lMargin; |
18 | 20 | $this->y = $this->tMargin; |
19 | 21 | $this->FontFamily = ''; |
20 | 22 | // Check page size and orientation |
21 | - if($orientation=='') |
|
22 | - $orientation = $this->DefOrientation; |
|
23 | - else |
|
24 | - $orientation = strtoupper($orientation[0]); |
|
25 | - if($size=='') |
|
26 | - $size = $this->DefPageSize; |
|
27 | - else |
|
28 | - $size = $this->_getpagesize($size); |
|
23 | + if($orientation=='') { |
|
24 | + $orientation = $this->DefOrientation; |
|
25 | + } else { |
|
26 | + $orientation = strtoupper($orientation[0]); |
|
27 | + } |
|
28 | + if($size=='') { |
|
29 | + $size = $this->DefPageSize; |
|
30 | + } else { |
|
31 | + $size = $this->_getpagesize($size); |
|
32 | + } |
|
29 | 33 | if($orientation!=$this->CurOrientation || $size[0]!=$this->CurPageSize[0] || $size[1]!=$this->CurPageSize[1]) |
30 | 34 | { |
31 | 35 | // New size or orientation |
@@ -33,8 +37,7 @@ discard block |
||
33 | 37 | { |
34 | 38 | $this->w = $size[0]; |
35 | 39 | $this->h = $size[1]; |
36 | - } |
|
37 | - else |
|
40 | + } else |
|
38 | 41 | { |
39 | 42 | $this->w = $size[1]; |
40 | 43 | $this->h = $size[0]; |
@@ -45,9 +48,10 @@ discard block |
||
45 | 48 | $this->CurOrientation = $orientation; |
46 | 49 | $this->CurPageSize = $size; |
47 | 50 | } |
48 | - if($orientation!=$this->DefOrientation || $size[0]!=$this->DefPageSize[0] || $size[1]!=$this->DefPageSize[1]) |
|
49 | - $this->PageSizes[$this->page] = array($this->wPt, $this->hPt); |
|
50 | -} |
|
51 | + if($orientation!=$this->DefOrientation || $size[0]!=$this->DefPageSize[0] || $size[1]!=$this->DefPageSize[1]) { |
|
52 | + $this->PageSizes[$this->page] = array($this->wPt, $this->hPt); |
|
53 | + } |
|
54 | + } |
|
51 | 55 | |
52 | 56 | function Footer() { |
53 | 57 | // Check if Footer for this page already exists (do the same for Header()) |
@@ -82,19 +86,22 @@ discard block |
||
82 | 86 | $this->page = $currpage; |
83 | 87 | $this->SetXY($l,$h); |
84 | 88 | |
85 | - if($col == 5) |
|
86 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
87 | - else |
|
88 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
89 | + if($col == 5) { |
|
90 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
91 | + } else { |
|
92 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
93 | + } |
|
89 | 94 | $l += $this->tablewidths[$col]; |
90 | 95 | |
91 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
92 | - $tmpheight[$row.'-'.$this->page] = 0; |
|
96 | + if(!isset($tmpheight[$row.'-'.$this->page])) { |
|
97 | + $tmpheight[$row.'-'.$this->page] = 0; |
|
98 | + } |
|
93 | 99 | if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
94 | 100 | $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
95 | 101 | } |
96 | - if($this->page > $maxpage) |
|
97 | - $maxpage = $this->page; |
|
102 | + if($this->page > $maxpage) { |
|
103 | + $maxpage = $this->page; |
|
104 | + } |
|
98 | 105 | } |
99 | 106 | |
100 | 107 | // get the height we were in the last used page |
@@ -142,30 +149,35 @@ discard block |
||
142 | 149 | foreach($datas AS $row => $data) { |
143 | 150 | $this->page = $currpage; |
144 | 151 | // write the horizontal borders |
145 | - if($data != "") |
|
146 | - $this->Line(100,$h,200,$h); |
|
152 | + if($data != "") { |
|
153 | + $this->Line(100,$h,200,$h); |
|
154 | + } |
|
147 | 155 | // write the content and remember the height of the highest col |
148 | 156 | foreach($data AS $col => $txt) { |
149 | 157 | $this->page = $currpage; |
150 | 158 | $this->SetXY($l,$h); |
151 | 159 | |
152 | - if($col == 3) |
|
153 | - $this->SetFont('Arial', 'B', 8); |
|
154 | - else |
|
155 | - $this->SetFont('Arial', '', 8); |
|
156 | - if($col == 5) |
|
157 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
158 | - else |
|
159 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
160 | + if($col == 3) { |
|
161 | + $this->SetFont('Arial', 'B', 8); |
|
162 | + } else { |
|
163 | + $this->SetFont('Arial', '', 8); |
|
164 | + } |
|
165 | + if($col == 5) { |
|
166 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
167 | + } else { |
|
168 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
169 | + } |
|
160 | 170 | $l += $this->tablewidths[$col]; |
161 | 171 | |
162 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
163 | - $tmpheight[$row.'-'.$this->page] = 0; |
|
172 | + if(!isset($tmpheight[$row.'-'.$this->page])) { |
|
173 | + $tmpheight[$row.'-'.$this->page] = 0; |
|
174 | + } |
|
164 | 175 | if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
165 | 176 | $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
166 | 177 | } |
167 | - if($this->page > $maxpage) |
|
168 | - $maxpage = $this->page; |
|
178 | + if($this->page > $maxpage) { |
|
179 | + $maxpage = $this->page; |
|
180 | + } |
|
169 | 181 | } |
170 | 182 | |
171 | 183 | // get the height we were in the last used page |
@@ -224,19 +236,22 @@ discard block |
||
224 | 236 | $this->page = $currpage; |
225 | 237 | $this->SetXY($l,$h); |
226 | 238 | |
227 | - if($col == 5) |
|
228 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
229 | - else |
|
230 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
239 | + if($col == 5) { |
|
240 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
241 | + } else { |
|
242 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
243 | + } |
|
231 | 244 | $l += $this->tablewidths[$col]; |
232 | 245 | |
233 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
234 | - $tmpheight[$row.'-'.$this->page] = 0; |
|
246 | + if(!isset($tmpheight[$row.'-'.$this->page])) { |
|
247 | + $tmpheight[$row.'-'.$this->page] = 0; |
|
248 | + } |
|
235 | 249 | if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
236 | 250 | $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
237 | 251 | } |
238 | - if($this->page > $maxpage) |
|
239 | - $maxpage = $this->page; |
|
252 | + if($this->page > $maxpage) { |
|
253 | + $maxpage = $this->page; |
|
254 | + } |
|
240 | 255 | } |
241 | 256 | |
242 | 257 | // get the height we were in the last used page |