@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | * NOTE: If you change these, also change the error_reporting() code below |
| 19 | 19 | * |
| 20 | 20 | */ |
| 21 | - ini_set("date.timezone", "UTC"); |
|
| 21 | + ini_set("date.timezone", "UTC"); |
|
| 22 | 22 | define('ENVIRONMENT', 'development'); |
| 23 | 23 | /* |
| 24 | 24 | *--------------------------------------------------------------- |
@@ -68,7 +68,7 @@ discard block |
||
| 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 |
@@ -96,7 +96,7 @@ |
||
| 96 | 96 | // Get mime types for later |
| 97 | 97 | if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/mimes.php')) |
| 98 | 98 | { |
| 99 | - include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; |
|
| 99 | + include APPPATH.'config/'.ENVIRONMENT.'/mimes.php'; |
|
| 100 | 100 | } |
| 101 | 101 | else |
| 102 | 102 | { |
@@ -316,7 +316,7 @@ |
||
| 316 | 316 | $uri = $str; |
| 317 | 317 | } |
| 318 | 318 | } |
| 319 | - return $uri; |
|
| 319 | + return $uri; |
|
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | // -------------------------------------------------------------------- |
@@ -254,7 +254,7 @@ |
||
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | $_config[0] =& $config; |
| 257 | - return $_config[0]; |
|
| 257 | + return $_config[0]; |
|
| 258 | 258 | |
| 259 | 259 | } |
| 260 | 260 | } |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | // -------------------------------------------------------------------- |
| 135 | 135 | |
| 136 | 136 | /** |
| 137 | - * Fetch an item from the GET array |
|
| 138 | - * |
|
| 139 | - * @access public |
|
| 140 | - * @param string |
|
| 141 | - * @param bool |
|
| 142 | - * @return string |
|
| 143 | - */ |
|
| 137 | + * Fetch an item from the GET array |
|
| 138 | + * |
|
| 139 | + * @access public |
|
| 140 | + * @param string |
|
| 141 | + * @param bool |
|
| 142 | + * @return string |
|
| 143 | + */ |
|
| 144 | 144 | function get($index = NULL, $xss_clean = FALSE) |
| 145 | 145 | { |
| 146 | 146 | // Check if a field has been provided |
@@ -162,13 +162,13 @@ discard block |
||
| 162 | 162 | // -------------------------------------------------------------------- |
| 163 | 163 | |
| 164 | 164 | /** |
| 165 | - * Fetch an item from the POST array |
|
| 166 | - * |
|
| 167 | - * @access public |
|
| 168 | - * @param string |
|
| 169 | - * @param bool |
|
| 170 | - * @return string |
|
| 171 | - */ |
|
| 165 | + * Fetch an item from the POST array |
|
| 166 | + * |
|
| 167 | + * @access public |
|
| 168 | + * @param string |
|
| 169 | + * @param bool |
|
| 170 | + * @return string |
|
| 171 | + */ |
|
| 172 | 172 | function post($index = NULL, $xss_clean = FALSE) |
| 173 | 173 | { |
| 174 | 174 | // Check if a field has been provided |
@@ -191,13 +191,13 @@ discard block |
||
| 191 | 191 | // -------------------------------------------------------------------- |
| 192 | 192 | |
| 193 | 193 | /** |
| 194 | - * Fetch an item from either the GET array or the POST |
|
| 195 | - * |
|
| 196 | - * @access public |
|
| 197 | - * @param string The index key |
|
| 198 | - * @param bool XSS cleaning |
|
| 199 | - * @return string |
|
| 200 | - */ |
|
| 194 | + * Fetch an item from either the GET array or the POST |
|
| 195 | + * |
|
| 196 | + * @access public |
|
| 197 | + * @param string The index key |
|
| 198 | + * @param bool XSS cleaning |
|
| 199 | + * @return string |
|
| 200 | + */ |
|
| 201 | 201 | function get_post($index = '', $xss_clean = FALSE) |
| 202 | 202 | { |
| 203 | 203 | if ( ! isset($_POST[$index]) ) |
@@ -213,13 +213,13 @@ discard block |
||
| 213 | 213 | // -------------------------------------------------------------------- |
| 214 | 214 | |
| 215 | 215 | /** |
| 216 | - * Fetch an item from the COOKIE array |
|
| 217 | - * |
|
| 218 | - * @access public |
|
| 219 | - * @param string |
|
| 220 | - * @param bool |
|
| 221 | - * @return string |
|
| 222 | - */ |
|
| 216 | + * Fetch an item from the COOKIE array |
|
| 217 | + * |
|
| 218 | + * @access public |
|
| 219 | + * @param string |
|
| 220 | + * @param bool |
|
| 221 | + * @return string |
|
| 222 | + */ |
|
| 223 | 223 | function cookie($index = '', $xss_clean = FALSE) |
| 224 | 224 | { |
| 225 | 225 | return $this->_fetch_from_array($_COOKIE, $index, $xss_clean); |
@@ -228,21 +228,21 @@ discard block |
||
| 228 | 228 | // ------------------------------------------------------------------------ |
| 229 | 229 | |
| 230 | 230 | /** |
| 231 | - * Set cookie |
|
| 232 | - * |
|
| 233 | - * Accepts six parameter, or you can submit an associative |
|
| 234 | - * array in the first parameter containing all the values. |
|
| 235 | - * |
|
| 236 | - * @access public |
|
| 237 | - * @param mixed |
|
| 238 | - * @param string the value of the cookie |
|
| 239 | - * @param string the number of seconds until expiration |
|
| 240 | - * @param string the cookie domain. Usually: .yourdomain.com |
|
| 241 | - * @param string the cookie path |
|
| 242 | - * @param string the cookie prefix |
|
| 243 | - * @param bool true makes the cookie secure |
|
| 244 | - * @return void |
|
| 245 | - */ |
|
| 231 | + * Set cookie |
|
| 232 | + * |
|
| 233 | + * Accepts six parameter, or you can submit an associative |
|
| 234 | + * array in the first parameter containing all the values. |
|
| 235 | + * |
|
| 236 | + * @access public |
|
| 237 | + * @param mixed |
|
| 238 | + * @param string the value of the cookie |
|
| 239 | + * @param string the number of seconds until expiration |
|
| 240 | + * @param string the cookie domain. Usually: .yourdomain.com |
|
| 241 | + * @param string the cookie path |
|
| 242 | + * @param string the cookie prefix |
|
| 243 | + * @param bool true makes the cookie secure |
|
| 244 | + * @return void |
|
| 245 | + */ |
|
| 246 | 246 | function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE) |
| 247 | 247 | { |
| 248 | 248 | if (is_array($name)) |
@@ -289,13 +289,13 @@ discard block |
||
| 289 | 289 | // -------------------------------------------------------------------- |
| 290 | 290 | |
| 291 | 291 | /** |
| 292 | - * Fetch an item from the SERVER array |
|
| 293 | - * |
|
| 294 | - * @access public |
|
| 295 | - * @param string |
|
| 296 | - * @param bool |
|
| 297 | - * @return string |
|
| 298 | - */ |
|
| 292 | + * Fetch an item from the SERVER array |
|
| 293 | + * |
|
| 294 | + * @access public |
|
| 295 | + * @param string |
|
| 296 | + * @param bool |
|
| 297 | + * @return string |
|
| 298 | + */ |
|
| 299 | 299 | function server($index = '', $xss_clean = FALSE) |
| 300 | 300 | { |
| 301 | 301 | return $this->_fetch_from_array($_SERVER, $index, $xss_clean); |
@@ -304,11 +304,11 @@ discard block |
||
| 304 | 304 | // -------------------------------------------------------------------- |
| 305 | 305 | |
| 306 | 306 | /** |
| 307 | - * Fetch the IP Address |
|
| 308 | - * |
|
| 309 | - * @access public |
|
| 310 | - * @return string |
|
| 311 | - */ |
|
| 307 | + * Fetch the IP Address |
|
| 308 | + * |
|
| 309 | + * @access public |
|
| 310 | + * @return string |
|
| 311 | + */ |
|
| 312 | 312 | function ip_address() |
| 313 | 313 | { |
| 314 | 314 | if ($this->ip_address !== FALSE) |
@@ -363,14 +363,14 @@ discard block |
||
| 363 | 363 | // -------------------------------------------------------------------- |
| 364 | 364 | |
| 365 | 365 | /** |
| 366 | - * Validate IP Address |
|
| 367 | - * |
|
| 368 | - * Updated version suggested by Geert De Deckere |
|
| 369 | - * |
|
| 370 | - * @access public |
|
| 371 | - * @param string |
|
| 372 | - * @return string |
|
| 373 | - */ |
|
| 366 | + * Validate IP Address |
|
| 367 | + * |
|
| 368 | + * Updated version suggested by Geert De Deckere |
|
| 369 | + * |
|
| 370 | + * @access public |
|
| 371 | + * @param string |
|
| 372 | + * @return string |
|
| 373 | + */ |
|
| 374 | 374 | function valid_ip($ip) |
| 375 | 375 | { |
| 376 | 376 | $ip_segments = explode('.', $ip); |
@@ -402,11 +402,11 @@ discard block |
||
| 402 | 402 | // -------------------------------------------------------------------- |
| 403 | 403 | |
| 404 | 404 | /** |
| 405 | - * User Agent |
|
| 406 | - * |
|
| 407 | - * @access public |
|
| 408 | - * @return string |
|
| 409 | - */ |
|
| 405 | + * User Agent |
|
| 406 | + * |
|
| 407 | + * @access public |
|
| 408 | + * @return string |
|
| 409 | + */ |
|
| 410 | 410 | function user_agent() |
| 411 | 411 | { |
| 412 | 412 | if ($this->user_agent !== FALSE) |
@@ -422,19 +422,19 @@ discard block |
||
| 422 | 422 | // -------------------------------------------------------------------- |
| 423 | 423 | |
| 424 | 424 | /** |
| 425 | - * Sanitize Globals |
|
| 426 | - * |
|
| 427 | - * This function does the following: |
|
| 428 | - * |
|
| 429 | - * Unsets $_GET data (if query strings are not enabled) |
|
| 430 | - * |
|
| 431 | - * Unsets all globals if register_globals is enabled |
|
| 432 | - * |
|
| 433 | - * Standardizes newline characters to \n |
|
| 434 | - * |
|
| 435 | - * @access private |
|
| 436 | - * @return void |
|
| 437 | - */ |
|
| 425 | + * Sanitize Globals |
|
| 426 | + * |
|
| 427 | + * This function does the following: |
|
| 428 | + * |
|
| 429 | + * Unsets $_GET data (if query strings are not enabled) |
|
| 430 | + * |
|
| 431 | + * Unsets all globals if register_globals is enabled |
|
| 432 | + * |
|
| 433 | + * Standardizes newline characters to \n |
|
| 434 | + * |
|
| 435 | + * @access private |
|
| 436 | + * @return void |
|
| 437 | + */ |
|
| 438 | 438 | function _sanitize_globals() |
| 439 | 439 | { |
| 440 | 440 | // It would be "wrong" to unset any of these GLOBALS. |
@@ -527,15 +527,15 @@ discard block |
||
| 527 | 527 | // -------------------------------------------------------------------- |
| 528 | 528 | |
| 529 | 529 | /** |
| 530 | - * Clean Input Data |
|
| 531 | - * |
|
| 532 | - * This is a helper function. It escapes data and |
|
| 533 | - * standardizes newline characters to \n |
|
| 534 | - * |
|
| 535 | - * @access private |
|
| 536 | - * @param string |
|
| 537 | - * @return string |
|
| 538 | - */ |
|
| 530 | + * Clean Input Data |
|
| 531 | + * |
|
| 532 | + * This is a helper function. It escapes data and |
|
| 533 | + * standardizes newline characters to \n |
|
| 534 | + * |
|
| 535 | + * @access private |
|
| 536 | + * @param string |
|
| 537 | + * @return string |
|
| 538 | + */ |
|
| 539 | 539 | function _clean_input_data($str) |
| 540 | 540 | { |
| 541 | 541 | if (is_array($str)) |
@@ -588,16 +588,16 @@ discard block |
||
| 588 | 588 | // -------------------------------------------------------------------- |
| 589 | 589 | |
| 590 | 590 | /** |
| 591 | - * Clean Keys |
|
| 592 | - * |
|
| 593 | - * This is a helper function. To prevent malicious users |
|
| 594 | - * from trying to exploit keys we make sure that keys are |
|
| 595 | - * only named with alpha-numeric text and a few other items. |
|
| 596 | - * |
|
| 597 | - * @access private |
|
| 598 | - * @param string |
|
| 599 | - * @return string |
|
| 600 | - */ |
|
| 591 | + * Clean Keys |
|
| 592 | + * |
|
| 593 | + * This is a helper function. To prevent malicious users |
|
| 594 | + * from trying to exploit keys we make sure that keys are |
|
| 595 | + * only named with alpha-numeric text and a few other items. |
|
| 596 | + * |
|
| 597 | + * @access private |
|
| 598 | + * @param string |
|
| 599 | + * @return string |
|
| 600 | + */ |
|
| 601 | 601 | function _clean_input_keys($str) |
| 602 | 602 | { |
| 603 | 603 | if ( ! preg_match("/^[a-z0-9:_\/-]+$/i", $str)) |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | |
| 83 | 83 | if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/hooks.php')) |
| 84 | 84 | { |
| 85 | - include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); |
|
| 85 | + include(APPPATH.'config/'.ENVIRONMENT.'/hooks.php'); |
|
| 86 | 86 | } |
| 87 | 87 | elseif (is_file(APPPATH.'config/hooks.php')) |
| 88 | 88 | { |
@@ -162,13 +162,13 @@ |
||
| 162 | 162 | //================ITPL======================= |
| 163 | 163 | $pos = strpos($str, "_json"); |
| 164 | 164 | if($pos > 0 && !isset($_SERVER['HTTP_X_REQUESTED_WITH'])){ |
| 165 | - $this->uri_string = str_replace('_json', '', trim($str, '/')); |
|
| 165 | + $this->uri_string = str_replace('_json', '', trim($str, '/')); |
|
| 166 | 166 | }else{ |
| 167 | 167 | // If the URI contains only a slash we'll kill it |
| 168 | 168 | $this->uri_string = ($str == '/') ? '' : $str; |
| 169 | 169 | } |
| 170 | 170 | /*===============================*/ |
| 171 | - } |
|
| 171 | + } |
|
| 172 | 172 | |
| 173 | 173 | // -------------------------------------------------------------------- |
| 174 | 174 | |
@@ -10,260 +10,260 @@ |
||
| 10 | 10 | |
| 11 | 11 | |
| 12 | 12 | |
| 13 | - $this->page++; |
|
| 14 | - if(!isset($this->pages[$this->page])) // solves the problem of overwriting a page if it already exists |
|
| 15 | - $this->pages[$this->page] = ''; |
|
| 16 | - $this->state =2; |
|
| 17 | - $this->x = $this->lMargin; |
|
| 18 | - $this->y = $this->tMargin; |
|
| 19 | - $this->FontFamily = ''; |
|
| 20 | - // 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); |
|
| 29 | - if($orientation!=$this->CurOrientation || $size[0]!=$this->CurPageSize[0] || $size[1]!=$this->CurPageSize[1]) |
|
| 30 | - { |
|
| 31 | - // New size or orientation |
|
| 32 | - if($orientation=='P') |
|
| 33 | - { |
|
| 34 | - $this->w = $size[0]; |
|
| 35 | - $this->h = $size[1]; |
|
| 36 | - } |
|
| 37 | - else |
|
| 38 | - { |
|
| 39 | - $this->w = $size[1]; |
|
| 40 | - $this->h = $size[0]; |
|
| 41 | - } |
|
| 42 | - $this->wPt = $this->w*$this->k; |
|
| 43 | - $this->hPt = $this->h*$this->k; |
|
| 44 | - $this->PageBreakTrigger = $this->h-$this->bMargin; |
|
| 45 | - $this->CurOrientation = $orientation; |
|
| 46 | - $this->CurPageSize = $size; |
|
| 47 | - } |
|
| 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); |
|
| 13 | + $this->page++; |
|
| 14 | + if(!isset($this->pages[$this->page])) // solves the problem of overwriting a page if it already exists |
|
| 15 | + $this->pages[$this->page] = ''; |
|
| 16 | + $this->state =2; |
|
| 17 | + $this->x = $this->lMargin; |
|
| 18 | + $this->y = $this->tMargin; |
|
| 19 | + $this->FontFamily = ''; |
|
| 20 | + // 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); |
|
| 29 | + if($orientation!=$this->CurOrientation || $size[0]!=$this->CurPageSize[0] || $size[1]!=$this->CurPageSize[1]) |
|
| 30 | + { |
|
| 31 | + // New size or orientation |
|
| 32 | + if($orientation=='P') |
|
| 33 | + { |
|
| 34 | + $this->w = $size[0]; |
|
| 35 | + $this->h = $size[1]; |
|
| 36 | + } |
|
| 37 | + else |
|
| 38 | + { |
|
| 39 | + $this->w = $size[1]; |
|
| 40 | + $this->h = $size[0]; |
|
| 41 | + } |
|
| 42 | + $this->wPt = $this->w*$this->k; |
|
| 43 | + $this->hPt = $this->h*$this->k; |
|
| 44 | + $this->PageBreakTrigger = $this->h-$this->bMargin; |
|
| 45 | + $this->CurOrientation = $orientation; |
|
| 46 | + $this->CurPageSize = $size; |
|
| 47 | + } |
|
| 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 | 50 | } |
| 51 | 51 | |
| 52 | 52 | function Footer() { |
| 53 | - // Check if Footer for this page already exists (do the same for Header()) |
|
| 54 | - if(!isset($this->footerset[$this->page])) { |
|
| 55 | - $this->SetY(-15); |
|
| 56 | - // Page number |
|
| 57 | - $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); |
|
| 58 | - // set footerset |
|
| 59 | - $this->footerset[$this->page] = true; |
|
| 60 | - } |
|
| 53 | + // Check if Footer for this page already exists (do the same for Header()) |
|
| 54 | + if(!isset($this->footerset[$this->page])) { |
|
| 55 | + $this->SetY(-15); |
|
| 56 | + // Page number |
|
| 57 | + $this->Cell(0,10,'Page '.$this->PageNo().'/{nb}',0,0,'C'); |
|
| 58 | + // set footerset |
|
| 59 | + $this->footerset[$this->page] = true; |
|
| 60 | + } |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | function morepagestable($datas, $lineheight=8) { |
| 64 | - // some things to set and 'remember' |
|
| 65 | - $l = $this->lMargin; |
|
| 66 | - $startheight = $h = $this->GetY(); |
|
| 67 | - $startpage = $currpage = $maxpage = $this->page; |
|
| 64 | + // some things to set and 'remember' |
|
| 65 | + $l = $this->lMargin; |
|
| 66 | + $startheight = $h = $this->GetY(); |
|
| 67 | + $startpage = $currpage = $maxpage = $this->page; |
|
| 68 | 68 | |
| 69 | - // calculate the whole width |
|
| 70 | - $fullwidth = 0; |
|
| 71 | - foreach($this->tablewidths AS $width) { |
|
| 72 | - $fullwidth += $width; |
|
| 73 | - } |
|
| 69 | + // calculate the whole width |
|
| 70 | + $fullwidth = 0; |
|
| 71 | + foreach($this->tablewidths AS $width) { |
|
| 72 | + $fullwidth += $width; |
|
| 73 | + } |
|
| 74 | 74 | |
| 75 | - // Now let's start to write the table |
|
| 76 | - foreach($datas AS $row => $data) { |
|
| 77 | - $this->page = $currpage; |
|
| 78 | - // write the horizontal borders |
|
| 75 | + // Now let's start to write the table |
|
| 76 | + foreach($datas AS $row => $data) { |
|
| 77 | + $this->page = $currpage; |
|
| 78 | + // write the horizontal borders |
|
| 79 | 79 | |
| 80 | - // write the content and remember the height of the highest col |
|
| 81 | - foreach($data AS $col => $txt) { |
|
| 82 | - $this->page = $currpage; |
|
| 83 | - $this->SetXY($l,$h); |
|
| 80 | + // write the content and remember the height of the highest col |
|
| 81 | + foreach($data AS $col => $txt) { |
|
| 82 | + $this->page = $currpage; |
|
| 83 | + $this->SetXY($l,$h); |
|
| 84 | 84 | |
| 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 | - $l += $this->tablewidths[$col]; |
|
| 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 | + $l += $this->tablewidths[$col]; |
|
| 90 | 90 | |
| 91 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
| 92 | - $tmpheight[$row.'-'.$this->page] = 0; |
|
| 93 | - if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
| 94 | - $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
|
| 95 | - } |
|
| 96 | - if($this->page > $maxpage) |
|
| 97 | - $maxpage = $this->page; |
|
| 98 | - } |
|
| 91 | + if(!isset($tmpheight[$row.'-'.$this->page])) |
|
| 92 | + $tmpheight[$row.'-'.$this->page] = 0; |
|
| 93 | + if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
| 94 | + $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
|
| 95 | + } |
|
| 96 | + if($this->page > $maxpage) |
|
| 97 | + $maxpage = $this->page; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - // get the height we were in the last used page |
|
| 101 | - $h = $tmpheight[$row.'-'.$maxpage]; |
|
| 102 | - // set the "pointer" to the left margin |
|
| 103 | - $l = $this->lMargin; |
|
| 104 | - // set the $currpage to the last page |
|
| 105 | - $currpage = $maxpage; |
|
| 106 | - } |
|
| 107 | - // draw the borders |
|
| 108 | - // we start adding a horizontal line on the last page |
|
| 109 | - $this->page = $maxpage; |
|
| 110 | - $this->Line($l,$h,$fullwidth+$l,$h); |
|
| 111 | - // now we start at the top of the document and walk down |
|
| 112 | - for($i = $startpage; $i <= $maxpage; $i++) { |
|
| 113 | - $this->page = $i; |
|
| 114 | - $l = $this->lMargin; |
|
| 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) { |
|
| 119 | - $l += $width; |
|
| 120 | - $this->Line($l,$t,$l,$lh); |
|
| 121 | - } |
|
| 122 | - } |
|
| 123 | - // set it to the last page, if not it'll cause some problems |
|
| 124 | - $this->page = $maxpage; |
|
| 100 | + // get the height we were in the last used page |
|
| 101 | + $h = $tmpheight[$row.'-'.$maxpage]; |
|
| 102 | + // set the "pointer" to the left margin |
|
| 103 | + $l = $this->lMargin; |
|
| 104 | + // set the $currpage to the last page |
|
| 105 | + $currpage = $maxpage; |
|
| 106 | + } |
|
| 107 | + // draw the borders |
|
| 108 | + // we start adding a horizontal line on the last page |
|
| 109 | + $this->page = $maxpage; |
|
| 110 | + $this->Line($l,$h,$fullwidth+$l,$h); |
|
| 111 | + // now we start at the top of the document and walk down |
|
| 112 | + for($i = $startpage; $i <= $maxpage; $i++) { |
|
| 113 | + $this->page = $i; |
|
| 114 | + $l = $this->lMargin; |
|
| 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) { |
|
| 119 | + $l += $width; |
|
| 120 | + $this->Line($l,$t,$l,$lh); |
|
| 121 | + } |
|
| 122 | + } |
|
| 123 | + // set it to the last page, if not it'll cause some problems |
|
| 124 | + $this->page = $maxpage; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | function table_total($datas, $lineheight=8) { |
| 130 | - // some things to set and 'remember' |
|
| 131 | - $l = $this->lMargin; |
|
| 132 | - $startheight = $h = $this->GetY(); |
|
| 133 | - $startpage = $currpage = $maxpage = $this->page; |
|
| 130 | + // some things to set and 'remember' |
|
| 131 | + $l = $this->lMargin; |
|
| 132 | + $startheight = $h = $this->GetY(); |
|
| 133 | + $startpage = $currpage = $maxpage = $this->page; |
|
| 134 | 134 | |
| 135 | - // calculate the whole width |
|
| 136 | - $fullwidth = 0; |
|
| 137 | - foreach($this->tablewidths AS $width) { |
|
| 138 | - $fullwidth += $width; |
|
| 139 | - } |
|
| 135 | + // calculate the whole width |
|
| 136 | + $fullwidth = 0; |
|
| 137 | + foreach($this->tablewidths AS $width) { |
|
| 138 | + $fullwidth += $width; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - // Now let's start to write the table |
|
| 142 | - foreach($datas AS $row => $data) { |
|
| 143 | - $this->page = $currpage; |
|
| 144 | - // write the horizontal borders |
|
| 141 | + // Now let's start to write the table |
|
| 142 | + foreach($datas AS $row => $data) { |
|
| 143 | + $this->page = $currpage; |
|
| 144 | + // write the horizontal borders |
|
| 145 | 145 | if($data != "") |
| 146 | - $this->Line(100,$h,200,$h); |
|
| 147 | - // write the content and remember the height of the highest col |
|
| 148 | - foreach($data AS $col => $txt) { |
|
| 149 | - $this->page = $currpage; |
|
| 150 | - $this->SetXY($l,$h); |
|
| 146 | + $this->Line(100,$h,200,$h); |
|
| 147 | + // write the content and remember the height of the highest col |
|
| 148 | + foreach($data AS $col => $txt) { |
|
| 149 | + $this->page = $currpage; |
|
| 150 | + $this->SetXY($l,$h); |
|
| 151 | 151 | |
| 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 | - $l += $this->tablewidths[$col]; |
|
| 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 | + $l += $this->tablewidths[$col]; |
|
| 161 | 161 | |
| 162 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
| 163 | - $tmpheight[$row.'-'.$this->page] = 0; |
|
| 164 | - if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
| 165 | - $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
|
| 166 | - } |
|
| 167 | - if($this->page > $maxpage) |
|
| 168 | - $maxpage = $this->page; |
|
| 169 | - } |
|
| 162 | + if(!isset($tmpheight[$row.'-'.$this->page])) |
|
| 163 | + $tmpheight[$row.'-'.$this->page] = 0; |
|
| 164 | + if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
| 165 | + $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
|
| 166 | + } |
|
| 167 | + if($this->page > $maxpage) |
|
| 168 | + $maxpage = $this->page; |
|
| 169 | + } |
|
| 170 | 170 | |
| 171 | - // get the height we were in the last used page |
|
| 172 | - $h = $tmpheight[$row.'-'.$maxpage]; |
|
| 173 | - // set the "pointer" to the left margin |
|
| 174 | - $l = $this->lMargin; |
|
| 175 | - // set the $currpage to the last page |
|
| 176 | - $currpage = $maxpage; |
|
| 177 | - } |
|
| 178 | - // draw the borders |
|
| 179 | - // we start adding a horizontal line on the last page |
|
| 180 | - $this->page = $maxpage; |
|
| 171 | + // get the height we were in the last used page |
|
| 172 | + $h = $tmpheight[$row.'-'.$maxpage]; |
|
| 173 | + // set the "pointer" to the left margin |
|
| 174 | + $l = $this->lMargin; |
|
| 175 | + // set the $currpage to the last page |
|
| 176 | + $currpage = $maxpage; |
|
| 177 | + } |
|
| 178 | + // draw the borders |
|
| 179 | + // we start adding a horizontal line on the last page |
|
| 180 | + $this->page = $maxpage; |
|
| 181 | 181 | |
| 182 | - $this->Line(100,$h,200,$h); |
|
| 182 | + $this->Line(100,$h,200,$h); |
|
| 183 | 183 | |
| 184 | - // now we start at the top of the document and walk down |
|
| 185 | - for($i = $startpage; $i <= $maxpage; $i++) { |
|
| 186 | - $this->page = $i; |
|
| 187 | - $l = $this->lMargin; |
|
| 188 | - $t = ($i == $startpage) ? $startheight : $this->tMargin; |
|
| 189 | - $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin; |
|
| 184 | + // now we start at the top of the document and walk down |
|
| 185 | + for($i = $startpage; $i <= $maxpage; $i++) { |
|
| 186 | + $this->page = $i; |
|
| 187 | + $l = $this->lMargin; |
|
| 188 | + $t = ($i == $startpage) ? $startheight : $this->tMargin; |
|
| 189 | + $lh = ($i == $maxpage) ? $h : $this->h-$this->bMargin; |
|
| 190 | 190 | |
| 191 | - foreach($this->tablewidths AS $width) { |
|
| 192 | - $l += $width; |
|
| 193 | - if($width != '30') |
|
| 194 | - { |
|
| 195 | - $this->Line(100,$t,100,$lh); |
|
| 196 | - $this->Line($l,$t,$l,$lh); |
|
| 197 | - } |
|
| 198 | - } |
|
| 199 | - } |
|
| 200 | - // set it to the last page, if not it'll cause some problems |
|
| 201 | - $this->page = $maxpage; |
|
| 191 | + foreach($this->tablewidths AS $width) { |
|
| 192 | + $l += $width; |
|
| 193 | + if($width != '30') |
|
| 194 | + { |
|
| 195 | + $this->Line(100,$t,100,$lh); |
|
| 196 | + $this->Line($l,$t,$l,$lh); |
|
| 197 | + } |
|
| 198 | + } |
|
| 199 | + } |
|
| 200 | + // set it to the last page, if not it'll cause some problems |
|
| 201 | + $this->page = $maxpage; |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | 205 | function export_pdf($datas, $lineheight=8) { |
| 206 | - // some things to set and 'remember' |
|
| 207 | - $l = $this->lMargin; |
|
| 208 | - $startheight = $h = $this->GetY(); |
|
| 209 | - $startpage = $currpage = $maxpage = $this->page; |
|
| 206 | + // some things to set and 'remember' |
|
| 207 | + $l = $this->lMargin; |
|
| 208 | + $startheight = $h = $this->GetY(); |
|
| 209 | + $startpage = $currpage = $maxpage = $this->page; |
|
| 210 | 210 | |
| 211 | - // calculate the whole width |
|
| 212 | - $fullwidth = 0; |
|
| 213 | - foreach($this->tablewidths AS $width) { |
|
| 214 | - $fullwidth += $width; |
|
| 215 | - } |
|
| 211 | + // calculate the whole width |
|
| 212 | + $fullwidth = 0; |
|
| 213 | + foreach($this->tablewidths AS $width) { |
|
| 214 | + $fullwidth += $width; |
|
| 215 | + } |
|
| 216 | 216 | |
| 217 | - // Now let's start to write the table |
|
| 218 | - foreach($datas AS $row => $data) { |
|
| 219 | - $this->page = $currpage; |
|
| 220 | - // write the horizontal borders |
|
| 217 | + // Now let's start to write the table |
|
| 218 | + foreach($datas AS $row => $data) { |
|
| 219 | + $this->page = $currpage; |
|
| 220 | + // write the horizontal borders |
|
| 221 | 221 | $this->Line($l,$h,$fullwidth+$l,$h); |
| 222 | - // write the content and remember the height of the highest col |
|
| 223 | - foreach($data AS $col => $txt) { |
|
| 224 | - $this->page = $currpage; |
|
| 225 | - $this->SetXY($l,$h); |
|
| 222 | + // write the content and remember the height of the highest col |
|
| 223 | + foreach($data AS $col => $txt) { |
|
| 224 | + $this->page = $currpage; |
|
| 225 | + $this->SetXY($l,$h); |
|
| 226 | 226 | |
| 227 | - if($col == 5) |
|
| 228 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
| 229 | - else |
|
| 230 | - $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
| 231 | - $l += $this->tablewidths[$col]; |
|
| 227 | + if($col == 5) |
|
| 228 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt,0,"R"); |
|
| 229 | + else |
|
| 230 | + $this->MultiCell($this->tablewidths[$col],$lineheight,$txt); |
|
| 231 | + $l += $this->tablewidths[$col]; |
|
| 232 | 232 | |
| 233 | - if(!isset($tmpheight[$row.'-'.$this->page])) |
|
| 234 | - $tmpheight[$row.'-'.$this->page] = 0; |
|
| 235 | - if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
| 236 | - $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
|
| 237 | - } |
|
| 238 | - if($this->page > $maxpage) |
|
| 239 | - $maxpage = $this->page; |
|
| 240 | - } |
|
| 233 | + if(!isset($tmpheight[$row.'-'.$this->page])) |
|
| 234 | + $tmpheight[$row.'-'.$this->page] = 0; |
|
| 235 | + if($tmpheight[$row.'-'.$this->page] < $this->GetY()) { |
|
| 236 | + $tmpheight[$row.'-'.$this->page] = $this->GetY(); |
|
| 237 | + } |
|
| 238 | + if($this->page > $maxpage) |
|
| 239 | + $maxpage = $this->page; |
|
| 240 | + } |
|
| 241 | 241 | |
| 242 | - // get the height we were in the last used page |
|
| 243 | - $h = $tmpheight[$row.'-'.$maxpage]; |
|
| 244 | - // set the "pointer" to the left margin |
|
| 245 | - $l = $this->lMargin; |
|
| 246 | - // set the $currpage to the last page |
|
| 247 | - $currpage = $maxpage; |
|
| 248 | - } |
|
| 249 | - // draw the borders |
|
| 250 | - // we start adding a horizontal line on the last page |
|
| 251 | - $this->page = $maxpage; |
|
| 252 | - $this->Line($l,$h,$fullwidth+$l,$h); |
|
| 253 | - // now we start at the top of the document and walk down |
|
| 254 | - for($i = $startpage; $i <= $maxpage; $i++) { |
|
| 255 | - $this->page = $i; |
|
| 256 | - $l = $this->lMargin; |
|
| 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) { |
|
| 261 | - $l += $width; |
|
| 262 | - $this->Line($l,$t,$l,$lh); |
|
| 263 | - } |
|
| 264 | - } |
|
| 265 | - // set it to the last page, if not it'll cause some problems |
|
| 266 | - $this->page = $maxpage; |
|
| 242 | + // get the height we were in the last used page |
|
| 243 | + $h = $tmpheight[$row.'-'.$maxpage]; |
|
| 244 | + // set the "pointer" to the left margin |
|
| 245 | + $l = $this->lMargin; |
|
| 246 | + // set the $currpage to the last page |
|
| 247 | + $currpage = $maxpage; |
|
| 248 | + } |
|
| 249 | + // draw the borders |
|
| 250 | + // we start adding a horizontal line on the last page |
|
| 251 | + $this->page = $maxpage; |
|
| 252 | + $this->Line($l,$h,$fullwidth+$l,$h); |
|
| 253 | + // now we start at the top of the document and walk down |
|
| 254 | + for($i = $startpage; $i <= $maxpage; $i++) { |
|
| 255 | + $this->page = $i; |
|
| 256 | + $l = $this->lMargin; |
|
| 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) { |
|
| 261 | + $l += $width; |
|
| 262 | + $this->Line($l,$t,$l,$lh); |
|
| 263 | + } |
|
| 264 | + } |
|
| 265 | + // set it to the last page, if not it'll cause some problems |
|
| 266 | + $this->page = $maxpage; |
|
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
@@ -77,11 +77,11 @@ |
||
| 77 | 77 | *******************************************************************************/ |
| 78 | 78 | function FPDF($props = array()) |
| 79 | 79 | {
|
| 80 | - if(count($props) == 3) |
|
| 81 | - {
|
|
| 82 | - list($orientation,$unit,$format) = $props; |
|
| 83 | - $this->initialize($orientation,$unit,$format); |
|
| 84 | - } |
|
| 80 | + if(count($props) == 3) |
|
| 81 | + {
|
|
| 82 | + list($orientation,$unit,$format) = $props; |
|
| 83 | + $this->initialize($orientation,$unit,$format); |
|
| 84 | + } |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | function initialize($orientation='P',$unit='mm',$size='A4') |