public function sort_data()
{
// only do this if we have a default orderby
if (isset($this->orderby['default'])) {
$orderby = $this->orderby['default'];
foreach ($this->data as $k => $v) {
$sorter[$k] = strtolower($v[$orderby]);
}
if ($this->orderby_dir == 'ASC') {
asort($sorter);
} else {
arsort($sorter);
}
foreach ($sorter as $key => $val) {
$intermediary[] = $this->data[$key];
}
if (isset($intermediary)) {
$this->data = $intermediary;
$this->data_keys = array_keys($this->data);
}
}
}