geilt

Sample

Oct 6th, 2014
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.43 KB | None | 0 0
  1.         if(!empty($args['top-first'])):
  2.             uasort($formatted, array($this, 'compare'));
  3.         else:
  4.             ksort($formatted);
  5.         endif;
  6.         return array('agents' => $formatted, 'dates' => $dates, 'totals' => $totals, 'colors' => $colors);
  7.     }
  8.     function compare($a, $b){
  9.         if ($a['sales'] == $b['sales']) {
  10.             return 0;
  11.         }
  12.         return ($a['sales'] > $b['sales']) ? -1 : 1;
  13.     }
Advertisement
Add Comment
Please, Sign In to add comment