MI6

Untitled

MI6
Feb 20th, 2013
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.68 KB | None | 0 0
  1.     function getScopeRanks($id) {
  2.         global $ministry;
  3.        
  4.         $i = GLOBAL_RANK_GRUNT;
  5.         $scope = $this->getScope($id);
  6.         $highest_rank = $this->getHighestRank($id);
  7.                
  8.         while($i > $highest_rank) {
  9.             foreach($scope as $dept=>$rank) {
  10.                 if($i == ($rank+1)) {
  11.                     echo $dept;
  12.                     $dept = $ministry->getMinistry($dept);
  13.                     $highest_rank_in[] = $dept['short_name'];
  14.                 }
  15.             }
  16.                
  17.             if($highest_rank_in) {
  18.                 $str .= " (Highest assignable rank in";
  19.                 foreach($highest_rank_in as $hr => $dept_name) {
  20.                     $str .= " $dept_name";
  21.                 }
  22.                 $str .= ")";
  23.             }
  24.        
  25.             $ranks[] = [
  26.                 "rank" => $i,
  27.                 "notes" => $str,
  28.             ];
  29.            
  30.             $i--;
  31.         }
  32.        
  33.         return $ranks;
  34.     }
Advertisement
Add Comment
Please, Sign In to add comment