Suggestive Sells by Menu Category

    Suggestive sells appear to be more consistently used across the categories than last year, when the difference between high and low was 14 percent.

    array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Menu Category', ), 'percent_offered' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Percent Offered', ), 'count_offered' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Count Offered', ), ); if ( isset( $_GET['sort'] ) && in_array( $_GET['sort'], array_keys( $headers ) ) ) { $sort_field = $_GET['sort']; } else { $sort_field = 'menu_category'; } if ( isset( $_GET['dir'] ) && in_array( $_GET['dir'], array( 'asc', 'desc' ) ) ) { $sort_dir = $_GET['dir']; } else { $sort_dir = 'asc'; } $opposite_dir = ( $sort_dir == 'asc' ) ? 'desc' : 'asc'; $headers[$sort_field]['sort_dir'] = $opposite_dir; $headers[$sort_field]['indicator'] = theme_tablesort_indicator( array( 'style' => $sort_dir ) ); $header_cols = array(); foreach ( $headers as $field => $field_data ) { $header_cols[] = array( 'data' => l( $field_data['label'], $_GET['q'], array( 'query' => array( 'sort' => $field, 'dir' => $field_data['sort_dir'] ) ) ) . $field_data['indicator'], 'class' => 'header', ); } $table_rows = array(); $table_rows[] = $header_cols; /* begin of function area */ $sorted_data = array(); $values = array(); foreach ( $the_data as $id => $value ) { $values[$id] = $value->$sort_field; } if ( $sort_dir == 'asc' ) { asort( $values ); } else { arsort( $values ); } $sum = array(); foreach ( $values as $key => $value ) { $data_cells = array(); foreach ( $headers as $field => $field_data ) { $cell_data = $the_data[$key]->$field; if ( $field == 'count_offered' ) { $cell_data = number_format( $cell_data ); } if ( $field == 'percent_offered' ) { $cell_data = number_format( $cell_data, 1 ) . '%'; } $classes = $field; if ( $field == $sort_field ) { $classes .= ' sorted'; } if( $key == 3 ) { $classes .= ' total-row'; } $data_cells[] = array( 'data' => $cell_data, 'class' => $classes ); } if($key != 3) { $table_rows[] = $data_cells; } else { $sum = $data_cells; } } $table_rows[] = $sum; /* end of functional area */ print theme( 'table', array( 'header' => array(), 'rows' => $table_rows, 'attributes' => array( 'id' => 'datatable' ) ) ); ?>
    SPONSORED BY