<?php
session_start();
$currentBaseDir = dirname($_SERVER['PHP_SELF']);
include($_SESSION['basedir']."core.php");

$svaTool = new svaTool();


$errorCode = 0;

$password = NULL;
$confPasswd = NULL;
// Ajout de nouvel utilisateur
if (isset($_REQUEST['paramId']) && strlen($_REQUEST['paramId']) > 0)
    $qosName = addslashes($_REQUEST['paramId']);
else
    $errorCode = 1;
	
	
if (isset($_REQUEST['paramValue']) && strlen($_REQUEST['paramValue']) > 0)
    $qosValue = addslashes($_REQUEST['paramValue']);
else
    $errorCode = 2;


    $qosDesc = addslashes($_REQUEST['desc']);




if ($errorCode == 0) {
$id =0;
$qosCode = "";

$res = $dba->UpdateAddSCCSystemParam(0, $id, $qosName, $qosValue, $qosDesc, $qosCode) ;

   //$errorCode = 10;
}




switch ($errorCode) {

    case 0 : $msg = "{ \"errorCode\": $errorCode,\"errorMessage\" :\"PARAMETRE CREE AVEC SUCCES !\"  }"; 
        break;
    case 1 : $msg = "{ \"errorCode\": $errorCode,\"errorMessage\" :\"ERREUR ! LE NOM DU PARAMETRE EST INVALIDE !\"  }";
        break;
    case 2 : $msg = "{ \"errorCode\": $errorCode,\"errorMessage\" :\"ERREUR ! VEUILLEZ SAISIR UNE VALEUR POUR CE PARAMETRE. !\"  }"; 
        break;
   
   
	 
}


echo $msg ;


?>