<?php
require 'database.inc.php';
if (Test_User($lg_user, $lg_password) == TRUE) {
  $ligne = Commande::getCommandeByNoCommande($no_commande);
  $requette2 = "UPDATE commande" . ID_GARAGE . " SET IPClient='" . $_SERVER["REMOTE_ADDR"] . "' WHERE NoCommande=$no_commande";
  Connection::executeRawQuery($requette2);
  $requette3 = "SELECT Description FROM postes WHERE IP='" . $ligne["IPClient"] . "'";
  $resultat3 = Poste::getPostesByIP($ligne["IPClient"]);
  $num_rows3 = count($resultat3);
  if ($num_rows3 == 0) {
    echo $ligne["Version"] . ";" . $ligne["IPClient"] . ";Inconnu (" . $ligne["IPClient"] . ")";
  } else {
    $ligne3 = $resultat3[0];
    echo $ligne["Version"] . ";" . $ligne["IPClient"] . ";" . $ligne3["Description"];
  }
}
