This code takes an array from model and sorts it on two dimensions of the array.
$new_array = array();
foreach($this->items as $temp)
{
$new_array[] = array("id"=>$temp->id, "CoachName" => $temp->CoachName, "CoachEmail" => $temp->CoachEmail, "SkaterName"=>$temp->SkaterName, "SkaterScno"=>$temp->SkaterScno, "Test"=>$temp->Test, "Dance"=>$temp->Dance, "SheetName"=>$temp->SheetName, "Partner"=>$temp->Partner, "GoldChallenge"=>$temp->GoldChallenge, "ClubNumber"=>$temp->ClubNumber);
}
foreach($new_array as $key => $row)
{
$SheetName[$key] = $row['SheetName'];
$SkaterName[$key] = $row['SkaterName'];
}
array_multisort($SheetName, SORT_ASC, $new_array, $SkaterName, SORT_ASC, $new_array);