Passed
Branch master (1c14b0)
by Saepul
02:59
created
emailsend.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@
 block discarded – undo
7 7
 {	$emailstatus = $_POST['emailstatus'];
8 8
 	if($emailstatus=="Sent")
9 9
 	{	$errors[] = 'You have sent this email!';
10
-	}else
10
+	} else
11 11
 	{	$to 	 = $_POST['emailto'];
12 12
 		$cc 	 = substr($_POST['emailcc'], 0, -2);
13 13
 		$subject = $_POST['emailsubject'];
Please login to merge, or discard this patch.
useradd.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -3,10 +3,10 @@
 block discarded – undo
3 3
 $general->logged_out_protect();
4 4
 if (isset($_POST['submit'])) 
5 5
 {	if ($users->user_exists($_POST['username']) == true && !empty($_POST['username']))
6
-    {	$errors[] = 'Sorry, username '.$_POST['username'].' is already exists!';
6
+	{	$errors[] = 'Sorry, username '.$_POST['username'].' is already exists!';
7 7
 	}
8 8
 	if ($users->email_exists($_POST['email']) == true && !empty($_POST['email']))
9
-    {	$errors[] = 'Sorry, email '.$_POST['email'].' is already exists!';
9
+	{	$errors[] = 'Sorry, email '.$_POST['email'].' is already exists!';
10 10
 	}
11 11
 	if(empty($errors) === true)
12 12
 	{	$fullname 	= $_POST['fullname'];
Please login to merge, or discard this patch.
changepwd.php 1 patch
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@
 block discarded – undo
8 8
 	$userpassword	= $user['password'];
9 9
 	if ($oldpassword != $userpassword)
10 10
 	{	$errors[] = 'The old password does not match!';	
11
-	}else
11
+	} else
12 12
 	{	$newpassword1 	= $_POST['newpassword1'];
13 13
 		$users->changepwd($userid,$newpassword1);
14 14
 		$users->log_users($_SESSION['loginid'],"Change the old password");
Please login to merge, or discard this patch.
ticketlist.php 1 patch
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -3,8 +3,7 @@  discard block
 block discarded – undo
3 3
 $general->logged_out_protect();
4 4
 $user = $users->userdata($_SESSION['loginid']);
5 5
 if($user['level'] == "Admin" || $user['level'] == "Manager")
6
-{$akses=true;}
7
-else 
6
+{$akses=true;} else 
8 7
 {$akses=false;}
9 8
 if ($akses=False)
10 9
 {exit("You don't have permission to access this page!");}
@@ -77,10 +76,8 @@  discard block
 block discarded – undo
77 76
 			$slagoaltime=strtotime("+$resolutiontime hours",$documenteddate);
78 77
 			$slawarningtime=strtotime("+$slawarning hours",$documenteddate);
79 78
 			if ($currenttime > $slagoaltime)
80
-			{$slabgcolor="#FF0000";$slatxtcolor="#ffffff";}
81
-			else if ($currenttime >= $slawarningtime)
82
-			{$slabgcolor="#FFFF00";$slatxtcolor="#000000";}
83
-			else {$slabgcolor="#00FF00";$slatxtcolor="#000000";}
79
+			{$slabgcolor="#FF0000";$slatxtcolor="#ffffff";} else if ($currenttime >= $slawarningtime)
80
+			{$slabgcolor="#FFFF00";$slatxtcolor="#000000";} else {$slabgcolor="#00FF00";$slatxtcolor="#000000";}
84 81
 			$customer = $customers->customer_data($ticket['idcustomer']);
85 82
 			$user = $users->userdata($ticket['assignee']);
86 83
 			echo '<tr><td><a href=ticketedit.php?id='.$ticket['id']. '>'.$ticket['ticketnumber'].'</a></td>'.
Please login to merge, or discard this patch.
userlist.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -62,8 +62,7 @@
 block discarded – undo
62 62
 		<?php 
63 63
 		foreach ($members as $member) {
64 64
 			if ($member['confirmed']=='1')
65
-			{$locked='No';}
66
-			else
65
+			{$locked='No';} else
67 66
 			{$locked='Yes';}
68 67
 			echo '<tr><td><a href=useredit.php?id='.$member['id']. '>'.$member['username'].'</a></td>'.
69 68
 				 '<td>'.$member['level'].'</td>'.
Please login to merge, or discard this patch.
slaadd.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@
 block discarded – undo
12 12
 	$resolutiontime = $_POST['resolutiontime'];
13 13
 	$slawarning		= $_POST['slawarning'];
14 14
 	if ($slas->sla_exists($slaid) === true) {
15
-        $errors[] = 'SLA ID is already exists!';
16
-    } else {
15
+		$errors[] = 'SLA ID is already exists!';
16
+	} else {
17 17
 		$slas->add_sla($slaid,$namasla,$responsetime,$resolutiontime,$slawarning);
18 18
 		header('location:slalist.php');
19 19
 	}
Please login to merge, or discard this patch.
statistic/rpt001print.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -21,13 +21,11 @@
 block discarded – undo
21 21
 	{	header('Content-type: application/vnd.ms-word');
22 22
 		header('Content-Disposition: attachment; Filename="'.$reportname.'.doc"');
23 23
 		echo $content;
24
-	}
25
-	elseif($_POST['format']=='2')
24
+	} elseif($_POST['format']=='2')
26 25
 	{	header('Content-type: application/ms-excel');
27 26
 		header('Content-Disposition: attachment; filename="'.$reportname.'.xls"');
28 27
 		echo $content;
29
-	}
30
-	elseif($_POST['format']=='3')
28
+	} elseif($_POST['format']=='3')
31 29
 	{	$filename=$reportname.'.pdf';
32 30
 		define('FPDF_FONTPATH','pdftable/font/');
33 31
 		require('pdftable/lib/pdftable.inc.php');
Please login to merge, or discard this patch.
statistic/pdftable/font/courier.php 1 patch
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@
 block discarded – undo
1 1
 <?php
2
-for($i=0;$i<=255;$i++)
2
+for($i=0;$i<=255;$i++) {
3 3
 	$fpdf_charwidths['courier'][chr($i)]=600;
4
+}
4 5
 $fpdf_charwidths['courierB']=$fpdf_charwidths['courier'];
5 6
 $fpdf_charwidths['courierI']=$fpdf_charwidths['courier'];
6 7
 $fpdf_charwidths['courierBI']=$fpdf_charwidths['courier'];
Please login to merge, or discard this patch.
statistic/pdftable/lib/pdftable.inc.php 2 patches
Indentation   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -397,10 +397,10 @@
 block discarded – undo
397 397
 	$f = fopen($path,'r');
398 398
 	fseek($f,13,SEEK_SET);
399 399
 	$info = fread($f,3);
400
-    fclose($f);
401
-    $iUnit = ord($info{0});
402
-    $iX = ord($info{1}) * 256 + ord($info{2});
403
-    return array($iUnit, $iX);
400
+	fclose($f);
401
+	$iUnit = ord($info{0});
402
+	$iX = ord($info{1}) * 256 + ord($info{2});
403
+	return array($iUnit, $iX);
404 404
 }
405 405
 private function _html2text($text){
406 406
 	$text = str_replace('&nbsp;',' ',$text);
Please login to merge, or discard this patch.
Braces   +383 added lines, -175 removed lines patch added patch discarded remove patch
@@ -65,9 +65,13 @@  discard block
 block discarded – undo
65 65
 }
66 66
 
67 67
 function SetHeaderFooter($header='',$footer=''){
68
-	if ($header) $this->headerTable = $header;
69
-	if ($footer) $this->footerTable = $footer;
70
-}
68
+	if ($header) {
69
+		$this->headerTable = $header;
70
+	}
71
+	if ($footer) {
72
+		$this->footerTable = $footer;
73
+	}
74
+	}
71 75
 function Header(){
72 76
 	$this->_makePageSize();
73 77
 	if ($this->headerTable){
@@ -97,7 +101,9 @@  discard block
 block discarded – undo
97 101
  * Tra ve chieu cao cua 1 dong theo font hien hanh
98 102
  */
99 103
 function getLineHeight($fontSize = 0){
100
-	if ($fontSize == 0) $fontSize = $this->FontSizePt;
104
+	if ($fontSize == 0) {
105
+		$fontSize = $this->FontSizePt;
106
+	}
101 107
 	return $fontSize*2/$this->k;
102 108
 }
103 109
 
@@ -114,19 +120,26 @@  discard block
 block discarded – undo
114 120
 	foreach ($c['font'] as &$f){
115 121
 		$this->_setFontText($f);
116 122
 		$hl = $this->getLineHeight();
117
-		if ($maxline<$hl || $x==$this->paddingCell) $maxline=$hl;
118
-		if (!isset($f['space'])) continue;
123
+		if ($maxline<$hl || $x==$this->paddingCell) {
124
+			$maxline=$hl;
125
+		}
126
+		if (!isset($f['space'])) {
127
+			continue;
128
+		}
119 129
 		$space = $f['space'];
120 130
 		foreach ($f['line'] as $i=>&$l){
121
-			if ($x!=$this->paddingCell) $x+=$space;
122
-			if (isset($l['str'])&&is_array($l['str']))
123
-			foreach ($l['str'] as &$t){
131
+			if ($x!=$this->paddingCell) {
132
+				$x+=$space;
133
+			}
134
+			if (isset($l['str'])&&is_array($l['str'])) {
135
+						foreach ($l['str'] as &$t){
124 136
 				if (!is_array($t)) continue;
137
+			}
125 138
 				if ($x==$this->paddingCell||$x+$t[1]<=$maxw){
126 139
 					$c['wlinet'][$countline][0] += $t[1];
127 140
 					$c['wlinet'][$countline][1]++;
128 141
 					$x += $t[1]+(($x>$this->paddingCell)?$space:0);
129
-				}else{//auto break line
142
+				} else{//auto break line
130 143
 					$h+=$maxline*FHR + $this->spacingLine;
131 144
 					$c['hline'][] = $maxline*FHR + $this->spacingLine;
132 145
 					$c['wlines'][$countline] = $x-$this->paddingCell;
@@ -158,8 +171,14 @@  discard block
 block discarded – undo
158 171
 	$maxw = $c['w0']-$this->paddingCell2;
159 172
 	$curh = $c['maxh'];
160 173
 	$x=$y=0; //Top by default
161
-	if ($c['va']=='M') $y = ($maxh-$curh)/2; //Middle
162
-	elseif ($c['va']=='B') $y = $maxh-$curh; //Bottom
174
+	if ($c['va']=='M') {
175
+		$y = ($maxh-$curh)/2;
176
+	}
177
+	//Middle
178
+	elseif ($c['va']=='B') {
179
+		$y = $maxh-$curh;
180
+	}
181
+	//Bottom
163 182
 	$curline = 0;
164 183
 	$morespace = 0;
165 184
 	$cl = $c['hline'][$curline];
@@ -169,15 +188,21 @@  discard block
 block discarded – undo
169 188
 		if (isset($f['color'])){
170 189
 			$color = Color::HEX2RGB($f['color']);
171 190
 			$this->SetTextColor($color[0],$color[1],$color[2]);
172
-		}else unset($color);
191
+		} else {
192
+			unset($color);
193
+		}
173 194
 		$hl = $this->getLineHeight();
174
-		if (!isset($f['space'])) continue;
195
+		if (!isset($f['space'])) {
196
+			continue;
197
+		}
175 198
 		$space = $f['space'];
176 199
 		foreach ($f['line'] as $i=>&$l){
177
-			if (isset($l['str'])&&is_array($l['str']))
178
-			foreach ($l['str'] as &$t){
200
+			if (isset($l['str'])&&is_array($l['str'])) {
201
+						foreach ($l['str'] as &$t){
179 202
 				if ($t[2]!=$curline){
180
-					$y += $cl;$curline++;$cl = $c['hline'][$curline];
203
+					$y += $cl;
204
+			}
205
+			$curline++;$cl = $c['hline'][$curline];
181 206
 					$this->_cellHorzAlignLine($c,$curline,$maxw,$x,$morespace);
182 207
 				}
183 208
 				$this->x = $x+$x0;
@@ -190,31 +215,38 @@  discard block
 block discarded – undo
190 215
 				$this->_cellHorzAlignLine($c,$curline,$maxw,$x,$morespace);
191 216
 			}
192 217
 		}
193
-		if (isset($color))
194
-			$this->SetTextColor(0);
218
+		if (isset($color)) {
219
+					$this->SetTextColor(0);
220
+		}
195 221
 	}
196 222
 }
197 223
 private function _cellHorzAlignLine(&$c,$line,$maxw,&$x,&$morespace){
198 224
 	$morespace = 0;
199 225
 	$x = $this->paddingCell;//Left by default
200
-	if (!isset($c['wlines'][$line])) return ;
226
+	if (!isset($c['wlines'][$line])) {
227
+		return ;
228
+	}
201 229
 	if ($c['a']=='C'){//Center
202 230
 		$x = ($maxw-$c['wlines'][$line])/2;
203
-	}elseif ($c['a']=='R'){
231
+	} elseif ($c['a']=='R'){
204 232
 		$x = $maxw-$c['wlines'][$line];
205
-	}elseif ($c['a']=='J' && $c['wlinet'][$line][1]>1
233
+	} elseif ($c['a']=='J' && $c['wlinet'][$line][1]>1
206 234
 		&& isset($c['autobr'][$line])){//Justify
207 235
 		$morespace = ($maxw-$c['wlines'][$line])/($c['wlinet'][$line][1]-1);
208 236
 	}
209
-	if ($x < $this->paddingCell) $x = $this->paddingCell;
210
-}
237
+	if ($x < $this->paddingCell) {
238
+		$x = $this->paddingCell;
239
+	}
240
+	}
211 241
 
212 242
 private function _calWidth($w){
213 243
 	$p = strpos($w,'%');
214 244
 	if ($p!==false){
215 245
 		return intval(substr($w,0,$p)*$this->width/100);
216
-	}else return intval($w);
217
-}
246
+	} else {
247
+		return intval($w);
248
+	}
249
+	}
218 250
 /**
219 251
  * @return array
220 252
  * @desc Parse a string in html and return array of attribute of table
@@ -229,8 +261,9 @@  discard block
 block discarded – undo
229 261
 	$tdopen = false;
230 262
 	foreach ($t->name as $i=>$element){
231 263
 		if ($fontopen && $t->type[$i]==NODE_TYPE_ENDELEMENT
232
-			&& (in_array($element,array('table','tr','td','font'))))
233
-				$fontopen = false;
264
+			&& (in_array($element,array('table','tr','td','font')))) {
265
+						$fontopen = false;
266
+		}
234 267
 		if ($tdopen && $t->type[$i]==NODE_TYPE_ENDELEMENT
235 268
 			&& (in_array($element,array('table','tr','td')))
236 269
 			&& !isset($cell[$row][$col]['miw'])){
@@ -238,16 +271,26 @@  discard block
 block discarded – undo
238 271
 				$c['miw'] = $c['maw'] = 0;
239 272
 				$tdopen = false;
240 273
 		}
241
-		if ($t->type[$i] != NODE_TYPE_ELEMENT && $t->type[$i] != NODE_TYPE_TEXT) continue;
274
+		if ($t->type[$i] != NODE_TYPE_ELEMENT && $t->type[$i] != NODE_TYPE_TEXT) {
275
+			continue;
276
+		}
242 277
 		switch ($element){
243 278
 			case 'table':
244 279
 				$tdopen = 0;
245 280
 				$a	= &$t->attribute[$i];
246
-				if (isset($a['width']))		$table['w']	= $this->_calWidth($a['width']);
247
-				if (isset($a['height']))	$table['h']	= intval($a['height']);
248
-				if (isset($a['align']))		$table['a']	= $this->getAlign(strtolower($a['align']));
281
+				if (isset($a['width'])) {
282
+					$table['w']	= $this->_calWidth($a['width']);
283
+				}
284
+				if (isset($a['height'])) {
285
+					$table['h']	= intval($a['height']);
286
+				}
287
+				if (isset($a['align'])) {
288
+					$table['a']	= $this->getAlign(strtolower($a['align']));
289
+				}
249 290
 				$table['border'] = (isset($a['border']))?	$a['border']: 0;
250
-				if (isset($a['bgcolor']))	$table['bgcolor'][-1]	= $a['bgcolor'];
291
+				if (isset($a['bgcolor'])) {
292
+					$table['bgcolor'][-1]	= $a['bgcolor'];
293
+				}
251 294
 				$table['nobreak'] = isset($a['nobreak']);
252 295
 				break;
253 296
 			case 'tr':
@@ -256,52 +299,94 @@  discard block
 block discarded – undo
256 299
 				$table['nr']++;
257 300
 				$col = -1;
258 301
 				$a	= &$t->attribute[$i];
259
-				if (isset($a['bgcolor']))	$table['bgcolor'][$row]	= $a['bgcolor'];
260
-				if (isset($a['repeat']))	$table['repeat'][]		= $row;
261
-				else{
262
-					if (isset($a['pbr']))	$table['pbr'][$row]	= 1;
263
-					if (isset($a['knext']))	$table['knext'][$row]	= 1;
302
+				if (isset($a['bgcolor'])) {
303
+					$table['bgcolor'][$row]	= $a['bgcolor'];
304
+				}
305
+				if (isset($a['repeat'])) {
306
+					$table['repeat'][]		= $row;
307
+				} else{
308
+					if (isset($a['pbr'])) {
309
+						$table['pbr'][$row]	= 1;
310
+					}
311
+					if (isset($a['knext'])) {
312
+						$table['knext'][$row]	= 1;
313
+					}
264 314
 				}
265 315
 				break;
266 316
 			case 'td':
267 317
 				$tdopen = 1;
268
-				$col++;while (isset($cell[$row][$col])) $col++;
318
+				$col++;while (isset($cell[$row][$col])) {
319
+					$col++;
320
+				}
269 321
 				//Update number column
270
-				if ($table['nc'] < $col+1)		$table['nc']		= $col+1;
322
+				if ($table['nc'] < $col+1) {
323
+					$table['nc']		= $col+1;
324
+				}
271 325
 				$cell[$row][$col] = array();
272 326
 				$c = &$cell[$row][$col];
273 327
 				$a	= &$t->attribute[$i];
274
-				if (isset($a['width']))		$c['w']		= intval($a['width']);
275
-				if (isset($a['height']))	$c['h']		= intval($a['height']);
328
+				if (isset($a['width'])) {
329
+					$c['w']		= intval($a['width']);
330
+				}
331
+				if (isset($a['height'])) {
332
+					$c['h']		= intval($a['height']);
333
+				}
276 334
 				$c['a'] = isset($a['align'])?$this->getAlign($a['align']):'L';
277 335
 				$c['va']= isset($a['valign'])?$this->getVAlign($a['valign']):'T';
278
-				if (isset($a['border']))	$c['border']	= $a['border'];
279
-					else					$c['border']	= $table['border'];
280
-				if (isset($a['bgcolor']))	$c['bgcolor']	= $a['bgcolor'];
336
+				if (isset($a['border'])) {
337
+					$c['border']	= $a['border'];
338
+				} else {
339
+						$c['border']	= $table['border'];
340
+					}
341
+				if (isset($a['bgcolor'])) {
342
+					$c['bgcolor']	= $a['bgcolor'];
343
+				}
281 344
 				$cs = $rs = 1;
282
-				if (isset($a['colspan']) && $a['colspan']>1)	$cs = $c['colspan']	= intval($a['colspan']);
283
-				if (isset($a['rowspan']) && $a['rowspan']>1)	$rs = $c['rowspan']	= intval($a['rowspan']);
284
-				if (isset($a['size']))		$c['font'][0]['size']   	= $a['size'];
285
-				if (isset($a['family']))	$c['font'][0]['family'] 	= $a['family'];
345
+				if (isset($a['colspan']) && $a['colspan']>1) {
346
+					$cs = $c['colspan']	= intval($a['colspan']);
347
+				}
348
+				if (isset($a['rowspan']) && $a['rowspan']>1) {
349
+					$rs = $c['rowspan']	= intval($a['rowspan']);
350
+				}
351
+				if (isset($a['size'])) {
352
+					$c['font'][0]['size']   	= $a['size'];
353
+				}
354
+				if (isset($a['family'])) {
355
+					$c['font'][0]['family'] 	= $a['family'];
356
+				}
286 357
 				if (isset($a['style'])){
287 358
 					$STYLE     = explode(",", strtoupper($a['style']));
288 359
 					$fontStyle = '';
289
-					foreach($STYLE AS $style)  $fontStyle .= substr(trim($style), 0, 1);
360
+					foreach($STYLE AS $style) {
361
+						$fontStyle .= substr(trim($style), 0, 1);
362
+					}
290 363
 					$c['font'][0]['style'] = $fontStyle;
291 364
 				}
292
-				if (isset($a['color']))		$c['font'][0]['color'] 		= $a['color'];
365
+				if (isset($a['color'])) {
366
+					$c['font'][0]['color'] 		= $a['color'];
367
+				}
293 368
 				//Chiem dung vi tri de danh cho cell span
294
-				for ($k=$row;$k<$row+$rs;$k++) for($l=$col;$l<$col+$cs;$l++){
295
-					if ($k-$row || $l-$col)
296
-						$cell[$k][$l] = 0;
369
+				for ($k=$row;$k<$row+$rs;$k++) {
370
+					for($l=$col;
371
+				}
372
+				$l<$col+$cs;$l++){
373
+					if ($k-$row || $l-$col) {
374
+											$cell[$k][$l] = 0;
375
+					}
376
+				}
377
+				if (isset($a['nowrap'])) {
378
+					$c['nowrap']= 1;
297 379
 				}
298
-				if (isset($a['nowrap']))	$c['nowrap']= 1;
299 380
 				$fontopen = true;
300
-				if (!isset($c['font'])) $c['font'][] = array();
381
+				if (!isset($c['font'])) {
382
+					$c['font'][] = array();
383
+				}
301 384
 				break;
302 385
 			case 'Text':
303 386
 				$c = &$cell[$row][$col];
304
-				if (!$fontopen || !isset($c['font'])) $c['font'][] = array();
387
+				if (!$fontopen || !isset($c['font'])) {
388
+					$c['font'][] = array();
389
+				}
305 390
 				$f = &$c['font'][count($c['font'])-1];
306 391
 				$this->_setTextAndSize($c,$f,$this->_html2text($t->value[$i]));
307 392
 				break;
@@ -310,15 +395,23 @@  discard block
 block discarded – undo
310 395
 				$c = &$cell[$row][$col];
311 396
 				$c['font'][] = array();
312 397
 				$f = &$c['font'][count($c['font'])-1];
313
-				if (isset($a['size']))		$f['size']   	= $a['size'];
314
-				if (isset($a['family']))	$f['family'] 	= $a['family'];
398
+				if (isset($a['size'])) {
399
+					$f['size']   	= $a['size'];
400
+				}
401
+				if (isset($a['family'])) {
402
+					$f['family'] 	= $a['family'];
403
+				}
315 404
 				if (isset($a['style'])){
316 405
 					$STYLE     = explode(",", strtoupper($a['style']));
317 406
 					$fontStyle = '';
318
-					foreach($STYLE AS $style)  $fontStyle .= substr(trim($style), 0, 1);
407
+					foreach($STYLE AS $style) {
408
+						$fontStyle .= substr(trim($style), 0, 1);
409
+					}
319 410
 					$f['style'] = $fontStyle;
320 411
 				}
321
-				if (isset($a['color']))		$f['color'] 		= $a['color'];
412
+				if (isset($a['color'])) {
413
+					$f['color'] 		= $a['color'];
414
+				}
322 415
 				break;
323 416
 			case 'img':
324 417
 				$a	= &$t->attribute[$i];
@@ -340,7 +433,9 @@  discard block
 block discarded – undo
340 433
 }
341 434
 
342 435
 private function _setTextAndSize(&$cell,&$f, $text){
343
-	if ($text=='') return;
436
+	if ($text=='') {
437
+		return;
438
+	}
344 439
 	$this->_setFontText($f);
345 440
 	if (!isset($f['line'][0])){
346 441
 		$f['line'][0]['min'] = $f['line'][0]['max'] = 0;
@@ -351,49 +446,69 @@  discard block
 block discarded – undo
351 446
 		$f['line'][] = array('min'=>0,'max'=>0,'str'=>array());
352 447
 		$l = &$f['line'][count($f['line'])-1];
353 448
 	}
354
-	if (!isset($f['space'])) $f['space'] = $this->GetStringWidth(' ');
449
+	if (!isset($f['space'])) {
450
+		$f['space'] = $this->GetStringWidth(' ');
451
+	}
355 452
 	$ct = count($text);
356 453
 	foreach ($text as $item){
357 454
 		$s = $this->GetStringWidth($item);
358
-		if ($l['min']<$s) $l['min']=$s;
455
+		if ($l['min']<$s) {
456
+			$l['min']=$s;
457
+		}
359 458
 		$l['max'] += $s;
360
-		if ($ct>1) $l['max'] += $f['space'];
459
+		if ($ct>1) {
460
+			$l['max'] += $f['space'];
461
+		}
361 462
 		$l['str'][] =  array($item,$s);
362 463
 	}
363
-	if (isset($cell['nowrap'])) $l['min'] = $l['max'];
364
-	if (!isset($cell['miw']) || $cell['miw']-$this->paddingCell2<$l['min'])
365
-		$cell['miw']=$l['min']+$this->paddingCell2;
366
-	if (!isset($cell['maw']) || $cell['maw']-$this->paddingCell2<$l['max'])
367
-		$cell['maw']=$l['max']+$this->paddingCell2;
368
-}
464
+	if (isset($cell['nowrap'])) {
465
+		$l['min'] = $l['max'];
466
+	}
467
+	if (!isset($cell['miw']) || $cell['miw']-$this->paddingCell2<$l['min']) {
468
+			$cell['miw']=$l['min']+$this->paddingCell2;
469
+	}
470
+	if (!isset($cell['maw']) || $cell['maw']-$this->paddingCell2<$l['max']) {
471
+			$cell['maw']=$l['max']+$this->paddingCell2;
472
+	}
473
+	}
369 474
 
370 475
 private function _setImage(&$c, &$a){
371 476
 	$path = $a['src'];
372 477
 	if (!is_file($path)){
373 478
 		$this->Error('Image is not exists: '.$path);
374
-	}else{
479
+	} else{
375 480
 		list($u,$d) = $this->_getResolution($path);
376 481
 		$c['img'] = $path;
377 482
 		list($c['w'],$c['h'],) = getimagesize($path);
378
-		if (isset($a['width'])) $c['w'] = $a['width'];
379
-		if (isset($a['height'])) $c['h'] = $a['height'];
483
+		if (isset($a['width'])) {
484
+			$c['w'] = $a['width'];
485
+		}
486
+		if (isset($a['height'])) {
487
+			$c['h'] = $a['height'];
488
+		}
380 489
 		$scale = 1;
381
-		if ($u==1) $scale = 25.4/$d;
382
-		elseif ($u==2) $scale = 10/$d;
490
+		if ($u==1) {
491
+			$scale = 25.4/$d;
492
+		} elseif ($u==2) {
493
+			$scale = 10/$d;
494
+		}
383 495
 		$c['w'] = intval($c['w']*$scale);
384 496
 		$c['h'] = intval($c['h']*$scale);
385 497
 	}
386 498
 }
387 499
 private function _getResolution($path){
388 500
 	$pos=strrpos($path,'.');
389
-	if(!$pos)
390
-		$this->Error('Image file has no extension and no type was specified: '.$path);
501
+	if(!$pos) {
502
+			$this->Error('Image file has no extension and no type was specified: '.$path);
503
+	}
391 504
 	$type=substr($path,$pos+1);
392 505
 	$type=strtolower($type);
393
-	if($type=='jpeg')
394
-		$type='jpg';
395
-	if ($type!='jpg')
396
-		$this->Error('Unsupported image type: '.$path);
506
+	if($type=='jpeg') {
507
+			$type='jpg';
508
+	}
509
+	if ($type!='jpg') {
510
+			$this->Error('Unsupported image type: '.$path);
511
+	}
397 512
 	$f = fopen($path,'r');
398 513
 	fseek($f,13,SEEK_SET);
399 514
 	$info = fread($f,3);
@@ -429,19 +544,35 @@  discard block
 block discarded – undo
429 544
 		for ($i=0;$i<$nr;$i++){
430 545
 			if (isset($cs[$i][$j]['miw'])){
431 546
 				$c   = &$cs[$i][$j];
432
-				if (isset($c['nowrap'])) $c['miw'] = $c['maw'];
547
+				if (isset($c['nowrap'])) {
548
+					$c['miw'] = $c['maw'];
549
+				}
433 550
 				if (isset($c['w'])){
434
-					if ($c['miw']<$c['w']) $c['miw'] = $c['w'];
435
-					elseif ($c['miw']>$c['w']) $c['w'] = $c['miw']+$this->paddingCell2;
436
-					if (!isset($wc['w'])) $wc['w'] = 1;
551
+					if ($c['miw']<$c['w']) {
552
+						$c['miw'] = $c['w'];
553
+					} elseif ($c['miw']>$c['w']) {
554
+						$c['w'] = $c['miw']+$this->paddingCell2;
555
+					}
556
+					if (!isset($wc['w'])) {
557
+						$wc['w'] = 1;
558
+					}
559
+				}
560
+				if ($c['maw']<$c['miw']) {
561
+					$c['maw'] = $c['miw'];
437 562
 				}
438
-				if ($c['maw']<$c['miw']) $c['maw'] = $c['miw'];
439 563
 				if (!isset($c['colspan'])){
440
-					if ($wc['miw'] < $c['miw']) $wc['miw']=$c['miw'];
441
-					if ($wc['maw'] < $c['maw']) $wc['maw']=$c['maw'];
442
-					if (isset($wc['w']) && $wc['w'] < $wc['miw'])
443
-						$wc['w']=$wc['miw'];
444
-				}else $listspan[] = array($i,$j);
564
+					if ($wc['miw'] < $c['miw']) {
565
+						$wc['miw']=$c['miw'];
566
+					}
567
+					if ($wc['maw'] < $c['maw']) {
568
+						$wc['maw']=$c['maw'];
569
+					}
570
+					if (isset($wc['w']) && $wc['w'] < $wc['miw']) {
571
+											$wc['w']=$wc['miw'];
572
+					}
573
+				} else {
574
+					$listspan[] = array($i,$j);
575
+				}
445 576
 			}
446 577
 		}
447 578
 	}
@@ -451,7 +582,9 @@  discard block
 block discarded – undo
451 582
 		list($i,$j) = $span;
452 583
 		$c = &$cs[$i][$j];
453 584
 		$lc = $j + $c['colspan'];
454
-		if ($lc > $nc) $lc = $nc;
585
+		if ($lc > $nc) {
586
+			$lc = $nc;
587
+		}
455 588
 
456 589
 		$wis = $wisa = 0;
457 590
 		$was = $wasa = 0;
@@ -467,28 +600,36 @@  discard block
 block discarded – undo
467 600
 		}
468 601
 		if ($c['miw'] > $wis){
469 602
 			if (!$wis){//Cac cot chua co kich thuoc => chia deu
470
-				for($k=$j;$k<$lc;$k++) $wc[$k]['miw'] = $c['miw']/$c['colspan'];
471
-			}elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca
603
+				for($k=$j;$k<$lc;$k++) {
604
+					$wc[$k]['miw'] = $c['miw']/$c['colspan'];
605
+				}
606
+			} elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca
472 607
 				$wi = $c['miw'] - $wis;
473
-				for($k=$j;$k<$lc;$k++)
474
-					$wc[$k]['miw'] += ($wc[$k]['miw']/$wis)*$wi;
475
-			}else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto
608
+				for($k=$j;$k<$lc;$k++) {
609
+									$wc[$k]['miw'] += ($wc[$k]['miw']/$wis)*$wi;
610
+				}
611
+			} else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto
476 612
 				$wi = $c['miw'] - $wis;
477
-				foreach ($list as $_z2=>$k)
478
-					$wc[$k]['miw'] += ($wc[$k]['miw']/$wisa)*$wi;
613
+				foreach ($list as $_z2=>$k) {
614
+									$wc[$k]['miw'] += ($wc[$k]['miw']/$wisa)*$wi;
615
+				}
479 616
 			}
480 617
 		}
481 618
 		if ($c['maw'] > $was){
482 619
 			if (!$wis){//Cac cot chua co kich thuoc => chia deu
483
-				for($k=$j;$k<$lc;$k++) $wc[$k]['maw'] = $c['maw']/$c['colspan'];
484
-			}elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca
620
+				for($k=$j;$k<$lc;$k++) {
621
+					$wc[$k]['maw'] = $c['maw']/$c['colspan'];
622
+				}
623
+			} elseif (!count($list)){//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca
485 624
 				$wi = $c['maw'] - $was;
486
-				for($k=$j;$k<$lc;$k++)
487
-					$wc[$k]['maw'] += ($wc[$k]['maw']/$was)*$wi;
488
-			}else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto
625
+				for($k=$j;$k<$lc;$k++) {
626
+									$wc[$k]['maw'] += ($wc[$k]['maw']/$was)*$wi;
627
+				}
628
+			} else{//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto
489 629
 				$wi = $c['maw'] - $was;
490
-				foreach ($list as $_z2=>$k)
491
-					$wc[$k]['maw'] += ($wc[$k]['maw']/$wasa)*$wi;
630
+				foreach ($list as $_z2=>$k) {
631
+									$wc[$k]['maw'] += ($wc[$k]['maw']/$wasa)*$wi;
632
+				}
492 633
 			}
493 634
 		}
494 635
 	}
@@ -504,7 +645,9 @@  discard block
 block discarded – undo
504 645
 	for ($i=0;$i<$nc;$i++){
505 646
 		$a += isset($wc[$i]['w']) ? $wc[$i]['miw'] : $wc[$i]['maw'];
506 647
 	}
507
-	if ($a > $this->width) $table['w'] = $this->width;
648
+	if ($a > $this->width) {
649
+		$table['w'] = $this->width;
650
+	}
508 651
 
509 652
 	if (isset($table['w'])){
510 653
 		$wis = $wisa = 0;
@@ -517,13 +660,15 @@  discard block
 block discarded – undo
517 660
 			if (!count($list)){
518 661
 				//Khong co cot nao co kich thuoc auto => chia deu phan du cho tat ca
519 662
 				$wi = ($table['w'] - $wis)/$nc;
520
-				for($k=0;$k<$nc;$k++)
521
-					$wc[$k]['miw'] += $wi;
522
-			}else{
663
+				for($k=0;$k<$nc;$k++) {
664
+									$wc[$k]['miw'] += $wi;
665
+				}
666
+			} else{
523 667
 				//Co mot so cot co kich thuoc auto => chia deu phan du cho cac cot auto
524 668
 				$wi = ($table['w'] - $wis)/count($list);
525
-				foreach ($list as $k)
526
-					$wc[$k]['miw'] += $wi;
669
+				foreach ($list as $k) {
670
+									$wc[$k]['miw'] += $wi;
671
+				}
527 672
 			}
528 673
 		}
529 674
 		for ($i=0;$i<$nc;$i++){
@@ -531,7 +676,7 @@  discard block
 block discarded – undo
531 676
 			unset($wc[$i]);
532 677
 			$wc[$i] = $a;
533 678
 		}
534
-	}else{
679
+	} else{
535 680
 		$table['w'] = $a;
536 681
 		for ($i=0;$i<$nc;$i++){
537 682
 			$a = isset($wc[$i]['w']) ? $wc[$i]['miw'] : $wc[$i]['maw'];
@@ -557,10 +702,15 @@  discard block
 block discarded – undo
557 702
 				$ch = $this->_cellHeight($c);
558 703
 				$c['ch'] = $ch;
559 704
 
560
-				if (isset($c['h']) && $c['h'] > $ch) $ch = $c['h'];
705
+				if (isset($c['h']) && $c['h'] > $ch) {
706
+					$ch = $c['h'];
707
+				}
561 708
 
562
-				if (isset($c['rowspan'])) $listspan[] = array($i,$j);
563
-				elseif ($hr < $ch) $hr = $ch;
709
+				if (isset($c['rowspan'])) {
710
+					$listspan[] = array($i,$j);
711
+				} elseif ($hr < $ch) {
712
+					$hr = $ch;
713
+				}
564 714
 				$c['mih'] = $ch;
565 715
 			}
566 716
 		}
@@ -570,7 +720,9 @@  discard block
 block discarded – undo
570 720
 		list($i,$j) = $span;
571 721
 		$c = &$cs[$i][$j];
572 722
 		$lr = $i + $c['rowspan'];
573
-		if ($lr > $nr) $lr = $nr;
723
+		if ($lr > $nr) {
724
+			$lr = $nr;
725
+		}
574 726
 		$hs = $hsa = 0;
575 727
 		$list = array();
576 728
 		for($k=$i;$k<$lr;$k++){
@@ -582,26 +734,36 @@  discard block
 block discarded – undo
582 734
 		}
583 735
 		if ($c['mih'] > $hs){
584 736
 			if (!$hs){//Cac dong chua co kich thuoc => chia deu
585
-				for($k=$i;$k<$lr;$k++) $hr[$k] = $c['mih']/$c['rowspan'];
586
-			}elseif (!count($list)){
737
+				for($k=$i;$k<$lr;$k++) {
738
+					$hr[$k] = $c['mih']/$c['rowspan'];
739
+				}
740
+			} elseif (!count($list)){
587 741
 				//Khong co dong nao co kich thuoc auto => chia deu phan du cho tat ca
588 742
 				$hi = $c['mih'] - $hs;
589
-				for($k=$i;$k<$lr;$k++)
590
-					$hr[$k] += ($hr[$k]/$hs)*$hi;
591
-			}else{
743
+				for($k=$i;$k<$lr;$k++) {
744
+									$hr[$k] += ($hr[$k]/$hs)*$hi;
745
+				}
746
+			} else{
592 747
 				//Co mot so dong co kich thuoc auto => chia deu phan du cho cac dong auto
593 748
 				$hi = $c['mih'] - $hsa;
594
-				foreach ($list as $k)
595
-					$hr[$k] += ($hr[$k]/$hsa)*$hi;
749
+				foreach ($list as $k) {
750
+									$hr[$k] += ($hr[$k]/$hsa)*$hi;
751
+				}
596 752
 			}
597 753
 		}
598 754
 	}
599 755
 	$table['repeatH'] = 0;
600 756
 	if (count($table['repeat'])){
601
-		foreach ($table['repeat'] as $i) $table['repeatH'] += $hr[$i];
602
-	}else $table['repeat'] = 0;
757
+		foreach ($table['repeat'] as $i) {
758
+			$table['repeatH'] += $hr[$i];
759
+		}
760
+	} else {
761
+		$table['repeat'] = 0;
762
+	}
603 763
 	$tth = 0;
604
-	foreach ($hr as $v) $tth+=$v;
764
+	foreach ($hr as $v) {
765
+		$tth+=$v;
766
+	}
605 767
 	$table['tth'] = $tth;
606 768
 }
607 769
 
@@ -611,14 +773,19 @@  discard block
 block discarded – undo
611 773
 private function _tableGetWCell(&$table, $i,$j){
612 774
 	$c = &$table['cells'][$i][$j];
613 775
 	if ($c){
614
-		if (isset($c['x0'])) return array($c['x0'], $c['w0']);
776
+		if (isset($c['x0'])) {
777
+			return array($c['x0'], $c['w0']);
778
+		}
615 779
 		$x = 0;
616 780
 		$wc = &$table['wc'];
617
-		for ($k=0;$k<$j;$k++) $x += $wc[$k];
781
+		for ($k=0;$k<$j;$k++) {
782
+			$x += $wc[$k];
783
+		}
618 784
 		$w = $wc[$j];
619 785
 		if (isset($c['colspan'])){
620
-			for ($k=$j+$c['colspan']-1;$k>$j;$k--)
621
-				$w += @$wc[$k];
786
+			for ($k=$j+$c['colspan']-1;$k>$j;$k--) {
787
+							$w += @$wc[$k];
788
+			}
622 789
 		}
623 790
 		$c['x0'] = $x;
624 791
 		$c['w0'] = $w;
@@ -630,12 +797,15 @@  discard block
 block discarded – undo
630 797
 private function _tableGetHCell(&$table, $i,$j){
631 798
 	$c = &$table['cells'][$i][$j];
632 799
 	if ($c){
633
-		if (isset($c['h0'])) return $c['h0'];
800
+		if (isset($c['h0'])) {
801
+			return $c['h0'];
802
+		}
634 803
 		$hr = &$table['hr'];
635 804
 		$h = $hr[$i];
636 805
 		if (isset($c['rowspan'])){
637
-			for ($k=$i+$c['rowspan']-1;$k>$i;$k--)
638
-				$h += $hr[$k];
806
+			for ($k=$i+$c['rowspan']-1;$k>$i;$k--) {
807
+							$h += $hr[$k];
808
+			}
639 809
 		}
640 810
 		$c['h0'] = $h;
641 811
 		return $h;
@@ -647,14 +817,21 @@  discard block
 block discarded – undo
647 817
 	if (strlen($type)==4)
648 818
 	{
649 819
 		$x2 = $x + $w; $y2 = $y + $h;
650
-		if (intval($type{0})) $this->Line($x , $y , $x2, $y );
651
-		if (intval($type{1})) $this->Line($x2, $y , $x2, $y2);
652
-		if (intval($type{2})) $this->Line($x , $y2, $x2, $y2);
653
-		if (intval($type{3})) $this->Line($x , $y , $x , $y2);
654
-	}
655
-	elseif ((int)$type===1)
656
-		$this->Rect($x, $y, $w, $h);
657
-	elseif ((int)$type>1 && (int)$type<11)
820
+		if (intval($type{0})) {
821
+			$this->Line($x , $y , $x2, $y );
822
+		}
823
+		if (intval($type{1})) {
824
+			$this->Line($x2, $y , $x2, $y2);
825
+		}
826
+		if (intval($type{2})) {
827
+			$this->Line($x , $y2, $x2, $y2);
828
+		}
829
+		if (intval($type{3})) {
830
+			$this->Line($x , $y , $x , $y2);
831
+		}
832
+	} elseif ((int)$type===1) {
833
+			$this->Rect($x, $y, $w, $h);
834
+	} elseif ((int)$type>1 && (int)$type<11)
658 835
 	{
659 836
 		$width = $this->LineWidth;
660 837
 		$this->SetLineWidth($type * $this->LineWidth);
@@ -676,7 +853,9 @@  discard block
 block discarded – undo
676 853
 	$maxh = 0;
677 854
 	for ($j=0;$j<$table['nc'];$j++){
678 855
 		$h = $this->_tableGetHCell($table, $i, $j);
679
-		if ($maxh < $h) $maxh = $h;
856
+		if ($maxh < $h) {
857
+			$maxh = $h;
858
+		}
680 859
 	}
681 860
 	return $maxh;
682 861
 }
@@ -697,19 +876,25 @@  discard block
 block discarded – undo
697 876
 	if ($table['multipage']){
698 877
 		$newpage = 0;
699 878
 		if ($table['lasty']+$maxh>$this->bottom){
700
-			if ($this->_checkLimitHeight($table, $maxh)) return;
879
+			if ($this->_checkLimitHeight($table, $maxh)) {
880
+				return;
881
+			}
701 882
 			$newpage = 1;
702
-		}elseif (isset($table['pbr'][$i])){
883
+		} elseif (isset($table['pbr'][$i])){
703 884
 			$newpage = 1;
704 885
 			unset($table['pbr'][$i]);
705
-		}elseif (isset($table['knext'][$i])&&$i<$table['nr']-1){
886
+		} elseif (isset($table['knext'][$i])&&$i<$table['nr']-1){
706 887
 			$mrowh = $maxh;
707 888
 			for($j=$i+1;$j<$table['nr'];$j++){
708 889
 				$mrowh += $this->_getRowHeight($table, $j);
709
-				if (!isset($table['knext'][$j])) break;
890
+				if (!isset($table['knext'][$j])) {
891
+					break;
892
+				}
710 893
 				unset($table['knext'][$j]);
711 894
 			}
712
-			if ($this->_checkLimitHeight($table, $mrowh)) return;
895
+			if ($this->_checkLimitHeight($table, $mrowh)) {
896
+				return;
897
+			}
713 898
 			$newpage = $table['lasty']+$mrowh>$this->bottom;
714 899
 		}
715 900
 		if ($newpage){
@@ -719,7 +904,9 @@  discard block
 block discarded – undo
719 904
 			$table['lasty'] = $this->y;
720 905
 			if ($table['repeat']){
721 906
 				foreach ($table['repeat'] as $r){
722
-					if ($r==$i) continue;
907
+					if ($r==$i) {
908
+						continue;
909
+					}
723 910
 					$this->_tableWriteRow($table,$r,$x0);
724 911
 				}
725 912
 			}
@@ -745,14 +932,15 @@  discard block
 block discarded – undo
745 932
 			//Content
746 933
 			if (isset($c['img'])){
747 934
 				$this->Image($c['img'],$x,$y,$c['w'],$c['h']);
748
-			}else{
935
+			} else{
749 936
 				$this->_drawCellAligned($x,$y,$c);
750 937
 			}
751 938
 			//Border
752 939
 			if (isset($c['border'])){
753 940
 				$table['listborder'][] = array($x,$y,$w,$h,$c['border']);
754
-			}elseif (isset($table['border']) && $table['border'])
755
-				$table['listborder'][] = array($x,$y,$w,$h,$table['border']);
941
+			} elseif (isset($table['border']) && $table['border']) {
942
+							$table['listborder'][] = array($x,$y,$w,$h,$table['border']);
943
+			}
756 944
 		}
757 945
 	}
758 946
 	$table['lasty'] += $table['hr'][$i];
@@ -770,13 +958,19 @@  discard block
 block discarded – undo
770 958
 private function _setFontText(&$f){
771 959
 	if (isset($f['size']) && ($f['size'] >0)){
772 960
 		$fontSize   = $f['size'];
773
-	}else $fontSize   = $this->defaultFontSize;
961
+	} else {
962
+		$fontSize   = $this->defaultFontSize;
963
+	}
774 964
 	if (isset($f['family'])){
775 965
 		$fontFamily = $f['family'];
776
-	}else $fontFamily = $this->defaultFontFamily;
777
-	if (isset($f['style']))
778
-		$fontStyle  = $f['style'];
779
-	else $fontStyle = $this->defaultFontStyle;
966
+	} else {
967
+		$fontFamily = $this->defaultFontFamily;
968
+	}
969
+	if (isset($f['style'])) {
970
+			$fontStyle  = $f['style'];
971
+	} else {
972
+		$fontStyle = $this->defaultFontStyle;
973
+	}
780 974
 	$this->SetFont($fontFamily, $fontStyle, $fontSize);
781 975
 	return $fontSize;
782 976
 }
@@ -784,14 +978,18 @@  discard block
 block discarded – undo
784 978
 	if ($this->CurOrientation == 'P' && $table['w']>$this->width+5){
785 979
 		$this->AddPage('L');
786 980
 	}
787
-	if ($this->x==null)$this->x = $this->lMargin;
788
-	if ($this->y==null)$this->y = $this->tMargin;
981
+	if ($this->x==null) {
982
+		$this->x = $this->lMargin;
983
+	}
984
+	if ($this->y==null) {
985
+		$this->y = $this->tMargin;
986
+	}
789 987
 	$x0 = $this->x;
790 988
 	$y0 = $this->y;
791 989
 	if (isset($table['a'])){
792 990
 		if ($table['a']=='C'){
793 991
 			$x0 += (($this->right-$x0) - $table['w'])/2;
794
-		}elseif ($table['a']=='R'){
992
+		} elseif ($table['a']=='R'){
795 993
 			$x0 = $this->right - $table['w'];
796 994
 		}
797 995
 	}
@@ -799,11 +997,14 @@  discard block
 block discarded – undo
799 997
 		&& $table['tth']+$y0>$this->bottom && $table['multipage']){
800 998
 		$this->AddPage($this->CurOrientation);
801 999
 		$table['lasty'] = $this->y;
802
-	}else
803
-		$table['lasty'] = $y0;
1000
+	} else {
1001
+			$table['lasty'] = $y0;
1002
+	}
804 1003
 	
805 1004
 	$table['listborder'] = array();
806
-	for ($i=0;$i<$table['nr'];$i++) $this->_tableWriteRow($table, $i, $x0);
1005
+	for ($i=0;$i<$table['nr'];$i++) {
1006
+		$this->_tableWriteRow($table, $i, $x0);
1007
+	}
807 1008
 	$this->_tableDrawBorder($table);
808 1009
 	$this->x = $x0;
809 1010
 }
@@ -817,7 +1018,9 @@  discard block
 block discarded – undo
817 1018
 	$x = $this->x;
818 1019
 	foreach ($HTML as $i=>$table){	
819 1020
 		$this->x = $x;
820
-		if (strlen($table)<6) continue;
1021
+		if (strlen($table)<6) {
1022
+			continue;
1023
+		}
821 1024
 		$table = '<table' . $table;
822 1025
 		$table = $this->_tableParser($table);
823 1026
 		$table['multipage'] = $multipage;
@@ -832,16 +1035,21 @@  discard block
 block discarded – undo
832 1035
 function _putinfo(){
833 1036
 	$this->_out('/Producer '.$this->_textstring('PDFTable '.
834 1037
 		PDFTABLE_VERSION.' based on FPDF '.FPDF_VERSION));
835
-	if(!empty($this->title))
836
-		$this->_out('/Title '.$this->_textstring($this->title));
837
-	if(!empty($this->subject))
838
-		$this->_out('/Subject '.$this->_textstring($this->subject));
839
-	if(!empty($this->author))
840
-		$this->_out('/Author '.$this->_textstring($this->author));
841
-	if(!empty($this->keywords))
842
-		$this->_out('/Keywords '.$this->_textstring($this->keywords));
843
-	if(!empty($this->creator))
844
-		$this->_out('/Creator '.$this->_textstring($this->creator));
1038
+	if(!empty($this->title)) {
1039
+			$this->_out('/Title '.$this->_textstring($this->title));
1040
+	}
1041
+	if(!empty($this->subject)) {
1042
+			$this->_out('/Subject '.$this->_textstring($this->subject));
1043
+	}
1044
+	if(!empty($this->author)) {
1045
+			$this->_out('/Author '.$this->_textstring($this->author));
1046
+	}
1047
+	if(!empty($this->keywords)) {
1048
+			$this->_out('/Keywords '.$this->_textstring($this->keywords));
1049
+	}
1050
+	if(!empty($this->creator)) {
1051
+			$this->_out('/Creator '.$this->_textstring($this->creator));
1052
+	}
845 1053
 	$this->_out('/CreationDate '.$this->_textstring('D:'.@date('YmdHis')));
846 1054
 }
847 1055
 private function getAlign($v){
Please login to merge, or discard this patch.