Projet

Général

Profil

Paste
Statistiques
| Branche: | Révision:

ryxeo-glpi-git / plugins / anet_epacks / front / plugin_anet_epacks.view2.php @ 97e94661

Historique | Voir | Annoter | Télécharger (1,04 ko)

1
<?php
2

    
3
if(!defined('GLPI_ROOT')){
4
  define('GLPI_ROOT', '../../..');
5
}
6
include_once (GLPI_ROOT . "/inc/includes.php");
7

    
8
//checkSeveralRightsOr(array("config" => "w", "profile" => "w"));
9
checkRight("config","w");
10

    
11
commonHeader("anet_epacks",$_SERVER['PHP_SELF'],"config","plugins");
12

    
13
print "<p>Liste des epacks attribués: <a href=\"" . $PHP_SELF . "\">Tous</a> - <a href=\"" . $PHP_SELF . "?year=2008\">2008</a> - <a href=\"" . $PHP_SELF . "?year=2009\">2009</a> - <a href=\"" . $PHP_SELF . "?year=2010\">2010</a> - <a href=\"" . $PHP_SELF . "?year=2011\">2011</a>.</p>";
14

    
15

    
16
global $DB;
17

    
18
$query="SELECT * from glpi_entities";
19
//print $query;
20
//$DB->query($query) or die($DB->error());
21
$result = $DB->query($query);
22

    
23
for($i = 0; $i < $DB->numrows($result); $i++) {
24
  $data=$DB->fetch_array($result);
25
  $level = substr_count($data['completename'],'>')+1;
26
  $id = $data['ID'];
27
  if($level != $data['level']) {
28
    $q2 = "UPDATE glpi_entities SET level='$level' WHERE ID='$id'";
29
    print $q2 . "<br>";
30
  }
31
  //$DB->query($q2) or die($DB->error());
32
}
33

    
34
commonFooter();
35
?>
Redmine Appliance - Powered by TurnKey Linux