<?php
$table_template = array(
'db' => array(
'from' => 'CASE_ALIGMENT_0',
'select' => array(
'YR' => FALSE,
'REFERENCE' => "upper(###)",
'DESCRIPTION' => "initcap(###)",
'SUPPLIER_LOWER' => "initcap(###)",
'COUNTRY_LOWER' => "upper(###)",
'AMOUNT_LOWER' => '###',
'SUPPLIER_ALIG' => "initcap(###)",
'COUNTRY_ALIG' => "upper(###)",
'AMOUNT_ALIG' => '###',
'DIFF_PERC' => '###',
'DIFF' => '###',
),
'where' => array(
'YR' => array('LIKE', "%" )
),
),
'filters' => array(
'year_min' => array(
'type' => 'year',
'description' => 'From year',
'where' => array(
'YR' => array( '>=', '2013' )
),
),
'year_max' => array(
'type' => 'year',
'description' => 'To year',
'where' => array(
'YR' => array( '<=', '2013' )
),
),
),
'dynamic' => TRUE,
'editable' => FALSE,
'number' => 6,
'title' => "Cases of alignment for contracts and orders<br><small>since 1994</small>",
'subtitle' => NULL,
// TODO: Build graph queries and use them
'graph' => NULL, // array('query' => "select YR, to_char(to_number(sum(AMOUNT_ALIG)), '999G999G999', 'NLS_NUMERIC_CHARACTERS = '', ''') from CASE_ALIGMENT_0 group by YR order by YR;"),
'headers' => array(
array(
'from_db' => FALSE,
'layout' => array(
array( 'colspan' => 2, 'class' => "text-center" ),
array( 'colspan' => 3, 'class' => "text-center border-left" ),
array( 'colspan' => 3, 'class' => "text-center border-left" ),
array( 'colspan' => 2, 'class' => "text-center border-left" ),
),
'data' => array(
"<h3>Enquiry</h3>",
"<h3>Lowest bid</h3>",
"<h3>Alignment</h3>",
"<h3>Difference</h3>",
),
),
array(
'from_db' => TRUE,
'layout' => array(
'REFERENCE' => array( 'class' => "text-center" ),
'DESCRIPTION' => array( 'class' => "text-center" ),
'SUPPLIER_LOWER' => array( 'class' => "text-center border-left" ),
'COUNTRY_LOWER' => array( 'class' => "text-center" ),
'AMOUNT_LOWER' => array( 'class' => "text-center" ),
'SUPPLIER_ALIG' => array( 'class' => "text-center border-left" ),
'COUNTRY_ALIG' => array( 'class' => "text-center" ),
'AMOUNT_ALIG' => array( 'class' => "text-center" ),
'DIFF_PERC' => array( 'class' => "text-center border-left" ),
'DIFF' => array( 'class' => "text-center" ),
),
'data' => array(
'REFERENCE' => "Reference",
'DESCRIPTION' => "Description",
'SUPPLIER_LOWER' => "Supplier",
'COUNTRY_LOWER' => "Country",
'AMOUNT_LOWER' => "Bid (CHF)",
'SUPPLIER_ALIG' => "Supplier",
'COUNTRY_ALIG' => "Country",
'AMOUNT_ALIG' => "Initial bid (CHF)",
'DIFF_PERC' => "%",
'DIFF' => "CHF",
),
),
),
'body' => array(
'layout' => array(
'REFERENCE' => array( 'class' => "no-wrap" ),
'DESCRIPTION' => array( 'class' => "text-min-width" ),
'SUPPLIER_LOWER' => array( 'class' => "border-left" ),
'COUNTRY_LOWER' => array( 'class' => 'no-wrap' ),
'AMOUNT_LOWER' => array( 'class' => "text-right no-wrap", 'data-format' => 'currency' ),
'SUPPLIER_ALIG' => array( 'class' => "border-left" ),
'COUNTRY_ALIG' => array( 'class' => 'no-wrap' ),
'AMOUNT_ALIG' => array( 'class' => "text-right no-wrap", 'data-format' => 'currency' ),
'DIFF_PERC' => array( 'class' => "text-right no-wrap border-left", 'data-format' => 'percentage' ),
'DIFF' => array( 'class' => "text-right no-wrap", 'data-format' => 'currency' ),
),
'format' => array(
'AMOUNT_LOWER' => array( 'format_french_number', 'format_no_decimals' ),
'AMOUNT_ALIG' => array( 'format_french_number', 'format_no_decimals' ),
'COUNTRY_LOWER' => 'format_line_break',
'COUNTRY_ALIG' => 'format_line_break',
'DIFF_PERC' => 'format_percent',
'DIFF' => array( 'format_french_number', 'format_no_decimals' ),
),
),
'footers' => array(
array(
'from_db' => TRUE,
'layout' => NULL,
'data' => array(
'REFERENCE' => "Reference",
'DESCRIPTION' => "Description",
'SUPPLIER_LOWER' => "Supplier",
'COUNTRY_LOWER' => "Country",
'AMOUNT_LOWER' => "Bid (CHF)",
'SUPPLIER_ALIG' => "Supplier",
'COUNTRY_ALIG' => "Country",
'AMOUNT_ALIG' => "Initial bid (CHF)",
'DIFF_PERC' => "%",
'DIFF' => "CHF",
),
),
),
);
echo json_encode($table_template);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename: /in/5sssJ
function name: (null)
number of ops: 6
compiled vars: !0 = $table_template
line #* E I O op fetch ext return operands
-------------------------------------------------------------------------------------
2 0 E > ASSIGN !0, <array>
130 1 INIT_FCALL 'json_encode'
2 SEND_VAR !0
3 DO_ICALL $2
4 ECHO $2
5 > RETURN 1
Generated using Vulcan Logic Dumper, using php 8.0.0
preferences:
157.76 ms | 1393 KiB | 15 Q