Customer Service by Daypart

    Operators say they staff their best employees earlier in the day, which might account for the breakfast category’s top rank in customer service.

    array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Daypart', ), 'vf_percent' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Percent', ), 'vf_count' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Count', ), 'p_percent' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Percent', ), 'p_count' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Count', ), 'a_percent' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Percent', ), 'a_count' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Count', ), 'l_percent' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Percent', ), 'l_count' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Count', ), 'r_percent' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Percent', ), 'r_count' => array( 'sort_dir' => 'asc', 'indicator' => '', 'label' => 'Count', ), ); if ( isset( $_GET['sort'] ) && in_array( $_GET['sort'], array_keys( $headers ) ) ) { $sort_field = $_GET['sort']; } else { $sort_field = 'day_part'; } 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[] = array( 'data' => array( array( 'data' => ' ', 'class' => 'header' ), array( 'data' => t( "Very Friendly" ), 'colspan' => 2, 'class' => 'header' ), array( 'data' => t( "Pleasant" ), 'colspan' => 2, 'class' => 'header' ), array( 'data' => t( "Average" ), 'colspan' => 2, 'class' => 'header' ), array( 'data' => t( "Lackadaisical/Mechanical" ), 'colspan' => 2, 'class' => 'header' ), array( 'data' => t( "Rude" ), 'colspan' => 2, 'class' => 'header' ), ), ); $table_rows[] = $header_cols; /* begin of function area */ $values = array(); foreach ( $the_data as $id => $value ) { $values[$id] = $value->$sort_field; } if ( $sort_field == 'day_part' ) { uasort( $values, function ( $a, $b ) { $v = array( 'breakfast' => 1, 'lunch' => 2, 'snack' => 3, 'dinner' => 4, 'late night' => 5, ); $an = $v[strtolower( $a )]; $bn = $v[strtolower( $b )]; return ( $an $value ) { $data_cells = array(); foreach ( $headers as $field => $field_data ) { $cell_data = $the_data[$key]->$field; if ( preg_match( '/_percent$/', $field ) ) { $cell_data = number_format( $cell_data, 1 ); $cell_data .= '%'; } $classes = $field; if ( $field == $sort_field ) { $classes .= ' sorted'; } if( $key == 5 ) { $classes .= ' total-row'; } $data_cells[] = array( 'data' => $cell_data, 'class' => $classes ); } if($key != 5) { $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