Skip to content
Snippets Groups Projects
Verified Commit e5b3d84a authored by David Beniamine's avatar David Beniamine
Browse files

Fix bad column alignment

parent ef0499dc
No related branches found
No related tags found
No related merge requests found
...@@ -107,23 +107,43 @@ if(!isset($action)){ ...@@ -107,23 +107,43 @@ if(!isset($action)){
$registry = array(); $registry = array();
foreach($lines as $line){ foreach($lines as $line){
if($line != ""){ if($line != ""){
$entry=explode(' ', $line); $entry=explode(' ', preg_replace("/\s\s+/", " ", $line));
$nb_infos=count($entry); $nb_infos=count($entry);
if($nb_infos < 2){ if($nb_infos < 2){
continue; continue;
} }
# Remove and shift lines with double IPS
if (filter_var($entry[4], FILTER_VALIDATE_IP, FILTER_FLAG_IPV4)) {
if ($entry[4] != $entry[3]) {
$entry[3] = $entry[3] . " ou ". $entry[4];
}
unset($entry[4]);
$entry=array_values($entry);
}
# Add aditionnal IPS to IP field
if ($nb_infos > 9) {
for($i=9 ; $i< $nb_infos; $i++) {
if ($entry[$i] != "NA" && strpos($entry[3], $entry[$i]) === false) {
$entry[3] .= " ou " . $entry[$i];
}
}
}
array_push($registry, $entry); array_push($registry, $entry);
# Format date mac name [num_apt_upgrade deb_version pt_version git_branch git_update] ip # Format
# 0 1 2 3 4 5 6 7 8
# date mac name "ip [ou ip2]" num_apt_upgrade deb_version pt_version git_branch git_update
echo "<tr>"; echo "<tr>";
# Name
echo "<td>".$entry[2]."</td>"; echo "<td>".$entry[2]."</td>";
echo "<td> ".$entry[$nb_infos-1]."</td>"; # IPs
echo "<td> ".$entry[3]."</td>";
# MAC
echo "<td>".$entry[1]."</td>"; echo "<td>".$entry[1]."</td>";
#echo "<td>".$entry[0]."</td>";
if($nb_infos > 5){ if($nb_infos > 5){
echo "<td>".$entry[5]."</td>";
echo "<td>".$entry[6]."</td>";
echo "<td>".$entry[4]."</td>"; echo "<td>".$entry[4]."</td>";
echo "<td>".str_replace('_', ' ', $entry[5])."</td>"; echo "<td> branche ".$entry[7].", ".$entry[8]." commits en retard</td>";
echo "<td>".$entry[3]."</td>";
echo "<td> branche ".$entry[6].", ".$entry[7]." commits en retard</td>";
}else{ }else{
echo "<td>NA</td>"; echo "<td>NA</td>";
echo "<td>NA</td>"; echo "<td>NA</td>";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment