//$idClient = $_POST['idClient'];
            //$clientManager->delete($idClient);
            //add history data to db
            /*$createdBy = $_SESSION['userMerlaTrav']->login();
              $created = date('Y-m-d h:i:s');
              $history = new History(array(
                  'action' => "Activation",
                  'target' => "Table des contrats",
                  'description' => "Activer un contrat",
                  'created' => $created,
                  'createdBy' => $createdBy
              ));
              //add it to db
              $historyManager->add($history);*/
            $actionMessage = "<strong>Opération Valide : </strong>Client Supprimé(e) avec succès.";
            $typeMessage = "success";
            $redirectLink = "Location:../clients-list.php";
        } else {
            if ($action == "search") {
                $clientName = htmlentities($_POST['clientName']);
                $_SESSION['searchClientResult'] = $clientManager->getClientBySearch($clientName, 1);
                //$actionMessage = "<strong>Opération Valide : </strong>Client Supprimé(e) avec succès.";
                //$typeMessage = "success";
                $redirectLink = "Location:../clients-search.php";
            }
        }
    }
}
$_SESSION['client-action-message'] = $actionMessage;
$_SESSION['client-type-message'] = $typeMessage;
header($redirectLink);
{
    if (file_exists('../model/' . $myClass . '.php')) {
        include '../model/' . $myClass . '.php';
    } elseif (file_exists('../controller/' . $myClass . '.php')) {
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
//post input processing
if (!empty($_POST['searchOption']) and !empty($_POST['search'])) {
    $testRadio = 0;
    if (isset($_POST['searchOption'])) {
        if ($_POST['searchOption'] == "searchByName") {
            $testRadio = 1;
        } else {
            if ($_POST['searchOption'] == "searchByCIN") {
                $testRadio = 2;
            }
        }
    }
    $recherche = htmlentities($_POST['search']);
    $clientManager = new ClientManager($pdo);
    $_SESSION['searchClientResult'] = $clientManager->getClientBySearch($recherche, $testRadio);
    header('Location:../clients-search.php');
} else {
    $_SESSION['client-search-error'] = "<strong>Erreur Recherche Client</strong> : Vous devez séléctionner un choix 'Nom' ou 'CIN' \n        et 'Tapez votre recherche'";
    header('Location:../clients-search.php');
}