Passed
Push — v3.0 ( 2dc815...9faf9f )
by Samir
12:41
created
astpp/application/modules/invoices/views/view_invoice_edit_manually.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -158,13 +158,13 @@
 block discarded – undo
158 158
 	        </tr>
159 159
 	<tr>
160 160
 		<td>
161
-		 		<b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span>
161
+		 		<b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span>
162 162
 		 </td>
163 163
 	</tr>
164 164
 	<tr>
165 165
 		<td>
166 166
  		<b>Due Date : </b><span style="color:#a09d9d;"><?php 
167
-				echo date('Y-m-d', strtotime($payment_due_date)) ;
167
+				echo date('Y-m-d', strtotime($payment_due_date));
168 168
 		?></span>
169 169
 		 </td>
170 170
 	</tr>
Please login to merge, or discard this patch.
astpp/application/modules/invoices/views/view_invoice_payment.php 1 patch
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -100,13 +100,13 @@  discard block
 block discarded – undo
100 100
 	        </tr>
101 101
 	<tr>
102 102
 		<td>
103
-		 		<b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)) ; ?></span>
103
+		 		<b>From Date : </b><span style="color:#a09d9d;"> <?php echo date('Y-m-d', strtotime($from_date)); ?></span>
104 104
 		 </td>
105 105
 	</tr>
106 106
 	<tr>
107 107
 		<td>
108 108
  		<b>Due Date : </b><span style="color:#a09d9d;"><?php 
109
-				echo date('Y-m-d', strtotime($payment_due_date)) ;
109
+				echo date('Y-m-d', strtotime($payment_due_date));
110 110
 		?></span>
111 111
 		 </td>
112 112
 	</tr>
@@ -140,24 +140,24 @@  discard block
 block discarded – undo
140 140
 	   </th>
141 141
 	 </tr> 
142 142
 	 <?php
143
-$paypal=0;
144
- foreach($invoice_final_query as $value){
143
+$paypal = 0;
144
+ foreach ($invoice_final_query as $value) {
145 145
  
146
-	if($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT')    {
147
-	   $debit=$value['debit'];
148
-	   $credit=$value['credit'];
149
-	   $paypal+=$credit;
150
-	   $created_date=$value['created_date'];
151
-	   $paypalid=$value['item_id'];
152
-	   $outstanding=$amount-$paypal;
153
-	   $amount_visible='0000';
146
+	if ($value['item_type'] != 'INVPAY' && $value['item_type'] != 'PAYMENT') {
147
+	   $debit = $value['debit'];
148
+	   $credit = $value['credit'];
149
+	   $paypal += $credit;
150
+	   $created_date = $value['created_date'];
151
+	   $paypalid = $value['item_id'];
152
+	   $outstanding = $amount - $paypal;
153
+	   $amount_visible = '0000';
154 154
       
155 155
       
156 156
      
157 157
 ?>	
158 158
  	 <tr style="height:20px;">
159 159
 			 <td><?php echo $value['description']; ?>  </td>
160
-			 <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php  echo $to_currency;  ?></div></td>
160
+			 <td><div class="pull-right"><?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?> <?php  echo $to_currency; ?></div></td>
161 161
 			 <input type="hidden" name="new_amount" value="<?php echo $this->common->currency_decimal($this->common_model->calculate_currency($debit)); ?>">
162 162
 			 
163 163
 			
@@ -196,18 +196,18 @@  discard block
 block discarded – undo
196 196
 			
197 197
 	 </tr> 
198 198
 	 <?php
199
-$paypal=0;
200
-if($invoice_date){
201
- foreach($invoice_total_query as $value){
199
+$paypal = 0;
200
+if ($invoice_date) {
201
+ foreach ($invoice_total_query as $value) {
202 202
  
203 203
      
204
-	   $debit=$value['debit'];
205
-	   $credit=$value['credit'];
206
-	   $paypal+=$credit;
207
-	   $created_date=$value['created_date'];
208
-	   $paypalid=$value['item_id'];
209
-	   $outstanding=$amount-$paypal;
210
-	   $amount_visible='0000';
204
+	   $debit = $value['debit'];
205
+	   $credit = $value['credit'];
206
+	   $paypal += $credit;
207
+	   $created_date = $value['created_date'];
208
+	   $paypalid = $value['item_id'];
209
+	   $outstanding = $amount - $paypal;
210
+	   $amount_visible = '0000';
211 211
       
212 212
       
213 213
      
Please login to merge, or discard this patch.
web_interface/astpp/cron/cron.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
 		unset($argv[1]);
23 23
 //        $argv = array_merge($argv, $config["argv"][$path]);
24 24
 		$argv[0] = $argv[0];
25
-		$argv[1] =$config["argv"][$path];
25
+		$argv[1] = $config["argv"][$path];
26 26
 		$_SERVER['argv'] = $argv;
27 27
 	} else
28 28
 		die('Use: php cron.php controller/method');
@@ -41,11 +41,11 @@  discard block
 block discarded – undo
41 41
 ob_start();
42 42
 
43 43
 // 	chdir( dirname( CRON_CI_INDEX ) );
44
-require( CRON_CI_INDEX );           // main CI index.php file
44
+require(CRON_CI_INDEX); // main CI index.php file
45 45
 $output = ob_get_contents();
46 46
 
47 47
 if (CRON_FLUSH_BUFFERS === TRUE)
48
-	while (@ob_end_flush());          // display buffer contents
48
+	while (@ob_end_flush()); // display buffer contents
49 49
 		else
50 50
 	ob_end_clean();
51 51
 
Please login to merge, or discard this patch.
web_interface/astpp/index.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -68,7 +68,7 @@
 block discarded – undo
68 68
  * as this file.
69 69
  *
70 70
  */
71
-	   $assets_path='assets';
71
+	   $assets_path = 'assets';
72 72
 /*
73 73
  *---------------------------------------------------------------
74 74
  * APPLICATION FOLDER NAME
Please login to merge, or discard this patch.
web_interface/astpp/system/core/URI.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -162,9 +162,9 @@
 block discarded – undo
162 162
 		$str = remove_invisible_characters($str, FALSE);
163 163
 //================ITPL=======================
164 164
   $pos = strpos($str, "_json");
165
- if($pos > 0 && !isset($_SERVER['HTTP_X_REQUESTED_WITH'])){
165
+ if ($pos > 0 && ! isset($_SERVER['HTTP_X_REQUESTED_WITH'])) {
166 166
 	   $this->uri_string = str_replace('_json', '', trim($str, '/'));
167
- }else{
167
+ } else {
168 168
 		// If the URI contains only a slash we'll kill it
169 169
 		$this->uri_string = ($str == '/') ? '' : $str;
170 170
 }
Please login to merge, or discard this patch.
web_interface/astpp/system/core/Common.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -254,7 +254,7 @@
 block discarded – undo
254 254
 				}
255 255
 			}
256 256
 		}
257
-		$_config[0] =& $config;
257
+		$_config[0] = & $config;
258 258
 				return $_config[0];
259 259
 
260 260
 	}
Please login to merge, or discard this patch.
web_interface/astpp/system/libraries/Form_validation.php 1 patch
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -640,13 +640,13 @@  discard block
 block discarded – undo
640 640
 					// Users can use any native PHP function call that has one param.
641 641
 					if (function_exists($rule))
642 642
 					{
643
-					  $str=null;
644
-					  if(is_array($postdata)){
645
-						foreach($postdata as $key=>$value){
646
-						  $str.=$value.",";
643
+					  $str = null;
644
+					  if (is_array($postdata)) {
645
+						foreach ($postdata as $key=>$value) {
646
+						  $str .= $value.",";
647 647
 						}
648
-						$str=rtrim($str,',');
649
-						$postdata=$str;  
648
+						$str = rtrim($str, ',');
649
+						$postdata = $str;  
650 650
 					  }
651 651
 						$result = $rule($postdata);
652 652
 
@@ -974,20 +974,20 @@  discard block
 block discarded – undo
974 974
 	 */
975 975
 	public function is_unique($str, $field)
976 976
 	{
977
-				$id='';
978
-		$data =explode('.', $field);
979
-				$table=$data[0];
980
-				$field=$data[1];
981
-				if(isset($data[2]))
982
-				$id=$data[2];
983
-				$where=array($field => $str);
984
-				if($id != ''){
985
-				 $where['id !=']=$id;
977
+				$id = '';
978
+		$data = explode('.', $field);
979
+				$table = $data[0];
980
+				$field = $data[1];
981
+				if (isset($data[2]))
982
+				$id = $data[2];
983
+				$where = array($field => $str);
984
+				if ($id != '') {
985
+				 $where['id !='] = $id;
986 986
 				}
987
-				if($table == 'accounts'){
988
-		  $where['deleted']=0;
987
+				if ($table == 'accounts') {
988
+		  $where['deleted'] = 0;
989 989
 				}
990
-				$query = $this->CI->db->limit(1)->get_where($table,$where );
990
+				$query = $this->CI->db->limit(1)->get_where($table, $where);
991 991
 		return $query->num_rows() > 0 ? FALSE : TRUE;
992 992
 		 }
993 993
 
@@ -1421,54 +1421,54 @@  discard block
 block discarded – undo
1421 1421
 	{
1422 1422
 			return ( ! preg_match("/^([.a-z0-9])+$/i", $str)) ? FALSE : TRUE;
1423 1423
 	}
1424
-	public function valid_decimal($str){
1425
-			return (bool) preg_match('#^\d+(?:\.\d{1,5})?$#', $str);
1424
+	public function valid_decimal($str) {
1425
+			return (bool)preg_match('#^\d+(?:\.\d{1,5})?$#', $str);
1426 1426
 		}
1427 1427
 		public function alpha_numeric_space($str)
1428 1428
 	{
1429 1429
 		return ( ! preg_match("/^[A-Za-z0-9\s]+$/", $str)) ? FALSE : TRUE;
1430 1430
 	}
1431
-		public function alpha_space($str){
1431
+		public function alpha_space($str) {
1432 1432
 		return ( ! preg_match("/^[A-Za-z\s]+$/", $str)) ? FALSE : TRUE;
1433 1433
 //                return ( ! preg_match("/^([-a-z0-9_-\s])+$/i", $str)) ? FALSE : TRUE;
1434 1434
 	}
1435
-		public function currency_decimal($str){
1436
-			return (bool) preg_match('#^\d{0,5}+(?:\.\d{1,5})?$#', $str);
1435
+		public function currency_decimal($str) {
1436
+			return (bool)preg_match('#^\d{0,5}+(?:\.\d{1,5})?$#', $str);
1437 1437
 //            test(num)
1438 1438
 		}
1439 1439
 		/* ASTPP  3.0 
1440 1440
          * For Old Password checking
1441 1441
          */
1442
-		public function password_check($str,$table){
1442
+		public function password_check($str, $table) {
1443 1443
 		  $this->CI->db->select('password');
1444
-		  $this->CI->db->where('id',$_POST['id']);
1445
-		  $result=$this->CI->db->get($table);
1446
-		  if($result->num_rows() > 0 ){
1447
-			  $result=(array)$result->first_row();
1448
-			  $password=$this->CI->common->decode($result['password']);
1449
-			  if($password && $password == $str){
1444
+		  $this->CI->db->where('id', $_POST['id']);
1445
+		  $result = $this->CI->db->get($table);
1446
+		  if ($result->num_rows() > 0) {
1447
+			  $result = (array)$result->first_row();
1448
+			  $password = $this->CI->common->decode($result['password']);
1449
+			  if ($password && $password == $str) {
1450 1450
 				  return true;
1451
-			  }else{
1451
+			  } else {
1452 1452
 				  return false;
1453 1453
 			  }
1454
-		  }else{
1454
+		  } else {
1455 1455
 			  return false;
1456 1456
 		  }
1457 1457
 		}
1458
-		public function did_account_checking($str){
1459
-		  $post_array=$this->CI->input->post();
1460
-		  if($str > 0){
1461
-		  $this->CI->db->where("id",$str);
1458
+		public function did_account_checking($str) {
1459
+		  $post_array = $this->CI->input->post();
1460
+		  if ($str > 0) {
1461
+		  $this->CI->db->where("id", $str);
1462 1462
 		  $this->CI->db->select('posttoexternal,balance,credit_limit');
1463
-		  $acc_result=$this->CI->db->get('accounts');
1464
-		  $customer_info=(array)$acc_result->first_row();
1463
+		  $acc_result = $this->CI->db->get('accounts');
1464
+		  $customer_info = (array)$acc_result->first_row();
1465 1465
 		  $available_bal = ($customer_info["balance"]) + $customer_info["posttoexternal"] * ($customer_info["credit_limit"]);
1466
-		  if($available_bal >= $post_array['setup']){
1466
+		  if ($available_bal >= $post_array['setup']) {
1467 1467
 		   return TRUE;
1468
-		  }else{
1468
+		  } else {
1469 1469
 		   return FALSE;
1470 1470
 		  }
1471
-		  }else{
1471
+		  } else {
1472 1472
 		   return TRUE;
1473 1473
 		  }
1474 1474
 		}
Please login to merge, or discard this patch.
web_interface/astpp/system/libraries/Fpdf.php 1 patch
Spacing   +106 added lines, -106 removed lines patch added patch discarded remove patch
@@ -77,14 +77,14 @@  discard block
 block discarded – undo
77 77
 *******************************************************************************/
78 78
 function FPDF($props = array())
79 79
 {
80
-	 if(count($props) == 3)
80
+	 if (count($props) == 3)
81 81
 	 {
82
-		 list($orientation,$unit,$format) = $props;
83
-		 $this->initialize($orientation,$unit,$format);
82
+		 list($orientation, $unit, $format) = $props;
83
+		 $this->initialize($orientation, $unit, $format);
84 84
 	 }	
85 85
 }
86 86
 
87
-function initialize($orientation='P',$unit='mm',$size='A4')
87
+function initialize($orientation = 'P', $unit = 'mm', $size = 'A4')
88 88
 {
89 89
 	// Some checks
90 90
 	$this->_dochecks();
@@ -182,12 +182,12 @@  discard block
 block discarded – undo
182 182
  * @param double $left
183 183
  * @param double $top
184 184
  */
185
-function SetMargins($left, $top, $right=null)
185
+function SetMargins($left, $top, $right = null)
186 186
 {
187 187
 	// Set left, top and right margins
188 188
 	$this->lMargin = $left;
189 189
 	$this->tMargin = $top;
190
-	if($right===null) {
190
+	if ($right === null) {
191 191
 			$right = $left;
192 192
 	}
193 193
 	$this->rMargin = $right;
@@ -216,25 +216,25 @@  discard block
 block discarded – undo
216 216
 /**
217 217
  * @param boolean $auto
218 218
  */
219
-function SetAutoPageBreak($auto, $margin=0)
219
+function SetAutoPageBreak($auto, $margin = 0)
220 220
 {
221 221
 	// Set auto page break mode and triggering margin
222 222
 	$this->AutoPageBreak = $auto;
223 223
 	$this->bMargin = $margin;
224
-	$this->PageBreakTrigger = $this->h-$margin;
224
+	$this->PageBreakTrigger = $this->h - $margin;
225 225
 }
226 226
 
227 227
 /**
228 228
  * @param string $zoom
229 229
  */
230
-function SetDisplayMode($zoom, $layout='default')
230
+function SetDisplayMode($zoom, $layout = 'default')
231 231
 {
232 232
 	// Set display mode in viewer
233
-	if($zoom=='fullpage' || $zoom=='fullwidth' || $zoom=='real' || $zoom=='default' || !is_string($zoom))
233
+	if ($zoom == 'fullpage' || $zoom == 'fullwidth' || $zoom == 'real' || $zoom == 'default' || ! is_string($zoom))
234 234
 		$this->ZoomMode = $zoom;
235 235
 	else
236 236
 		$this->Error('Incorrect zoom display mode: '.$zoom);
237
-	if($layout=='single' || $layout=='continuous' || $layout=='two' || $layout=='default')
237
+	if ($layout == 'single' || $layout == 'continuous' || $layout == 'two' || $layout == 'default')
238 238
 		$this->LayoutMode = $layout;
239 239
 	else
240 240
 		$this->Error('Incorrect layout display mode: '.$layout);
@@ -412,14 +412,14 @@  discard block
 block discarded – undo
412 412
 	return $this->page;
413 413
 }
414 414
 
415
-function SetDrawColor($r, $g=null, $b=null)
415
+function SetDrawColor($r, $g = null, $b = null)
416 416
 {
417 417
 	// Set color for all stroking operations
418
-	if(($r==0 && $g==0 && $b==0) || $g===null)
419
-		$this->DrawColor = sprintf('%.3F G',$r/255);
418
+	if (($r == 0 && $g == 0 && $b == 0) || $g === null)
419
+		$this->DrawColor = sprintf('%.3F G', $r / 255);
420 420
 	else
421
-		$this->DrawColor = sprintf('%.3F %.3F %.3F RG',$r/255,$g/255,$b/255);
422
-	if($this->page>0)
421
+		$this->DrawColor = sprintf('%.3F %.3F %.3F RG', $r / 255, $g / 255, $b / 255);
422
+	if ($this->page > 0)
423 423
 		$this->_out($this->DrawColor);
424 424
 }
425 425
 
@@ -428,26 +428,26 @@  discard block
 block discarded – undo
428 428
  * @param integer $g
429 429
  * @param integer $b
430 430
  */
431
-function SetFillColor($r, $g=null, $b=null)
431
+function SetFillColor($r, $g = null, $b = null)
432 432
 {
433 433
 	// Set color for all filling operations
434
-	if(($r==0 && $g==0 && $b==0) || $g===null)
435
-		$this->FillColor = sprintf('%.3F g',$r/255);
434
+	if (($r == 0 && $g == 0 && $b == 0) || $g === null)
435
+		$this->FillColor = sprintf('%.3F g', $r / 255);
436 436
 	else
437
-		$this->FillColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
438
-	$this->ColorFlag = ($this->FillColor!=$this->TextColor);
439
-	if($this->page>0)
437
+		$this->FillColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255);
438
+	$this->ColorFlag = ($this->FillColor != $this->TextColor);
439
+	if ($this->page > 0)
440 440
 		$this->_out($this->FillColor);
441 441
 }
442 442
 
443
-function SetTextColor($r, $g=null, $b=null)
443
+function SetTextColor($r, $g = null, $b = null)
444 444
 {
445 445
 	// Set color for text
446
-	if(($r==0 && $g==0 && $b==0) || $g===null)
447
-		$this->TextColor = sprintf('%.3F g',$r/255);
446
+	if (($r == 0 && $g == 0 && $b == 0) || $g === null)
447
+		$this->TextColor = sprintf('%.3F g', $r / 255);
448 448
 	else
449
-		$this->TextColor = sprintf('%.3F %.3F %.3F rg',$r/255,$g/255,$b/255);
450
-	$this->ColorFlag = ($this->FillColor!=$this->TextColor);
449
+		$this->TextColor = sprintf('%.3F %.3F %.3F rg', $r / 255, $g / 255, $b / 255);
450
+	$this->ColorFlag = ($this->FillColor != $this->TextColor);
451 451
 }
452 452
 
453 453
 function GetStringWidth($s)
@@ -457,18 +457,18 @@  discard block
 block discarded – undo
457 457
 	$cw = &$this->CurrentFont['cw'];
458 458
 	$w = 0;
459 459
 	$l = strlen($s);
460
-	for($i=0;$i<$l;$i++) {
460
+	for ($i = 0; $i < $l; $i++) {
461 461
 			$w += $cw[$s[$i]];
462 462
 	}
463
-	return $w*$this->FontSize/1000;
463
+	return $w * $this->FontSize / 1000;
464 464
 }
465 465
 
466 466
 function SetLineWidth($width)
467 467
 {
468 468
 	// Set line width
469 469
 	$this->LineWidth = $width;
470
-	if($this->page>0) {
471
-			$this->_out(sprintf('%.2F w',$width*$this->k));
470
+	if ($this->page > 0) {
471
+			$this->_out(sprintf('%.2F w', $width * $this->k));
472 472
 	}
473 473
 	}
474 474
 
@@ -479,57 +479,57 @@  discard block
 block discarded – undo
479 479
 function Line($x1, $y1, $x2, $y2)
480 480
 {
481 481
 	// Draw a line
482
-	$this->_out(sprintf('%.2F %.2F m %.2F %.2F l S',$x1*$this->k,($this->h-$y1)*$this->k,$x2*$this->k,($this->h-$y2)*$this->k));
482
+	$this->_out(sprintf('%.2F %.2F m %.2F %.2F l S', $x1 * $this->k, ($this->h - $y1) * $this->k, $x2 * $this->k, ($this->h - $y2) * $this->k));
483 483
 }
484 484
 
485
-function Rect($x, $y, $w, $h, $style='')
485
+function Rect($x, $y, $w, $h, $style = '')
486 486
 {
487 487
 	// Draw a rectangle
488
-	if($style=='F') {
488
+	if ($style == 'F') {
489 489
 			$op = 'f';
490
-	} elseif($style=='FD' || $style=='DF') {
490
+	} elseif ($style == 'FD' || $style == 'DF') {
491 491
 			$op = 'B';
492 492
 	} else {
493 493
 			$op = 'S';
494 494
 	}
495
-	$this->_out(sprintf('%.2F %.2F %.2F %.2F re %s',$x*$this->k,($this->h-$y)*$this->k,$w*$this->k,-$h*$this->k,$op));
495
+	$this->_out(sprintf('%.2F %.2F %.2F %.2F re %s', $x * $this->k, ($this->h - $y) * $this->k, $w * $this->k, -$h * $this->k, $op));
496 496
 }
497 497
 
498 498
 /**
499 499
  * @param string $family
500 500
  */
501
-function AddFont($family, $style='', $file='')
501
+function AddFont($family, $style = '', $file = '')
502 502
 {
503 503
 	// Add a TrueType, OpenType or Type1 font
504 504
 	$family = strtolower($family);
505
-	if($file=='') {
506
-			$file = str_replace(' ','',$family).strtolower($style).'.php';
505
+	if ($file == '') {
506
+			$file = str_replace(' ', '', $family).strtolower($style).'.php';
507 507
 	}
508 508
 	$style = strtoupper($style);
509
-	if($style=='IB') {
509
+	if ($style == 'IB') {
510 510
 			$style = 'BI';
511 511
 	}
512 512
 	$fontkey = $family.$style;
513
-	if(isset($this->fonts[$fontkey])) {
513
+	if (isset($this->fonts[$fontkey])) {
514 514
 			return;
515 515
 	}
516 516
 	$info = $this->_loadfont($file);
517
-	$info['i'] = count($this->fonts)+1;
518
-	if(!empty($info['diff']))
517
+	$info['i'] = count($this->fonts) + 1;
518
+	if ( ! empty($info['diff']))
519 519
 	{
520 520
 		// Search existing encodings
521
-		$n = array_search($info['diff'],$this->diffs);
522
-		if(!$n)
521
+		$n = array_search($info['diff'], $this->diffs);
522
+		if ( ! $n)
523 523
 		{
524
-			$n = count($this->diffs)+1;
524
+			$n = count($this->diffs) + 1;
525 525
 			$this->diffs[$n] = $info['diff'];
526 526
 		}
527 527
 		$info['diffn'] = $n;
528 528
 	}
529
-	if(!empty($info['file']))
529
+	if ( ! empty($info['file']))
530 530
 	{
531 531
 		// Embedded font
532
-		if($info['type']=='TrueType') {
532
+		if ($info['type'] == 'TrueType') {
533 533
 					$this->FontFiles[$info['file']] = array('length1'=>$info['originalsize']);
534 534
 		} else {
535 535
 					$this->FontFiles[$info['file']] = array('length1'=>$info['size1'], 'length2'=>$info['size2']);
@@ -541,48 +541,48 @@  discard block
 block discarded – undo
541 541
 /**
542 542
  * @param string $family
543 543
  */
544
-function SetFont($family, $style='', $size=0)
544
+function SetFont($family, $style = '', $size = 0)
545 545
 {
546 546
 	// Select a font; size given in points
547
-	if($family=='') {
547
+	if ($family == '') {
548 548
 			$family = $this->FontFamily;
549 549
 	} else {
550 550
 			$family = strtolower($family);
551 551
 	}
552 552
 	$style = strtoupper($style);
553
-	if(strpos($style,'U')!==false)
553
+	if (strpos($style, 'U') !== false)
554 554
 	{
555 555
 		$this->underline = true;
556
-		$style = str_replace('U','',$style);
556
+		$style = str_replace('U', '', $style);
557 557
 	} else {
558 558
 			$this->underline = false;
559 559
 	}
560
-	if($style=='IB') {
560
+	if ($style == 'IB') {
561 561
 			$style = 'BI';
562 562
 	}
563
-	if($size==0) {
563
+	if ($size == 0) {
564 564
 			$size = $this->FontSizePt;
565 565
 	}
566 566
 	// Test if font is already selected
567
-	if($this->FontFamily==$family && $this->FontStyle==$style && $this->FontSizePt==$size) {
567
+	if ($this->FontFamily == $family && $this->FontStyle == $style && $this->FontSizePt == $size) {
568 568
 			return;
569 569
 	}
570 570
 	// Test if font is already loaded
571 571
 	$fontkey = $family.$style;
572
-	if(!isset($this->fonts[$fontkey]))
572
+	if ( ! isset($this->fonts[$fontkey]))
573 573
 	{
574 574
 		// Test if one of the core fonts
575
-		if($family=='arial') {
575
+		if ($family == 'arial') {
576 576
 					$family = 'helvetica';
577 577
 		}
578
-		if(in_array($family,$this->CoreFonts))
578
+		if (in_array($family, $this->CoreFonts))
579 579
 		{
580
-			if($family=='symbol' || $family=='zapfdingbats') {
580
+			if ($family == 'symbol' || $family == 'zapfdingbats') {
581 581
 							$style = '';
582 582
 			}
583 583
 			$fontkey = $family.$style;
584
-			if(!isset($this->fonts[$fontkey])) {
585
-							$this->AddFont($family,$style);
584
+			if ( ! isset($this->fonts[$fontkey])) {
585
+							$this->AddFont($family, $style);
586 586
 			}
587 587
 		} else {
588 588
 					$this->Error('Undefined font: '.$family.' '.$style);
@@ -654,79 +654,79 @@  discard block
 block discarded – undo
654 654
 	return $this->AutoPageBreak;
655 655
 }
656 656
 
657
-function Cell($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
657
+function Cell($w, $h = 0, $txt = '', $border = 0, $ln = 0, $align = '', $fill = false, $link = '')
658 658
 {
659 659
 	// Output a cell
660 660
 	$k = $this->k;
661
-	if($this->y+$h>$this->PageBreakTrigger && !$this->InHeader && !$this->InFooter && $this->AcceptPageBreak())
661
+	if ($this->y + $h > $this->PageBreakTrigger && ! $this->InHeader && ! $this->InFooter && $this->AcceptPageBreak())
662 662
 	{
663 663
 		// Automatic page break
664 664
 		$x = $this->x;
665 665
 		$ws = $this->ws;
666
-		if($ws>0)
666
+		if ($ws > 0)
667 667
 		{
668 668
 			$this->ws = 0;
669 669
 			$this->_out('0 Tw');
670 670
 		}
671
-		$this->AddPage($this->CurOrientation,$this->CurPageSize);
671
+		$this->AddPage($this->CurOrientation, $this->CurPageSize);
672 672
 		$this->x = $x;
673
-		if($ws>0)
673
+		if ($ws > 0)
674 674
 		{
675 675
 			$this->ws = $ws;
676
-			$this->_out(sprintf('%.3F Tw',$ws*$k));
676
+			$this->_out(sprintf('%.3F Tw', $ws * $k));
677 677
 		}
678 678
 	}
679
-	if($w==0)
680
-		$w = $this->w-$this->rMargin-$this->x;
679
+	if ($w == 0)
680
+		$w = $this->w - $this->rMargin - $this->x;
681 681
 	$s = '';
682
-	if($fill || $border==1)
682
+	if ($fill || $border == 1)
683 683
 	{
684
-		if($fill)
685
-			$op = ($border==1) ? 'B' : 'f';
684
+		if ($fill)
685
+			$op = ($border == 1) ? 'B' : 'f';
686 686
 		else
687 687
 			$op = 'S';
688
-		$s = sprintf('%.2F %.2F %.2F %.2F re %s ',$this->x*$k,($this->h-$this->y)*$k,$w*$k,-$h*$k,$op);
688
+		$s = sprintf('%.2F %.2F %.2F %.2F re %s ', $this->x * $k, ($this->h - $this->y) * $k, $w * $k, -$h * $k, $op);
689 689
 	}
690
-	if(is_string($border))
690
+	if (is_string($border))
691 691
 	{
692 692
 		$x = $this->x;
693 693
 		$y = $this->y;
694
-		if(strpos($border,'L')!==false)
695
-			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,$x*$k,($this->h-($y+$h))*$k);
696
-		if(strpos($border,'T')!==false)
697
-			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-$y)*$k);
698
-		if(strpos($border,'R')!==false)
699
-			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ',($x+$w)*$k,($this->h-$y)*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
700
-		if(strpos($border,'B')!==false)
701
-			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ',$x*$k,($this->h-($y+$h))*$k,($x+$w)*$k,($this->h-($y+$h))*$k);
694
+		if (strpos($border, 'L') !== false)
695
+			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, $x * $k, ($this->h - ($y + $h)) * $k);
696
+		if (strpos($border, 'T') !== false)
697
+			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - $y) * $k);
698
+		if (strpos($border, 'R') !== false)
699
+			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ', ($x + $w) * $k, ($this->h - $y) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
700
+		if (strpos($border, 'B') !== false)
701
+			$s .= sprintf('%.2F %.2F m %.2F %.2F l S ', $x * $k, ($this->h - ($y + $h)) * $k, ($x + $w) * $k, ($this->h - ($y + $h)) * $k);
702 702
 	}
703
-	if($txt!=='')
703
+	if ($txt !== '')
704 704
 	{
705
-		if($align=='R')
706
-			$dx = $w-$this->cMargin-$this->GetStringWidth($txt);
707
-		elseif($align=='C')
708
-			$dx = ($w-$this->GetStringWidth($txt))/2;
705
+		if ($align == 'R')
706
+			$dx = $w - $this->cMargin - $this->GetStringWidth($txt);
707
+		elseif ($align == 'C')
708
+			$dx = ($w - $this->GetStringWidth($txt)) / 2;
709 709
 		else
710 710
 			$dx = $this->cMargin;
711
-		if($this->ColorFlag)
711
+		if ($this->ColorFlag)
712 712
 			$s .= 'q '.$this->TextColor.' ';
713
-		$txt2 = str_replace(')','\\)',str_replace('(','\\(',str_replace('\\','\\\\',$txt)));
714
-		$s .= sprintf('BT %.2F %.2F Td (%s) Tj ET',($this->x+$dx)*$k,($this->h-($this->y+.5*$h+.3*$this->FontSize))*$k,$txt2);
715
-		if($this->underline)
716
-			$s .= ' '.$this->_dounderline($this->x+$dx,$this->y+.5*$h+.3*$this->FontSize,$txt);
717
-		if($this->ColorFlag)
713
+		$txt2 = str_replace(')', '\\)', str_replace('(', '\\(', str_replace('\\', '\\\\', $txt)));
714
+		$s .= sprintf('BT %.2F %.2F Td (%s) Tj ET', ($this->x + $dx) * $k, ($this->h - ($this->y + .5 * $h + .3 * $this->FontSize)) * $k, $txt2);
715
+		if ($this->underline)
716
+			$s .= ' '.$this->_dounderline($this->x + $dx, $this->y + .5 * $h + .3 * $this->FontSize, $txt);
717
+		if ($this->ColorFlag)
718 718
 			$s .= ' Q';
719
-		if($link)
720
-			$this->Link($this->x+$dx,$this->y+.5*$h-.5*$this->FontSize,$this->GetStringWidth($txt),$this->FontSize,$link);
719
+		if ($link)
720
+			$this->Link($this->x + $dx, $this->y + .5 * $h - .5 * $this->FontSize, $this->GetStringWidth($txt), $this->FontSize, $link);
721 721
 	}
722
-	if($s)
722
+	if ($s)
723 723
 		$this->_out($s);
724 724
 	$this->lasth = $h;
725
-	if($ln>0)
725
+	if ($ln > 0)
726 726
 	{
727 727
 		// Go to next line
728 728
 		$this->y += $h;
729
-		if($ln==1)
729
+		if ($ln == 1)
730 730
 			$this->x = $this->lMargin;
731 731
 	}
732 732
 	else
@@ -737,21 +737,21 @@  discard block
 block discarded – undo
737 737
  * @param integer $w
738 738
  * @param integer $h
739 739
  */
740
-function MultiCell($w, $h, $txt, $border=0, $align='J', $fill=false)
740
+function MultiCell($w, $h, $txt, $border = 0, $align = 'J', $fill = false)
741 741
 {
742 742
 	// Output text with automatic or explicit line breaks
743 743
 	$cw = &$this->CurrentFont['cw'];
744
-	if($w==0)
745
-		$w = $this->w-$this->rMargin-$this->x;
746
-	$wmax = ($w-2*$this->cMargin)*1000/$this->FontSize;
747
-	$s = str_replace("\r",'',$txt);
744
+	if ($w == 0)
745
+		$w = $this->w - $this->rMargin - $this->x;
746
+	$wmax = ($w - 2 * $this->cMargin) * 1000 / $this->FontSize;
747
+	$s = str_replace("\r", '', $txt);
748 748
 	$nb = strlen($s);
749
-	if($nb>0 && $s[$nb-1]=="\n")
749
+	if ($nb > 0 && $s[$nb - 1] == "\n")
750 750
 		$nb--;
751 751
 	$b = 0;
752
-	if($border)
752
+	if ($border)
753 753
 	{
754
-		if($border==1)
754
+		if ($border == 1)
755 755
 		{
756 756
 			$border = 'LTRB';
757 757
 			$b = 'LRT';
Please login to merge, or discard this patch.
web_interface/astpp/system/libraries/pdf.php 1 patch
Spacing   +68 added lines, -68 removed lines patch added patch discarded remove patch
@@ -11,25 +11,25 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
Please login to merge, or discard this patch.