/**
  * @name operationAttenteFerme($pTypePaiement)
  * @return array(OperationDetailVO) ou false en erreur
  * @desc Retourne l'ensemble des opérations des fermes non pointées
  */
 public static function operationAttenteFerme($pTypePaiement)
 {
     // Initialisation du Logger
     $lLogger =& Log::singleton('file', CHEMIN_FICHIER_LOGS);
     $lLogger->setMask(Log::MAX(LOG_LEVEL));
     $lRequete = "SELECT " . FermeManager::CHAMP_FERME_ID . "," . FermeManager::CHAMP_FERME_NUMERO . "," . FermeManager::CHAMP_FERME_NOM . "," . CompteManager::CHAMP_COMPTE_LABEL . "," . CompteManager::CHAMP_COMPTE_SOLDE . "," . OperationManager::CHAMP_OPERATION_MONTANT . "," . OperationManager::CHAMP_OPERATION_TYPE_PAIEMENT . "," . OperationManager::CHAMP_OPERATION_DATE . "," . OperationManager::CHAMP_OPERATION_LIBELLE . "," . OperationManager::CHAMP_OPERATION_ID . "," . OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_CHCP_ID . "," . OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_VALEUR . "," . OperationRemiseChequeManager::CHAMP_OPERATIONREMISECHEQUE_ID_REMISE_CHEQUE . ',' . RemiseChequeManager::CHAMP_REMISECHEQUE_NUMERO . "\n\t\tFROM " . OperationManager::TABLE_OPERATION . "\n\t\tJOIN " . CompteManager::TABLE_COMPTE . " ON " . CompteManager::CHAMP_COMPTE_ID . " = " . OperationManager::CHAMP_OPERATION_ID_COMPTE . "\n\t\tJOIN " . FermeManager::TABLE_FERME . " ON " . FermeManager::CHAMP_FERME_ID_COMPTE . " = " . OperationManager::CHAMP_OPERATION_ID_COMPTE . "\n\t\tLEFT JOIN  " . OperationChampComplementaireManager::TABLE_OPERATIONCHAMPCOMPLEMENTAIRE . "\n\t\t\tON " . OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_OPE_ID . " = " . OperationManager::CHAMP_OPERATION_ID . "\n\t\tLEFT JOIN " . OperationRemiseChequeManager::TABLE_OPERATIONREMISECHEQUE . " \n\t\t\tON " . OperationRemiseChequeManager::CHAMP_OPERATIONREMISECHEQUE_ID_OPERATION . " = " . OperationManager::CHAMP_OPERATION_ID . "\n\t\t\tAND " . OperationRemiseChequeManager::CHAMP_OPERATIONREMISECHEQUE_ETAT . " = 0\n\t\tLEFT JOIN " . RemiseChequeManager::TABLE_REMISECHEQUE . "\n\t\t\tON " . OperationRemiseChequeManager::CHAMP_OPERATIONREMISECHEQUE_ID_REMISE_CHEQUE . " = " . RemiseChequeManager::CHAMP_REMISECHEQUE_ID . "\n\t\tWHERE " . OperationManager::CHAMP_OPERATION_TYPE . " = 0\n\t\t\tAND " . OperationManager::CHAMP_OPERATION_TYPE_PAIEMENT . " in (1,2)\n\t\t\tAND " . OperationManager::CHAMP_OPERATION_TYPE_PAIEMENT . " = '" . StringUtils::securiser($pTypePaiement) . "'\n\t\tORDER BY " . OperationManager::CHAMP_OPERATION_DATE . ";";
     $lLogger->log("Execution de la requete : " . $lRequete, PEAR_LOG_DEBUG);
     // Maj des logs
     $lSql = Dbutils::executerRequete($lRequete);
     $lListeOperationAttente = array();
     if (mysql_num_rows($lSql) > 0) {
         $lOpeId = NULL;
         $lChampComplementaire = array();
         while ($lLigne = mysql_fetch_assoc($lSql)) {
             if ($lOpeId != $lLigne[OperationManager::CHAMP_OPERATION_ID]) {
                 if (!is_null($lOpeId)) {
                     $lOperationAttente->setOpeTypePaiementChampComplementaire($lChampComplementaire);
                     $lListeOperationAttente[$lOpeId] = $lOperationAttente;
                 }
                 $lOpeId = $lLigne[OperationManager::CHAMP_OPERATION_ID];
                 $lOperationAttente = OperationManager::remplirOperationAttenteFermeEntete($lLigne[FermeManager::CHAMP_FERME_ID], $lLigne[FermeManager::CHAMP_FERME_NUMERO], $lLigne[FermeManager::CHAMP_FERME_NOM], $lLigne[CompteManager::CHAMP_COMPTE_LABEL], $lLigne[CompteManager::CHAMP_COMPTE_SOLDE], $lLigne[OperationManager::CHAMP_OPERATION_MONTANT], $lLigne[OperationManager::CHAMP_OPERATION_TYPE_PAIEMENT], $lLigne[OperationManager::CHAMP_OPERATION_DATE], $lLigne[OperationManager::CHAMP_OPERATION_LIBELLE], $lLigne[OperationManager::CHAMP_OPERATION_ID], $lLigne[OperationRemiseChequeManager::CHAMP_OPERATIONREMISECHEQUE_ID_REMISE_CHEQUE], $lLigne[RemiseChequeManager::CHAMP_REMISECHEQUE_NUMERO]);
             }
             if (!is_null($lLigne[OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_CHCP_ID])) {
                 $lChampComplementaire[$lLigne[OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_CHCP_ID]] = OperationManager::remplirOperationDetail(NULL, NULL, NULL, NULL, NULL, $lLigne[OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_CHCP_ID], NULL, NULL, NULL, $lLigne[OperationManager::CHAMP_OPERATION_ID], $lLigne[OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_VALEUR]);
             }
         }
         $lOperationAttente->setOpeTypePaiementChampComplementaire($lChampComplementaire);
         $lListeOperationAttente[$lOpeId] = $lOperationAttente;
     } else {
         $lListeOperationAttente[0] = new OperationAttenteFermeVO();
     }
     return $lListeOperationAttente;
 }
 /**
  * @name getListeChequeCaisse($pIdMarche)
  * @return array(OperationAttenteAdherentVO)
  * @desc Récupères toutes les opérations chèque du marché et les renvoie sous forme d'une collection de OperationAttenteAdherentVO
  */
 public static function getListeChequeCaisse($pIdMarche)
 {
     return OperationManager::operationMarche($pIdMarche, 2);
 }
<?php

//classes loading begin
function classLoad($myClass)
{
    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
$idContrat = $_POST['idContrat'];
$idProjet = $_POST['idProjet'];
if (!empty($_POST['dateOperation']) && !empty($_POST['montant'])) {
    $idOperation = $_POST['idOperation'];
    $dateOperation = htmlentities($_POST['dateOperation']);
    $montant = htmlentities($_POST['montant']);
    $operation = new Operation(array('id' => $idOperation, 'date' => $dateOperation, 'montant' => $montant));
    $operationsManager = new OperationManager($pdo);
    $operationsManager->update($operation);
    $_SESSION['operation-update-success'] = "<strong>Opération valide : </strong>Opération modifiée avec succès.";
    header('Location:../operations.php?idContrat=' . $idContrat . '&idProjet=' . $idProjet);
} else {
    $_SESSION['operation-update-error'] = "<strong>Erreur modification opération : </strong>Vous devez remplir les champs 'Date opération' et 'Montant'.";
    header('Location:../operations.php?idContrat=' . $idContrat . '&idProjet=' . $idProjet);
}
Пример #4
0
 /**
  * @name selectOperationAchat($pIdCompte, $pIdMarche)
  * @param int(11) IdCompte
  * @param int(11) IdMarche
  * @return array(OperationVO)
  * @desc Retourne une liste d'operation
  */
 public function selectOperationAchat($pIdCompte, $pIdMarche)
 {
     return OperationManager::selectOperationAchat($pIdCompte, $pIdMarche);
 }
    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();
if (isset($_SESSION['userMerlaTrav']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    //classes managers
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $operationManager = new OperationManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    //classes and attributes
    $bien = "";
    $idOperation = $_GET['idOperation'];
    $operation = $operationManager->getOperationById($idOperation);
    $contrat = $contratManager->getContratById($operation->idContrat());
    $client = $clientManager->getClientById($contrat->idClient());
    $projet = $projetManager->getProjetById($contrat->idProjet());
    $typeBien = "";
    $etage = "";
    $expressionOrthographe = "";
    if ($contrat->typeBien() == "appartement") {
        $bien = $appartementManager->getAppartementById($contrat->idBien());
        $typeBien = "Appartement";
Пример #6
0
        }
        elseif(file_exists('controller/'.$myClass.'.php')){
            include('controller/'.$myClass.'.php');
        }
    }
    spl_autoload_register("classLoad"); 
    include('config.php');  
    include('lib/pagination.php');
    //classes loading end
    session_start();
    if( isset($_SESSION['userMerlaTrav']) ){
        //classes
        $projetManager = new ProjetManager($pdo);
        $clientManager = new ClientManager($pdo);
        $contratManager = new ContratManager($pdo);
        $operationManager = new OperationManager($pdo);
        $compteBancaireManager = new CompteBancaireManager($pdo);
        //objs
        $operations =$operationManager->getOpenOperationsGroupByMonth();
        $operationsNonValidees = $operationManager->getOperationsNonValidees();
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>ImmoERP - Management Application</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
Пример #7
0
 /**
  * @name rechercheListeFacture()
  * @return array(FactureVO)
  * @desc Retourne une liste de Facture
  */
 public function rechercheListeFacture($pDateDebut = null, $pDateFin = null, $pIdMarche = null)
 {
     $lTypeRecherche = array();
     $lTypeCritere = array();
     $lCritereRecherche = array();
     if (!is_null($pDateDebut)) {
         array_push($lTypeRecherche, OperationManager::CHAMP_OPERATION_DATE);
         array_push($lTypeCritere, '>=');
         array_push($lCritereRecherche, $pDateDebut);
     }
     if (!is_null($pDateFin)) {
         array_push($lTypeRecherche, OperationManager::CHAMP_OPERATION_DATE);
         array_push($lTypeCritere, '<=');
         array_push($lCritereRecherche, $pDateFin);
     }
     if (!is_null($pIdMarche)) {
         array_push($lTypeRecherche, 'marche.' . OperationChampComplementaireManager::CHAMP_OPERATIONCHAMPCOMPLEMENTAIRE_VALEUR);
         array_push($lTypeCritere, '=');
         if ($pIdMarche == -1) {
             // Pour les factures hors marché
             array_push($lCritereRecherche, NULL);
         } else {
             array_push($lCritereRecherche, $pIdMarche);
         }
     }
     return OperationManager::rechercheListeFacture($lTypeRecherche, $lTypeCritere, $lCritereRecherche, array(''), array(''));
 }
Пример #8
0
 include('config.php');  
 include('lib/pagination.php');
 //classes loading end
 session_start();
 if( isset($_SESSION['userMerlaTrav']) ) {
     if( isset($_GET['idProjet']) ){
        $idProjet = $_GET['idProjet'];   
     }
     //destroy contrat-form-data session
     if ( isset($_SESSION['contrat-form-data']) ) {
         unset($_SESSION['contrat-form-data']);
     }
     $projetManager = new ProjetManager($pdo);
     $clientManager = new ClientManager($pdo);
     $contratManager = new ContratManager($pdo);
     $operationManager = new OperationManager($pdo);
     $compteBancaireManager = new CompteBancaireManager($pdo);
     
     /*$codeContrat = $_GET['codeContrat'];
     $comptesBancaires = $compteBancaireManager->getCompteBancaires();
     $contrat = $contratManager->getContratByCode($codeContrat);
     
     
     $projet = $projetManager->getProjetById($contrat->idProjet());
     $client = $clientManager->getClientById($contrat->idClient());
     $sommeOperations = $operationManager->sommeOperations($contrat->id());
     $biens = "";
     $niveau = "";
     if($contrat->typeBien()=="appartement"){
         $appartementManager = new AppartementManager($pdo);
         $biens = $appartementManager->getAppartementById($contrat->idBien());
Пример #9
0
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //les sources
    $idProjet = 0;
    $projetManager = new ProjetManager($pdo);
    $contratManager = new ContratManager($pdo);
    if (isset($_GET['idProjet']) and $_GET['idProjet'] > 0 and $_GET['idProjet'] <= $projetManager->getLastId() and (isset($_GET['idContrat']) and ($_GET['idContrat'] > 0 and $_GET['idContrat'] <= $contratManager->getLastId()))) {
        $idProjet = $_GET['idProjet'];
        $idContrat = $_GET['idContrat'];
        $projet = $projetManager->getProjetById($idProjet);
        $contrat = $contratManager->getContratById($idContrat);
        $operationManager = new OperationManager($pdo);
        $operations = "";
        //test the locaux object number: if exists get operations else do nothing
        $operationsNumber = $operationManager->getOpertaionsNumberByIdContrat($idContrat);
        if ($operationsNumber != 0) {
            $operations = $operationManager->getOperationsByIdContrat($idContrat);
        }
    }
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
Пример #10
0
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav']) and isset($_GET['idProjet'])) {
    //classes managers
    $usersManager = new UserManager($pdo);
    $mailsManager = new MailManager($pdo);
    $notesClientsManager = new NotesClientManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $contratManager = new ContratManager($pdo);
    $clientManager = new ClientManager($pdo);
    $livraisonsManager = new LivraisonManager($pdo);
    $fournisseursManager = new FournisseurManager($pdo);
    $reglementsFournisseurManager = new ReglementFournisseurManager($pdo);
    $caisseEntreesManager = new CaisseEntreesManager($pdo);
    $caisseSortiesManager = new CaisseSortiesManager($pdo);
    $operationsManager = new OperationManager($pdo);
    //classes and vars
    $idProjet = $_GET['idProjet'];
    $projet = $projetManager->getProjetById($idProjet);
    //users number
    $usersNumber = $usersManager->getUsersNumber();
    $mailsNumberToday = $mailsManager->getMailsNumberToday();
    $mailsToday = $mailsManager->getMailsToday();
    $clientWeek = $clientManager->getClientsWeek();
    $clientNumberWeek = $clientManager->getClientsNumberWeek();
    $livraisonsWeek = $livraisonsManager->getLivraisonsWeek();
    $livraisonsNumberWeek = $livraisonsManager->getLivraisonsNumberWeek();
    $operationsNumberWeek = $operationsManager->getOperationNumberWeek();
    //get contacts ids and get sum of client operations
    $idsContrats = $contratManager->getContratIdsByIdProjet($_GET['idProjet']);
    $sommeOperationsClients = 0;
 //This variable projetContrat defines the actions choosed by the user : Ignorer || a Project
 $projetContrat = htmlentities($_POST['projet-contrat']);
 $montant = htmlentities($_POST['montant']);
 $dateOperation = htmlentities($_POST['dateOperation']);
 $dateReglement = htmlentities($_POST['dateReglement']);
 $dateOperation = DateTime::createFromFormat('d/m/Y', trim($dateOperation));
 $dateReglement = DateTime::createFromFormat('d/m/Y', trim($dateReglement));
 $dateOperation = $dateOperation->format('Y-m-d');
 $dateReglement = $dateReglement->format('Y-m-d');
 //$designation = htmlentities($_POST['designation']);
 if ($projetContrat == "Ignorer") {
     $releveBancaireManager->delete($idReleveBancaire);
     $actionMessage = "<strong>Opération Valide</strong> : Releve Bancaire traité avec succès.";
     $typeMessage = "success";
 } else {
     $operationManager = new OperationManager($pdo);
     //$reference = 'Q'.date('Ymd-his');
     $reference = htmlentities($_POST['reference']);
     $modePaiement = htmlentities($_POST['mode-paiement']);
     $numeroOperation = htmlentities($_POST['reference']);
     $compteBancaire = htmlentities($_POST['compte-bancaire']);
     $status = 1;
     //$observation ="Ce réglement client fait référence à la ligne : ".$idReleveBancaire." du relevé bancaire du compte bancaire : ".$compteBancaire;
     $observation = htmlentities($_POST['observation']);
     $idContrat = htmlentities($_POST['contrat-client']);
     $updatedBy = $_SESSION['userMerlaTrav']->login();
     $updated = date('Y-m-d h:i:s');
     //echo $_POST['idOperation'];
     if (isset($_POST['idOperation'])) {
         $idOperation = $_POST['idOperation'];
         $operation = new Operation(array('id' => $idOperation, 'date' => $dateOperation, 'dateReglement' => $dateReglement, 'status' => $status, 'montant' => $montant, 'compteBancaire' => $compteBancaire, 'observation' => $observation, 'reference' => $reference, 'modePaiement' => $modePaiement, 'numeroCheque' => $numeroOperation, 'updatedBy' => $updatedBy, 'updated' => $updated));
<?php

//classes loading begin
function classLoad($myClass)
{
    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
$idProjet = $_POST['idProjet'];
$idContrat = $_POST['idContrat'];
$idOperation = $_POST['idOperation'];
$operationManager = new OperationManager($pdo);
$operationManager->delete($idOperation);
$_SESSION['operation-delete-success'] = "<strong>Opération valide : </strong>Opération supprimée avec succès.";
header('Location:../operations.php?idContrat=' . $idContrat . '&idProjet=' . $idProjet);
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    if (isset($_GET['idProjet'])) {
        $idProjet = $_GET['idProjet'];
    }
    //destroy contrat-form-data session
    if (isset($_SESSION['contrat-form-data'])) {
        unset($_SESSION['contrat-form-data']);
    }
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $compteBancaireManager = new CompteBancaireManager($pdo);
    /*$codeContrat = $_GET['codeContrat'];
      $comptesBancaires = $compteBancaireManager->getCompteBancaires();
      $contrat = $contratManager->getContratByCode($codeContrat);
      
      
      $projet = $projetManager->getProjetById($contrat->idProjet());
      $client = $clientManager->getClientById($contrat->idClient());
      $sommeOperations = $operationManager->sommeOperations($contrat->id());
      $biens = "";
      $niveau = "";
      if($contrat->typeBien()=="appartement"){
          $appartementManager = new AppartementManager($pdo);
          $biens = $appartementManager->getAppartementById($contrat->idBien());
          $niveau = $biens->niveau();
 /**
  * @name remplirAdherent($pId,  $pNumero, $pIdCompte, $pNom, $pPrenom, $pCourrielPrincipal, $pCourrielSecondaire, $pTelephonePrincipal, $pTelephoneSecondaire, $pAdresse, $pCodePostal, $pVille, $pDateNaissance, $pDateAdhesion, $pDateMaj, $pCommentaire)
  * @param integer
  * @param string
  * @param integer
  * @param string
  * @param string
  * @param string
  * @param string
  * @param string
  * @param string
  * @param string
  * @param string
  * @param string
  * @param date
  * @param date
  * @param date
  * @param string
  * @return AdherentSoldeVO
  * @desc Retourne un AdherentSoldeVO remplis
  */
 private static function remplirAdherent($pId, $pNumero, $pIdCompte, $pNom, $pPrenom, $pCourrielPrincipal, $pCourrielSecondaire, $pTelephonePrincipal, $pTelephoneSecondaire, $pAdresse, $pCodePostal, $pVille, $pDateNaissance, $pDateAdhesion, $pDateMaj, $pCommentaire)
 {
     $lAdherent = new AdherentSoldeVO();
     $lAdherent->setId($pId);
     $lAdherent->setNumero($pNumero);
     $lAdherent->setIdCompte($pIdCompte);
     $lAdherent->setNom($pNom);
     $lAdherent->setPrenom($pPrenom);
     $lAdherent->setCourrielPrincipal($pCourrielPrincipal);
     $lAdherent->setCourrielSecondaire($pCourrielSecondaire);
     $lAdherent->setTelephonePrincipal($pTelephonePrincipal);
     $lAdherent->setTelephoneSecondaire($pTelephoneSecondaire);
     $lAdherent->setAdresse($pAdresse);
     $lAdherent->setCodePostal($pCodePostal);
     $lAdherent->setVille($pVille);
     $lAdherent->setDateNaissance($pDateNaissance);
     $lAdherent->setDateAdhesion($pDateAdhesion);
     $lAdherent->setDateMaj($pDateMaj);
     $lAdherent->setCommentaire($pCommentaire);
     // Ajout des Opérations
     $lAdherent->setListeOperation(OperationManager::selectByIdCompte($lAdherent->getIdCompte()));
     // Ajout du montant du solde
     $lAdherent->setSolde(OperationManager::soldeAdherent($lAdherent->getId()));
     return $lAdherent;
 }
include '../lib/image-processing.php';
//classes loading end
session_start();
//post input processing
$action = htmlentities($_POST['action']);
//In this session variable we put all the POST, to get it in the contrats-add file
//in case of error, and this help the user to do not put again what he filled out.
$_SESSION['operation-data-form'] = $_POST;
//This var contains result message of CRUD action
$actionMessage = "";
$typeMessage = "";
$redirectLink = "";
//process begins
//The History Component is used in all ActionControllers to mention a historical version of each action
$historyManager = new HistoryManager($pdo);
$operationManager = new OperationManager($pdo);
if ($action == "add") {
    if (!empty($_POST['montant']) and !empty($_POST['numeroOperation'])) {
        $montant = htmlentities($_POST['montant']);
        $modePaiement = htmlentities($_POST['modePaiement']);
        $numeroOperation = htmlentities($_POST['numeroOperation']);
        $dateOperation = htmlentities($_POST['dateOperation']);
        $dateReglement = htmlentities($_POST['dateReglement']);
        $compteBancaire = htmlentities($_POST['compteBancaire']);
        $observation = htmlentities($_POST['observation']);
        $idContrat = htmlentities($_POST['idContrat']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        $operation = new Operation(array('date' => $dateOperation, 'dateReglement' => $dateReglement, 'montant' => $montant, 'compteBancaire' => $compteBancaire, 'observation' => $observation, 'modePaiement' => $modePaiement, 'idContrat' => $idContrat, 'numeroCheque' => $numeroOperation, 'createdBy' => $createdBy, 'created' => $created));
        $operationManager->add($operation);
        //add History data
Пример #16
0
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    if (isset($_GET['idProjet'])) {
        $idProjet = $_GET['idProjet'];
    }
    //destroy contrat-form-data session
    if (isset($_SESSION['contrat-form-data'])) {
        unset($_SESSION['contrat-form-data']);
    }
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $compteBancaireManager = new CompteBancaireManager($pdo);
    $contratCasLibreManager = new ContratCasLibreManager($pdo);
    $reglementPrevuManager = new ReglementPrevuManager($pdo);
    if (isset($_GET['codeContrat']) and (bool) $contratManager->getCodeContrat($_GET['codeContrat'])) {
        $codeContrat = $_GET['codeContrat'];
        $comptesBancaires = $compteBancaireManager->getCompteBancaires();
        $contrat = $contratManager->getContratByCode($codeContrat);
        //ContratCasLibre Elements
        $contratCasLibreNumber = $contratCasLibreManager->getContratCasLibreNumberByCodeContrat($codeContrat);
        $contratCasLibreElements = "";
        $contratCasLibreTitle = "";
        if ($contratCasLibreNumber > 0) {
            $contratCasLibreTitle = "<h4>Informations Supplémentaires</h4>";
            $contratCasLibreElements = $contratCasLibreManager->getContratCasLibresByCodeContrat($codeContrat);
        }
//classes loading end
session_start();
//post input processing
$idContrat = htmlentities($_POST['idContrat']);
$idProjet = htmlentities($_POST['idProjet']);
if (!empty($_POST['dateOperation']) && !empty($_POST['montant'])) {
    $dateOperation = htmlentities($_POST['dateOperation']);
    $montant = htmlentities($_POST['montant']);
    $modePaiement = htmlentities($_POST['modePaiement']);
    $numeroCheque = 0;
    if (isset($_POST['numeroCheque'])) {
        $numeroCheque = htmlentities($_POST['numeroCheque']);
    }
    //create a new Operation object
    $operation = new Operation(array('date' => $dateOperation, 'montant' => $montant, 'modePaiement' => $modePaiement, 'idContrat' => $idContrat, 'numeroCheque' => $numeroCheque));
    $operationManager = new OperationManager($pdo);
    $operationManager->add($operation);
    $_SESSION['operation-add-success'] = "<strong>Opération valide</strong> : L'opération de paiement est ajoutée avec succès.";
    $_SESSION['print-quittance'] = "print-quittance";
    $redirectLink = 'Location:../operations.php?idContrat=' . $idContrat . '&idProjet=' . $idProjet;
    if (isset($_GET['p']) and $_GET['p'] == 99) {
        $redirectLink = 'Location:../contrats-list.php?idProjet=' . $idProjet;
    } else {
        if (isset($_GET['p']) and $_GET['p'] == 999) {
            $redirectLink = 'Location:../clients-search.php';
        }
    }
    header($redirectLink);
} else {
    $_SESSION['operation-add-error'] = "<strong>Erreur ajout opération</strong> : Vous devez remplir les champs 'Date opération' et 'Montant'.";
    $redirectLink = 'Location:../operations.php?idContrat=' . $idContrat . '&idProjet=' . $idProjet;
include '../lib/image-processing.php';
//classes loading end
session_start();
//post input processing
$action = htmlentities($_POST['action']);
//In this session variable we put all the POST, to get it in the contrats-add file
//in case of error, and this help the user to do not put again what he filled out.
$_SESSION['operation-data-form'] = $_POST;
//This var contains result message of CRUD action
$actionMessage = "";
$typeMessage = "";
$redirectLink = "";
//process begins
//The History Component is used in all ActionControllers to mention a historical version of each action
$historyManager = new HistoryManager($pdo);
$operationManager = new OperationManager($pdo);
$projetManager = new ProjetManager($pdo);
$clientManager = new ClientManager($pdo);
if ($action == "add") {
    if (!empty($_POST['montant']) and !empty($_POST['numeroOperation'])) {
        $reference = 'Q' . date('Ymd-his');
        $montant = htmlentities($_POST['montant']);
        $modePaiement = htmlentities($_POST['modePaiement']);
        $numeroOperation = htmlentities($_POST['numeroOperation']);
        $dateOperation = htmlentities($_POST['dateOperation']);
        $dateReglement = htmlentities($_POST['dateReglement']);
        $compteBancaire = htmlentities($_POST['compteBancaire']);
        $observation = htmlentities($_POST['observation']);
        $status = 0;
        $idContrat = htmlentities($_POST['idContrat']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
 /**
  * @name selectOperationReservation($pId, $pActive)
  * @param IdReservation
  * @param bool
  * @return array(OperationVO)
  * @desc Retourne une liste d'operation
  */
 public function selectOperationReservation($pId, $pActive = false)
 {
     return OperationManager::selectOperationReservation($pId, $pActive);
 }
<?php

//classes loading begin
function classLoad($myClass)
{
    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
$idContrat = $_POST['idContrat'];
$idProjet = $_POST['idProjet'];
$idOperation = $_POST['idOperation'];
if (!empty($_POST['numeroCheque'])) {
    $numeroCheque = htmlentities($_POST['numeroCheque']);
    $operationsManager = new OperationManager($pdo);
    $operationsManager->updateNumeroCheque($numeroCheque, $idOperation);
    $_SESSION['operation-update-success'] = "<strong>Opération valide : </strong>Numéro de chèque modifiée avec succès.";
    header('Location:../operations.php?idContrat=' . $idContrat . '&idProjet=' . $idProjet);
} else {
    $_SESSION['operation-update-error'] = "<strong>Erreur modification opération : </strong>Vous devez remplir le champ 'Numéro de chèque'.";
    header('Location:../operations.php?idContrat=' . $idContrat . '&idProjet=' . $idProjet);
}
Пример #21
0
include 'config.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //classes managers
    $usersManager = new UserManager($pdo);
    $mailsManager = new MailManager($pdo);
    $notesClientsManager = new NotesClientManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $contratManager = new ContratManager($pdo);
    $clientManager = new ClientManager($pdo);
    $livraisonsManager = new LivraisonManager($pdo);
    $fournisseursManager = new FournisseurManager($pdo);
    $caisseManager = new CaisseManager($pdo);
    $caisseIaazaManager = new CaisseIaazaManager($pdo);
    $operationsManager = new OperationManager($pdo);
    $compteBancaire = new CompteBancaireManager($pdo);
    //classes and vars
    //users number
    $soldeCaisseAnnahda = $caisseManager->getTotalCaisseByType("Entree") - $caisseManager->getTotalCaisseByType("Sortie");
    $soldeCaisseIaaza = $caisseIaazaManager->getTotalCaisseByType("Entree") - $caisseIaazaManager->getTotalCaisseByType("Sortie");
    $projetNumber = $projetManager->getProjetsNumber();
    $usersNumber = $usersManager->getUsersNumber();
    $fournisseurNumber = $fournisseursManager->getFournisseurNumbers();
    $mailsNumberToday = $mailsManager->getMailsNumberToday();
    $mailsToday = $mailsManager->getMailsToday();
    $clientWeek = $clientManager->getClientsWeek();
    $clientNumberWeek = $clientManager->getClientsNumberWeek();
    $livraisonsNumber = $livraisonsManager->getLivraisonNumber();
    $livraisonsWeek = $livraisonsManager->getLivraisonsWeek();
    $livraisonsNumberWeek = $livraisonsManager->getLivraisonsNumberWeek();
Пример #22
0
     // Création d'un nouveau compte, si il n'existe pas déjà
     $lCompte = new CompteVO();
     $lCompte->setLabel($lCompteLabel);
     $lSolde = str_replace(",", ".", $lCompteSolde);
     $lCompte->setSolde($lSolde);
     $lIdCompte = CompteManager::insert($lCompte);
     // Initialisation du compte si c'est un nouveau compte
     $lOperation = new OperationVO();
     $lOperation->setIdCompte($lIdCompte);
     $lOperation->setMontant($lSolde);
     $lOperation->setLibelle("Création du compte");
     $lOperation->setDate(StringUtils::dateAujourdhuiDb());
     //$lOperation->setType(1);
     $lOperation->setIdCommande(0);
     $lOperation->setTypePaiement(-1);
     OperationManager::insert($lOperation);
 }
 //L'adhérent
 $lAdherent = new AdherentVO();
 $lAdherent->setIdCompte($lIdCompte);
 $lAdherent->setNumero($lNumero);
 $lAdherent->setNom(StringUtils::formaterNom(trim($lNom)));
 $lAdherent->setPrenom(StringUtils::formaterPrenom(trim($lPrenom)));
 $lAdherent->setCourrielPrincipal(trim($lCourrielP));
 $lAdherent->setCourrielSecondaire(trim($lCourrielS));
 $lAdherent->setTelephonePrincipal(trim($lTelephoneP));
 $lAdherent->setTelephoneSecondaire(trim($lTelephoneS));
 $lAdherent->setAdresse(trim($lAdresse));
 $lAdherent->setCodePostal(trim($lCodePostal));
 $lAdherent->setVille(StringUtils::formaterVille(trim($lVille)));
 $lAdherent->setDateNaissance($lDateNaissance);
Пример #23
0
        //add it to db
        $historyManager->add($history);
        $actionMessage = "<strong>Opération Valide</strong> : Paiement Ajouté avec succès.";
        $typeMessage = "success";
    } else {
        $actionMessage = "<strong>Erreur Ajout Paiement Client</strong> : Vous devez remplir les champs <strong>Montant</strong> et <strong>Numéro Opération</strong>.";
        $typeMessage = "error";
    }
} else {
    if ($action == "updatePiece") {
        $codeContrat = htmlentities($_POST['codeContrat']);
        $url = "";
        $idOperation = htmlentities($_POST['idOperation']);
        if (file_exists($_FILES['urlPiece']['tmp_name']) || is_uploaded_file($_FILES['urlPiece']['tmp_name'])) {
            $url = imageProcessing($_FILES['urlPiece'], '/pieces/pieces_reglements/');
            $operationManager = new OperationManager($pdo);
            $operationManager->updatePiece($idOperation, $url);
            $actionMessage = "<strong>Opération valide : </strong>La pièce de réglement est modifiée avec succès.";
            $typeMessage = "success";
            //add history data to db
            $historyManager = new HistoryManager($pdo);
            $createdBy = $_SESSION['userMerlaTrav']->login();
            $created = date('Y-m-d h:i:s');
            $history = new History(array('action' => "Modification Pièce réglement", 'target' => "Table des réglements clients", 'description' => "Modification de la pièce de régelement - Opération : " . $idOperation, 'created' => $created, 'createdBy' => $createdBy));
            //add it to db
            $historyManager->add($history);
        } else {
            $actionMessage = "<strong>Erreur Modification Pièce de réglement : </strong>Vous devez séléctionner un fichier.";
            $typeMessage = "error";
        }
    } else {
Пример #24
0
    	//classes managers
    	$appartementManager = new AppartementManager($pdo);
        $locauxManager = new LocauxManager($pdo);
		$usersManager = new UserManager($pdo);
		$projetManager = new ProjetManager($pdo);
		$contratManager = new ContratManager($pdo);
		$clientManager = new ClientManager($pdo);
        $chargeManager = new ChargeManager($pdo);
        $chargeCommunManager = new ChargeCommunManager($pdo);
		$livraisonsManager = new LivraisonManager($pdo);
        $livraisonDetailManager = new LivraisonDetailManager($pdo);
		$fournisseursManager = new FournisseurManager($pdo);
		$reglementsFournisseurManager = new ReglementFournisseurManager($pdo);
		$caisseEntreesManager = new CaisseEntreesManager($pdo);
		$caisseSortiesManager = new CaisseSortiesManager($pdo);
		$operationsManager = new OperationManager($pdo);
		//classes and vars
		$idProjet = $_GET['idProjet'];
        $projet = $projetManager->getProjetById($idProjet);
		//Container 1 : Statistiques
		$chiffreAffaireTheorique = 
		ceil(
		  $appartementManager->getTotalPrixAppartementsByIdProjet($idProjet)
          +
          $locauxManager->getTotalPrixLocauxByIdProjet($idProjet)
        );
		
		//get contacts ids and get sum of client operations
		$idsContrats = $contratManager->getContratActifIdsByIdProjet($idProjet);
		$sommeOperationsClients = 0;
		$sommePrixVente = 0;
Пример #25
0
        include 'controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //les sources
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $companyManager = new CompanyManager($pdo);
    $contratManager = new ContratManager($pdo);
    $compteBancaireManager = new CompteBancaireManager($pdo);
    $operationManager = new OperationManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $comptesBancaires = $compteBancaireManager->getCompteBancaires();
    //obj and vars
    $contrats = $contratManager->getContratsToChange();
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>ImmoERP - Management Application</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
        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();
if (isset($_SESSION['userMerlaTrav']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    //classes managers
    $idProjet = 0;
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $contratCasLibreManager = new ContratCasLibreManager($pdo);
    $reglementPrevuManager = new ReglementPrevuManager($pdo);
    if (isset($_GET['codeContrat']) and (bool) $contratManager->getCodeContrat($_GET['codeContrat'])) {
        $codeContrat = $_GET['codeContrat'];
        $contrat = $contratManager->getContratByCode($codeContrat);
        $projet = $projetManager->getProjetById($contrat->idProjet());
        $client = $clientManager->getClientById($contrat->idClient());
        $sommeOperations = $operationManager->sommeOperations($contrat->id());
        $biens = "";
        $typeBien = "";
        $niveau = "";
        if ($contrat->typeBien() == "appartement") {
            $appartementManager = new AppartementManager($pdo);
            $biens = $appartementManager->getAppartementById($contrat->idBien());
            $typeBien = "Appartement";
Пример #27
0
}
// some frameworks (namely angularjs) send information in application/json format, we try to adapt to those system with the next if
if (empty($_REQUEST)) {
    $data = json_decode(file_get_contents("php://input"));
    if (is_object($data) and !empty($data->operation)) {
        $_POST = get_object_vars($data);
        // only post is affected by this
        $_REQUEST = $_POST;
    }
}
$operation = vtws_getParameter($_REQUEST, "operation");
$operation = strtolower($operation);
$format = vtws_getParameter($_REQUEST, "format", "json");
$sessionId = vtws_getParameter($_REQUEST, "sessionName");
$sessionManager = new SessionManager();
$operationManager = new OperationManager($adb, $operation, $format, $sessionManager);
try {
    if (!$sessionId || strcasecmp($sessionId, "null") === 0) {
        $sessionId = null;
    }
    $input = $operationManager->getOperationInput();
    $adoptSession = false;
    if (strcasecmp($operation, "extendsession") === 0) {
        if (isset($input['operation'])) {
            // Workaround fix for PHP 5.3.x: $_REQUEST doesn't have PHPSESSID
            if (isset($_REQUEST['PHPSESSID'])) {
                $sessionId = vtws_getParameter($_REQUEST, "PHPSESSID");
            } else {
                // NOTE: Need to evaluate for possible security issues
                $sessionId = vtws_getParameter($_COOKIE, 'PHPSESSID');
            }
    function classLoad ($myClass) {
        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');  
    include('lib/pagination.php');
    //classes loading end
    session_start();
    if( isset($_SESSION['userMerlaTrav']) ){
        //les sources
        $operationManager = new OperationManager($pdo);
        $operations =$operationManager->getOperationsGroupByMonth();
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
    <meta charset="utf-8" />
    <title>ImmoERP - Management Application</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
    <link href="assets/css/metro.css" rel="stylesheet" />