Dropdown Menus

The dropdown feature allows a simple interface to join your reports under a single menu item. Just specify an array of the top level dropdown menus and specify the indivual items within. Currently, as in the example below, the menu items must point to reports al ready defined in a specified project.


<?php
          \Reportico\Engine\Builder
::build()
              ...
              ...
              ->
dropdownMenu(
                  [
                        [
                            
"project" => "tutorials",
                            
"title" => "First Dropmenu Title",
                            
"items" => array (
                                array ( 
"reportfile" => "stock.xml" ),
                                array ( 
"reportfile" => "suppliers.xml" ),
                                array ( 
"reportfile" => "customer.xml" ),
                                )
                            ],
                        [
                            
"project" => "tutorials",
                            
"title" => "Financial",
                            
"items" => array (
                                array ( 
"reportfile" => "orders.xml" ),
                                array ( 
"reportfile" => "salestotals.xml" ),
                                )
                            ],
                  ]
                )
                ...
                ...
                ->
menu(); or ->prepare();
    
?>
1




<?php

      
require_once(__DIR__ .'/../vendor/autoload.php');
      

      
\Reportico\Engine\Builder::build()
          ->
properties([ "bootstrap_preloaded" => true])
          ->
datasource()->database("mysql:host=localhost; dbname=DATABASE NAME")->user("USER")->password("PASSWORD")
          ->
title     ("Employee List")
          ->
description     ("Produces a list of our employees")
          ->
sql       ("
                SELECT EmployeeID employee_id, LastName last_name, FirstName first_name, date(BirthDate) birth_date, Country
                FROM northwind_employees
                WHERE 1 = 1
                ORDER BY Country, LastName
                "
)

          ->
accessLevel("ONEPROJECT")
          ->
dropdownMenu(
                    [
                    array ( 
                        
"project" => "tutorials",
                        
"title" => "Inventory",
                        
"items" => array (
                            
//array ( "reportfile" => "products.xml" ),
                            
array ( "reportfile" => "stock.xml" ),
                            array ( 
"reportfile" => "suppliers.xml" ),
                            array ( 
"reportfile" => "customer.xml" ),
                            )
                        ),
                    array ( 
                        
"project" => "tutorials",
                        
"title" => "Financial",
                        
"items" => array (
                            array ( 
"reportfile" => "orders.xml" ),
                            array ( 
"reportfile" => "salestotals.xml" ),
                            )
                        ),
                        ]
             )
          ->
prepare();
?>