[ 'page' => 1, 'template_page' => 1, 'coordinates' => [ 'x' => 516, 'y' => 149, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l1b' => [ 'page' => 1, 'template_page' => 1, 'coordinates' => [ 'x' => 446, 'y' => 160, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l1c' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL1C', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 446, 'y' => 172, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l1d' => [ 'page' => 1, 'template_page' => 1, 'coordinates' => [ 'x' => 446, 'y' => 189, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l1e' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL1E', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 446, 'y' => 206, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l1f' => [ 'page' => 1, 'template_page' => 1, 'coordinates' => [ 'x' => 446, 'y' => 223, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l1g' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL1G', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 516, 'y' => 234, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2a' => [ 'page' => 1, 'template_page' => 1, 'coordinates' => [ 'x' => 446, 'y' => 262, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2b' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL2B', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 446, 'y' => 278, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2c' => [ 'page' => 1, 'template_page' => 1, 'coordinates' => [ 'x' => 446, 'y' => 302, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2d' => [ 'page' => 1, 'template_page' => 1, 'coordinates' => [ 'x' => 446, 'y' => 319, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2e' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL2E', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 446, 'y' => 335, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2f' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL2F', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 446, 'y' => 346, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2g' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL2G', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 516, 'y' => 362, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], 'l2h' => [ 'page' => 1, 'template_page' => 1, 'function' => [ 'calc' => 'calcL2H', 'draw' => [ 'drawNormal' ] ], 'coordinates' => [ 'x' => 516, 'y' => 379, 'h' => 10, 'w' => 45, 'halign' => 'C', ], ], ]; if ( isset( $template_schema[$name] ) ) { return $name; } else { return $template_schema; } } function calcL1C( $value = null, $schema = null ) { $this->l1c = $this->MoneyFormat( bcmul( $this->l1b, $this->credit_percent ) ); if ( $this->l1c == 0 ) { $this->l1c = false; } return $this->l1c; } function calcL1E( $value = null, $schema = null ) { $this->l1e = $this->MoneyFormat( bcsub( $this->l1c, $this->l1d ) ); if ( $this->l1e == 0 ) { $this->l1e = false; } return $this->l1e; } function calcL1G( $value = null, $schema = null ) { $this->l1g = $this->MoneyFormat( bcadd( $this->l1e, $this->l1f ) ); if ( $this->l1g == 0 ) { $this->l1g = false; } return $this->l1g; } function calcL2B( $value = null, $schema = null ) { if ( $this->l1a > 0 ) { $this->l2b = $this->l1a; } elseif ( $this->l1g > 0 ) { $this->l2b = $this->l1g; } return $this->l2b; } function calcL2E( $value = null, $schema = null ) { $this->l2e = $this->MoneyFormat( bcadd( $this->l2c, $this->l2d ) ); if ( $this->l2e == 0 ) { $this->l2e = false; } return $this->l2e; } function calcL2F( $value = null, $schema = null ) { $this->l2f = $this->MoneyFormat( bcsub( $this->l2b, $this->l2e ) ); if ( $this->l2f == 0 ) { $this->l2f = false; } return $this->l2f; } function calcL2G( $value = null, $schema = null ) { $this->l2g = $this->MoneyFormat( min( $this->l2a, $this->l2f ) ); return $this->l2g; } function calcL2H( $value = null, $schema = null ) { $this->l2h = $this->MoneyFormat( bcsub( $this->l2a, $this->l2g ) ); return $this->l2h; } function _outputPDF( $type ) { //Initialize PDF with template. $pdf = $this->getPDFObject(); if ( $this->getShowBackground() == true ) { $pdf->setSourceFile( $this->getTemplateDirectory() . DIRECTORY_SEPARATOR . $this->pdf_template ); $this->template_index[1] = $pdf->ImportPage( 1 ); } if ( $this->year == '' ) { $this->year = $this->getYear(); } //Get location map, start looping over each variable and drawing $template_schema = $this->getTemplateSchema(); if ( is_array( $template_schema ) ) { $template_page = null; foreach ( $template_schema as $field => $schema ) { $this->Draw( $this->$field, $schema ); } } return true; } } ?>