Issues (1369)

admin/adm_flying_fleets.php (3 issues)

1
<?php
2
3
/**
4
 * adm_flying_fleets.php
5
 *
6
 * @copyright 2014 by Gorlum for http://supernova.ws/
7
 */
8
9
use Fleet\DbFleetStatic;
10
11
define('INSIDE', true);
12
define('INSTALL', false);
13
define('IN_ADMIN', true);
14
require('../common.' . substr(strrchr(__FILE__, '.'), 1));
15
16
global $lang, $user;
17
18
SnTemplate::messageBoxAdminAccessDenied(AUTH_LEVEL_ADMINISTRATOR);
19
20
$template = SnTemplate::gettemplate('admin/adm_flying_fleets', true);
0 ignored issues
show
true of type true is incompatible with the type null|template expected by parameter $template of SnTemplate::gettemplate(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

20
$template = SnTemplate::gettemplate('admin/adm_flying_fleets', /** @scrutinizer ignore-type */ true);
Loading history...
21
22
//$FlyingFleets = db_fleet_list_all();
23
//while($CurrentFleet = db_fetch($FlyingFleets))
24
25
$all_flying_fleets = DbFleetStatic::db_fleet_list('', DB_SELECT_PLAIN);
26
foreach($all_flying_fleets as $fleet_id => $CurrentFleet) {
27
  $FleetOwner = db_user_by_id($CurrentFleet['fleet_owner']);
0 ignored issues
show
Deprecated Code introduced by
The function db_user_by_id() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

27
  $FleetOwner = /** @scrutinizer ignore-deprecated */ db_user_by_id($CurrentFleet['fleet_owner']);
Loading history...
28
  $TargetOwner = db_user_by_id($CurrentFleet['fleet_target_owner']);
0 ignored issues
show
Deprecated Code introduced by
The function db_user_by_id() has been deprecated. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-deprecated  annotation

28
  $TargetOwner = /** @scrutinizer ignore-deprecated */ db_user_by_id($CurrentFleet['fleet_target_owner']);
Loading history...
29
30
  $fleet_data = tpl_parse_fleet_db($CurrentFleet, ++$i, $FleetOwner);
31
  $fleet_data['fleet']['OWNER_NAME'] = htmlentities($FleetOwner['username'], ENT_COMPAT, 'UTF-8');
32
  $fleet_data['fleet']['TARGET_OWNER_NAME'] = htmlentities($TargetOwner['username'], ENT_COMPAT, 'UTF-8');
33
34
  $fleet_data['fleet']['STAY_TIME_INT'] = $CurrentFleet['fleet_end_stay'];
35
36
  $template->assign_block_vars('fleets', $fleet_data['fleet']);
37
  foreach($fleet_data['ships'] as $ship_data) {
38
    $template->assign_block_vars('fleets.ships', $ship_data);
39
  }
40
}
41
42
SnTemplate::display($template, $lang['flt_title']);
43