Exemplo n.º 1
0
         $typeMessage = "error";
     }
 } else {
     if ($action == "validate") {
         $idOperation = $_POST['idOperation'];
         $operation = $operationManager->getOperationById($idOperation);
         $contrat = $contratManager->getContratById($operation->idContrat());
         $client = $clientManager->getClientById($contrat->idClient());
         $projet = $projetManager->getProjetById($contrat->idProjet());
         $nomProjet = $projet->nom();
         $montant = $operation->montant();
         $observation = $operation->observation();
         $compteBancaire = $operation->compteBancaire();
         $modePaiement = $operation->modePaiement();
         $numeroOperation = $operation->numeroCheque();
         $operationManager->validate($idOperation, 1);
         //add History data
         $createdBy = $_SESSION['userMerlaTrav']->login();
         $created = date('Y-m-d h:i:s');
         $history = new History(array('action' => "Validation", 'target' => "Table des paiements clients", 'description' => "Validation d'une opération paiement client, pour " . ucfirst($client->nom()) . " d'un montant de {$montant} - N° Contrat : {$idContrat} - Projet : {$nomProjet} - N° Opération : {$numeroOperation} - Mode Paiement : {$modePaiement} - Compte Bancaire : {$compteBancaire} - Obersvation : {$observation}", 'created' => $created, 'createdBy' => $createdBy));
         //add it to db
         $historyManager->add($history);
         $actionMessage = "<strong>Opération Valide</strong> : Paiement client validé avec succès.";
         $typeMessage = "success";
     } else {
         if ($action == "cancel") {
             $idOperation = $_POST['idOperation'];
             $operation = $operationManager->getOperationById($idOperation);
             $contrat = $contratManager->getContratById($operation->idContrat());
             $client = $clientManager->getClientById($contrat->idClient());
             $projet = $projetManager->getProjetById($contrat->idProjet());