1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
|
<?php
mysql_connect("localhost", "root", ""); //log de connexion a serveur SQL
mysql_select_db("glpi"); //choix de la BDD
?>
<?php require('variable.php');?>
<b><font size=5, color=black>
<?php $nombre=0;
$lien_ocs=0;
$reponse = mysql_query("SELECT * FROM glpi_computers ORDER BY domain")or die(mysql_error()); //choix de la table
while ($donnees = mysql_fetch_array($reponse) ) //$donnees recupere toute les info de la table
{
?>
<?php require ('logiciel.php')?>
<?php if ( $antivirus != 1)
{
$nom_poste=$donnees['name'];
?>
<a href="http://srv-sherpa/glpi/front/computer.php?contains[0]=<?php echo $nom_poste;?>"><?php echo $nom_poste?></a><br />
</font>IP :<font color =#660099 >
<?php $lien_ocs = mysql_query('SELECT * FROM glpi_ocs_link where glpi_id=('.$donnees['ID'].')')or die(mysql_error());
while ($donnees_ocs = mysql_fetch_array($lien_ocs) )
{
//echo $donnees['ID'];
$ocs = $donnees_ocs['ocs_id'];
echo $ocs;
}
?>
<?php
mysql_connect("localhost", "root", ""); //log de connexion a serveur SQL
mysql_select_db("ocsweb"); //choix de la BDD
$ip = mysql_query('SELECT * FROM hardware where ID=('.$donnees_ocs['ocs_id'].')')or die (mysql_error()); //recherche le poste lorsque le nom est le meme sur les 2 BDD
while ($donnees_ip=mysql_fetch_array($ip))
{
$ip_ocs= $donnees_ip['IPADDR'];
echo $ip_ocs;
$nombre ++;
}
mysql_close();?>
<font color=red>
<br><?php
mysql_connect("localhost", "root", ""); //log de connexion a serveur SQL
mysql_select_db("glpi"); //choix de la BDD
if ($os_id !=5) // exclue les Mac pour la recherche d'antivirus
{
if ($antivirus == 2)
{
echo "Alerte : Il y a 2 antivirus sur ce poste<br />";
}
if ($antivirus == 0)
{
echo "Alerte : Il n y a pas d'antivirus<br />";
}
} ?></font><br />
<?php
}
}
mysql_close(); // Déconnexion de MySQL?> |