//Component Class Manager
$companyManager = new CompanyManager($pdo);
//Action Add Processing Begin
if ($action == "add") {
    if (!empty($_POST['nom'])) {
        $nom = htmlentities($_POST['nom']);
        $adresse = htmlentities($_POST['adresse']);
        $nomArabe = htmlentities($_POST['nomArabe']);
        $adresseArabe = htmlentities($_POST['adresseArabe']);
        $directeur = htmlentities($_POST['directeur']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        //create object
        $company = new Company(array('nom' => $nom, 'adresse' => $adresse, 'nomArabe' => $nomArabe, 'adresseArabe' => $adresseArabe, 'directeur' => $directeur, 'created' => $created, 'createdBy' => $createdBy));
        //add it to db
        $companyManager->add($company);
        $actionMessage = "Opération Valide : Company Ajouté(e) avec succès.";
        $typeMessage = "success";
    } else {
        $actionMessage = "Erreur Ajout company : Vous devez remplir le champ 'nom'.";
        $typeMessage = "error";
    }
} else {
    if ($action == "update") {
        $idCompany = htmlentities($_POST['idCompany']);
        if (!empty($_POST['nom'])) {
            $nom = htmlentities($_POST['nom']);
            $adresse = htmlentities($_POST['adresse']);
            $nomArabe = htmlentities($_POST['nomArabe']);
            $adresseArabe = htmlentities($_POST['adresseArabe']);
            $directeur = htmlentities($_POST['directeur']);