Community

In D7, display a Table using results from a Select made with Conditions from a Form inputted values

I would like to display, in a table, the results got from a Select made using, as conditions, some values inputted into an Ajax dependent dropdown form.

I’m able to have the form properly displayed and filled in (with confirmation of the values inputted) , but not to have the table displayed.

The code used to build the table, including Select with conditions, is working properly as a separated module.

Can anyone please help me (I attach some code)?

Thanks, Angelo

<?php

function mobilita_estrazione_dropdown_menu() {
$items = array();
$items['mobilita_estrazione_dropdown'] = array(
'title' => 'Modulo estrazione annuncio mobilita\'',
'page callback' => 'drupal_get_form',
'page arguments' => array('mobilita_estrazione_dropdown'),
'access callback' => TRUE,
);
return $items;
}

function mobilita_estrazione_dropdown_form() {
return drupal_get_form('mobilita_estrazione_dropdown');
}

function mobilita_estrazione_dropdown($form, &$form_state) {

//Here is the code to built the Ajax dropdown form

}

function mobilita_estrazione_dropdown_submit($form, &$form_state) {

// drupal_set_message …. Message with the confirmation of the values inputted

// Table construction

function mobilita_estrazione_dropdown_tabella() {
$items['mobilita_estrazione_dropdown_tabella'] = array(
'title' => 'Output table',
'description' => 'Show a page with a sortable table',
'page callback' => 'mobilita_estrazione_dropdown',
'access callback' => TRUE,
'file' => 'costruzione_tabella.inc',
// costruzione_tabella.inc is the file that contains the code to do the Select with conditions and to build //the table

);
return $items;
}

//Clean the form
$form_state['rebuild'] = TRUE;
}

// here are some functions called by the form to correctly populate the Ajax depentendent dropdown