2012 Drive-Thru Study: Customer Service

    Though the majority of units at each benchmark chain has at least "pleasant" service, there is plenty of room to grow in the customer experience.

    'asc', 'total_units' => 'asc', "vf_count" => 'asc', "vf_percent" => 'asc', "p_count" => 'asc', "p_percent" => 'asc', "a_count" => 'asc', "a_percent" => 'asc', "l_count" => 'asc', "l_percent" => 'asc', "r_count" => 'asc', "r_percent" => 'asc' ); $indicators = array( 'chain' => '', 'total_units' => '', "vf_count" => '', "vf_percent" => '', "p_count" => '', "p_percent" => '', "a_count" => '', "a_percent" => '', "l_count" => '', "l_percent" => '', "r_count" => '', "r_percent" => '' ); $header_fields = array( 'chain' => 'Chain', 'total_units' => 'Total Units', "vf_count" => 'Count', "vf_percent" => 'Percent', "p_count" => 'Count', "p_percent" => 'Percent', "a_count" => 'Count', "a_percent" => 'Percent', "l_count" => 'Count', "l_percent" => 'Percent', "r_count" => 'Count', "r_percent" => 'Percent' ); if ( in_array( $_GET['sort'], array_keys( $sort_dirs ) ) ) { $sort_field = $_GET['sort']; } else { $sort_field = 'chain'; } if ( in_array( $_GET['dir'], array( 'asc', 'desc' ) ) ) { $sort_dir = $_GET['dir']; } else { $sort_dir = 'asc'; } $opposite_dir = ( $sort_dir == 'asc' ) ? 'desc' : 'asc'; $sort_dirs[$sort_field] = $opposite_dir; $indicators[$sort_field] = theme_tablesort_indicator( array( 'style' => $sort_dir ) ); $header_cols = array(); foreach ( $header_fields as $field => $text ) { $header_cols[] = array( 'data' => l( $text, $_GET['q'], array( 'query' => array('sort' => $field , 'dir' => $sort_dirs[$field] ) , 'html' => TRUE ) ) . $indicators[$field], 'class' => 'header' ); } $table_rows = array(); $table_rows[] = array( array( 'data' => ' ', 'colspan' => 2 , 'class' => 'top-header'), array( 'data' => 'Very Friendly', 'colspan' => 2 , 'class' => 'top-header'), array( 'data' => 'Pleasant', 'colspan' => 2 , 'class' => 'top-header'), array( 'data' => 'Average', 'colspan' => 2 , 'class' => 'top-header'), array( 'data' => 'Lackadaisical / Mechanical', 'colspan' => 2 , 'class' => 'top-header'), array( 'data' => 'Rude', 'colspan' => 2 , 'class' => 'top-header'), ); $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 ); } foreach ( $values as $key => $value ) { $data_cells = array(); foreach ( $header_fields as $field => $text ) { $cell_data = $the_data[$key]->$field; if ( preg_match( '/percent/', $field ) ) { $cell_data .= '%'; } $classes = $field; if ( $field == $sort_field ) { $classes .= ' sorted'; } $data_cells[] = array( 'data' => $cell_data, 'class' => $classes ); } $sorted_data[] = $data_cells; } /* end of functional area */ foreach ( $sorted_data as $data_row ) { $table_rows[] = $data_row; } // summary $table_rows[] = array( array('data' => 'Summary','class' => 'total-row',), array('data' => '2,053','class' => 'total-row',), array('data' => '777','class' => 'total-row',), array('data' => '37.80%','class' => 'total-row',), array('data' => '767','class' => 'total-row',), array('data' => '389','class' => 'total-row',), array('data' => '18.90%','class' => 'total-row',), array('data' => '97','class' => 'total-row',), array('data' => '4.70%','class' => 'total-row',), array('data' => '23','class' => 'total-row',), array('data' => '1.10%','class' => 'total-row',), ); print theme( 'table', array( 'header' => NULL, 'rows' => $table_rows, 'attributes' => array( 'id' => 'datatable' ) ) ); ?>