The fastest speed times have increased from Wendy’s 134.1 seconds in 2009 to 145.5 seconds by the same company this year.
Click the header rows to sort the data.
'Chain', 'avg_seconds' => 'Average in seconds', 'Count' => 'Count', 'avg_number_vehicles' => 'Average number of vehicles', ); $sort_whitelist = array( 'Chain', 'avg_seconds' ); $header = json_decode( $header_json ); $data = json_decode( $data_json, TRUE ); $sort_field = 'Chain'; if ( isset( $_GET['sort'] ) && in_array( $_GET['sort'], $sort_whitelist ) ) { $sort_field = $_GET['sort']; } $sort_dir = 'asc'; if ( isset( $_GET['dir'] ) && in_array( $_GET['dir'], array( 'desc', 'asc' ) ) ) { $sort_dir = $_GET['dir']; } $header_row_data = array(); foreach ( $header as $field ) { $sort_indicator = ''; $dest_dir = 'asc'; if ( $sort_field == $field ) { $sort_indicator = theme_tablesort_indicator( array( 'style' => $sort_dir ) ); if ( $sort_dir == 'asc' ) { $dest_dir = 'desc'; } } if ( in_array( $field, $sort_whitelist ) ) { $header_row_data[] = array( 'data' => l( $full_headers[$field], $_GET['q'], array( 'query' => array( 'sort' => $field, 'dir' => $dest_dir), 'html' => TRUE ) ) . $sort_indicator, 'class' => 'top-header', ); } else { $header_row_data[] = array( 'data' => $full_headers[$field], 'class' => 'top-header' ); } } $table_rows = array(); $table_rows[] = $header_row_data; $sorted_rows = array(); $values = array(); foreach ( $data as $id => $value ) { $values[$id] = $value[$sort_field]; } if ( $sort_dir == 'asc' ) { asort( $values ); } else { arsort( $values ); } foreach ( $values as $key => $value ) { $row_cells = array(); foreach ( $header as $sort_field ) { $class = 'data'; if ( $sort_field == 'Chain' ) { $class = 'company'; } $row_cells[] = array( 'data' => $data[$key][$sort_field], 'class' => $class ); } $sorted_rows[] = $row_cells; } foreach ( $sorted_rows as $data_row ) { $table_rows[] = $data_row; } $table_rows[] = array( array('data' => 'Summary','class' => 'total-row',), array('data' => '166.3','class' => 'total-row',), array('data' => '2,002','class' => 'total-row',), array('data' => '2.3','class' => 'total-row',), ); // ,{"Chain":"Summary","Count":"2002","avg_seconds":"166.3","avg_number_vehicles":"2.3"} print theme( 'table', array( 'header' => NULL, 'rows' => $table_rows, 'attributes' => array( 'id' => 'datatable' ) ) ); /* * this is a support function to sort the data based on the field & direction. * it returns an array that's used for the table row function get_2011_dt_ast_chart_sorted_rows( $data, $field, $dir, $header ) { $sorted_rows = array(); $values = array(); foreach ( $data as $id => $value ) { $values[$id] = $value[$field]; } if ( $dir == 'asc' ) { asort( $values ); } else { arsort( $values ); } foreach ( $values as $key => $value ) { $row_cells = array(); foreach ( $header as $field ) { $class = 'data'; if ( $field == 'Chain' ) { $class = 'company'; } $row_cells[] = array( 'data' => $data[$key][$field], 'class' => $class ); } $sorted_rows[] = $row_cells; } return $sorted_rows; } */ ?>Drive-Thru Benchmarks