Message: Undefined index: energy_tech
Display All
Source Code
- function get_req($id,$from = '-1',$req = 1){
- global $requeriments, $LNG, $USER, $PLANET, $resource, $n;
- //See if this item has requirements, if so give it space for the +/-
- if(is_array($requeriments[$id])){ $h = 55; }else{ $h = 46; }
- //See if we have met this requirement, get curent level
- $clevel = ($USER[$resource[$id]] * 1) + ($PLANET[$resource[$id]] * 1);
- //Have we beet the requirement?
- if($clevel >= $req){
- $colour = 'lime';
- $req_txt = $req;
- }else{
- $colour = 'red';
- $req_txt = $clevel.'/'.$req;
- }
- //Add the item to the subtree
- $get_req = "\t\t\t\t".'myTree.add('.$n.','.$from.',"<a><img src=\'styles/theme/gow/img/small/small_'.$id.'.jpg\' style=\'border:1px solid '.$colour.';\' /><span class=\'mrtooltip\' style=\'color:'.$colour.'\'>'.$req_txt.' - '.$LNG['tech'][$id].'</span></a>",46,'.$h.');'."\n";
- //Note this element then move onto the next.
- $from = $n; $n++;
- //If there are requirements.
- if(is_array($requeriments[$id])){
- //Then do the same for each of its requirements.
- foreach($requeriments[$id] as $nid => $req){
- $get_req .= get_req($nid,$from,$req);
- }
- }
- return $get_req;
- }