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 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
| <html>
<head>
</head>
<body>
<?php
include("fonctions.inc.php");
// --------------------------- \\
// ********* VARIABLES ********* \\
$semaine = $semChoix;
$anneeChoix = $_POST["zl_date_an"];
$semaine = "S".$semaine;
$annee = "A".$anneeChoix;
$date = date("Y-m-d");
$datedeb = date("Y-m-d H:i:s");
$res = array();
$ressource = array();
$tablesInd = array();
$tableIndEricsson = array();
$tableResEricsson = array();
$tableDateEricsson = array();
$indicateursEricsson = array();
$tableIndCisco = array();
$tableResCisco = array();
$tableDateCisco = array();
$indicateursCisco = array();
$nomIndEricsson = array('succGprsAttach','gprsMmSgsnUnsuccessfulAttachRequests','UnsuccAttachCC7.G','UnsuccAttachCC8.G','UnsuccAttachCC13.G','UnsuccAttachCC14.G','UnsuccAttachCC15.G','SuccActPdpContext.G','AttActPdpContext.G','UnsuccActPdpContextCC27_28.G','UnsuccActPdpContextCC29.G','UnsuccActPdpContextCC32_33.G');
$nomIndCisco = array('2G-attch-accept','2G-attach-reject','2G-gprs-service-not-allowed','2G-gprs-and-non-gprs-service-not-allowed','2G-roaming-not-allowed-in-this-location-area','2G-gprs-service-not-allowed-in-this-plmn','2G-no-suitable-cells-in-location-area','2G-total-actv-accept','2G-total-actv-req','2G-actv-rej-unknown-pdp-addr-type + 2G-actv-rej-missing-or-unknow-napn','2G-actv-rej-usr-auth-failed','2G-actv-rej-service-not-subscribed + 2G-actv-rej-service-not-supported');
$timeStampPremierJanvier = strtotime($anneeChoix . '-01-01');
$jourPremierJanvier = date('w', $timeStampPremierJanvier);
//-- recherche du N° de semaine du 1er janvier -------------------
$numSemainePremierJanvier = date('W', $timeStampPremierJanvier);
//-- nombre à ajouter en fonction du numéro précédent ------------
$decallage = ($numSemainePremierJanvier == 1) ? $semChoix - 1 : $semChoix;
//-- timestamp du jour dans la semaine recherchée ----------------
$timeStampDate = strtotime('+' . $decallage . ' weeks', $timeStampPremierJanvier);
//-- recherche du lundi de la semaine en fonction de la ligne précédente ---------
$jourDebutSemaine = ($jourPremierJanvier == 1) ? date('d-m-Y', $timeStampDate) : date('Y-m-d', strtotime('last monday', $timeStampDate));
$jourFinSemaine = ($jourPremierJanvier == 1) ? date('d-m-Y', $timeStampDate) : date('Y-m-d',strtotime('next sunday', $timeStampDate));
$datedeb = $jourDebutSemaine." 00:00:00";
$datefin = $jourFinSemaine." 23:59:00";
// -------------------------------------- \\
// ********* SELECTION DES TABLES ********* \\
$tables = mysql_query('show tables');
$res = mysql_fetch_array($tables);
if (!$res)
{
echo "La base de données est pour le moment inaccessible</p>";
print_r($bdd->errorInfo());
exit;
}
// --------------------------------------------------------------------------- \\
// ********* SELECTION DES TABLES indicateur_ ET DES RESSOURCES SEULES ********* \\
while ($line = mysql_fetch_array($tables))
{
if (preg_match('#^indicateur_(SG[0-9][a-zA-Z]+)_SGSN$#', $line[0],$matches))
{
$tablesInd[] = $matches[0];
$ressource[] = $matches[1];
/*echo "matches[0] = " . $matches[0] . "<br/>";
echo "matches[1] = " . $matches[1] . "<br/>";*/
}
}
print_r($tablesInd); //Array ( [0] => indicateur_SG1AUBE_SGSN [1] => indicateur_SG1BEAU_SGSN [2] => indicateur_SG1BLAN_SGSN...)
echo "<br>";
print_r($ressource); //Array ( [0] => SG1AUBE [1] => SG1BEAU [2] => SG1BLAN [3] => SG1KEN [4] => SG1LACA [5] => SG1MASS...)
echo "<br>";
// ---------------------------------------------- \\
// ********* TRI DES NODES / CONSTRUCTEUR ********* \\
for ($i = 0 ; $i < count($ressource) ; $i++)
{
$req2 = select_sql('Nodes','Constructeur','Node = "'.$ressource[$i].'"');
$req = mysql_query($req2);
$equip = mysql_result($req,0);
print_r($equip);
echo $equip;
print "equip ? $equip<br>";
if($equip == "ERICSSON")
{
$tableResEricsson[] = $ressource[i];
$tableIndEricsson[] = $tablesInd[i];
}
else
{
$tableResCisco[] = $ressource[i];
$tableIndCisco[] = $tablesInd[i];
}
} |
Partager