Esempio n. 1
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'])) {
    //les sources
    $idProjet = 0;
    $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();
    if (isset($_GET['idProjet']) and $_GET['idProjet'] > 0 and $_GET['idProjet'] <= $projetManager->getLastId()) {
        $idProjet = $_GET['idProjet'];
        $projet = $projetManager->getProjetById($idProjet);
        $companies = $companyManager->getCompanys();
        if (isset($_POST['idClient']) and $_POST['idClient'] > 0) {
            $idClient = $_POST['idClient'];
            $contrats = $contratManager->getContratsByIdClientByIdProjet($idClient, $idProjet);
            $contratNumber = -1;
        } else {
            $contrats = $contratManager->getContratsDesistesByIdProjet($idProjet);
Esempio n. 2
0
        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
    $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" />
Esempio n. 3
0
//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();
if (isset($_SESSION['userMerlaTrav']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    $contratManager = new ContratManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $terrainManager = new TerrainManager($pdo);
    $maisonManager = new MaisonManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $biens = "";
    $idContrat = 0;
    if (isset($_GET['idContrat']) and ($_GET['idContrat'] > 0 and $_GET['idContrat'] <= $contratManager->getLastId())) {
        $idContrat = $_GET['idContrat'];
    } else {
        header('Location:../dashboard.php');
        exit;
    }
    $contrat = $contratManager->getContratById($idContrat);
    $projet = $projetManager->getProjetById($contrat->idProjet());
{
    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'])) {
    //classes managers
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    //objs and vars
    $idProjet = $_GET['idProjet'];
    $projet = $projetManager->getProjetById($idProjet);
    $appartements = $appartementManager->getAppartementByIdProjet($idProjet);
    ob_start();
    ?>
<style type="text/css">
    p, h1{
        text-align: center;
        text-decoration: underline;
    }
    table, tr, td, th {
        border-collapse: collapse;
        width:auto;
Esempio n. 5
0
    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'];
$idSociete = $_POST['idSociete'];
$idContrat = $_POST['idContrat'];
//old Contrat
$contratManager = new ContratManager($pdo);
$contrat = $contratManager->getContratById($idContrat);
//form process
if (!empty($_POST['prixNegocie']) and !empty($_POST['nomClient'])) {
    $nomClient = htmlentities($_POST['nomClient']);
    $cin = htmlentities($_POST['cin']);
    $telephone = htmlentities($_POST['telephone']);
    $adresse = htmlentities($_POST['adresse']);
    $dateCreation = htmlentities($_POST['dateCreation']);
    $dateRetour = htmlentities($_POST['dateRetour']);
    $avance = htmlentities($_POST['avance']);
    $note = htmlentities($_POST['note']);
    $taille = htmlentities($_POST['taille']);
    $prixNegocie = htmlentities($_POST['prixNegocie']);
    $modePaiement = htmlentities($_POST['modePaiement']);
    $numeroCheque = $contrat->numeroCheque();
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'];
$contratManager = new ContratManager($pdo);
$contrat = $contratManager->getContratById($idContrat);
$contratManager->delete($idContrat);
if ($contrat->typeBien() == "appartement") {
    $appartementManager = new AppartementManager($pdo);
    $appartementManager->changeStatus($contrat->idBien(), "Non");
} else {
    if ($contrat->typeBien() == "localCommercial") {
        $locauxManager = new LocauxManager($pdo);
        $locauxManager->changeStatus($contrat->idBien(), "Non");
    }
}
$_SESSION['contrat-delete-success'] = "<strong>Opération valide : </strong>Contrat supprimé avec succès.";
$redirectLink = 'Location:../contrats-list.php?idProjet=' . $idProjet;
if (isset($_GET['p']) and $_GET['p'] == 99) {
    $redirectLink = 'Location:../clients-search.php';
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['id_contrat'];
if (!empty($_POST['dateCreation']) && !empty($_POST['prixVente']) && !empty($_POST['avance'])) {
    $dateCreation = htmlentities($_POST['dateCreation']);
    $prixVente = htmlentities($_POST['prixVente']);
    $avance = htmlentities($_POST['avance']);
    $dateEcheance = htmlentities($_POST['dateEcheance']);
    $nb = htmlentities($_POST['nb']);
    //update a Contract object
    $contract = new Contrat(array('id' => $idContrat, 'dateCreation' => $dateCreation, 'prixVente' => $prixVente, 'avance' => $avance, 'dateEcheanceMois' => $dateEcheance, 'nb' => $nb));
    $contratsManager = new ContratManager($pdo);
    $contratsManager->update($contract);
    $_SESSION['success']['contract-update'] = 'Les données du contrat sont modifié avec succès !';
    $contrat = $contratsManager->getContratById($idContrat);
    header('Location:../contract-list.php?id=' . $contrat->idClient());
} else {
    $_SESSION['error']['contract-update'] = "Vous devez remplir au moins les champs 'Date du contrat', 'Avance' et 'Prix de vente' !";
    header('Location:../update-contract.php?id=' . $idContrat);
}
Esempio n. 8
0
    } 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 = $_GET['idProjet'];
    $idSociete = $_GET['idSociete'];
    $type = $_GET['type'];
    $projetManager = new ProjetManager($pdo);
    $societeManager = new SocieteManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $terrainsManager = new TerrainManager($pdo);
    $maisonsManager = new MaisonManager($pdo);
    $contratNumber = $contratManager->getContratsNumberByIdProjet($idProjet);
    $contrats = $contratManager->getContratsByIdProjetOnly($idProjet);
    ob_start();
    ?>
<style type="text/css">
    p, h1, h3{
        text-align: center;
        text-decoration: underline;
    }
    table, tr, td, th {
Esempio n. 9
0
            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']) ){
        //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" />
        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']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    //les services
    $clients = "";
    $clientManager = new ClientManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $contratsManager = new ContratManager($pdo);
    $compteBancaireManager = new CompteBancaireManager($pdo);
    $operationManager = new OperationManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    if (isset($_SESSION['searchClientResult'])) {
        $clients = $_SESSION['searchClientResult'];
        $comptesBancaires = $compteBancaireManager->getCompteBancaires();
    }
    ?>
<!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 -->
Esempio n. 11
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'])) {
    //les sources
    $idProjet = 0;
    $projetManager = new ProjetManager($pdo);
    $societeManager = new SocieteManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $maisonManager = new MaisonManager($pdo);
    $terrainManager = new TerrainManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    if (isset($_GET['idProjet']) and $_GET['idProjet'] > 0 and $_GET['idProjet'] <= $projetManager->getLastId()) {
        $idProjet = $_GET['idProjet'];
        $idSociete = $_GET['idSociete'];
        $societe = $societeManager->getSocieteById($idSociete);
        $projet = $projetManager->getProjetById($idProjet);
        $contratNumber = $contratManager->getContratsNumberByIdProjet($idProjet);
        if ($contratNumber != 0) {
            $contrats = $contratManager->getContratsActifsByIdProjet($idProjet);
        }
        ?>
Esempio n. 12
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);
		if(isset($_GET['idProjet']) and ($_GET['idProjet'])>0 and $_GET['idProjet']<=$projetManager->getLastId()){
			$idProjet = $_GET['idProjet'];
			$projet = $projetManager->getProjetById($idProjet);
			$locauxManager = new LocauxManager($pdo);
            $contratManager = new ContratManager($pdo);
            $clientManager = new ClientManager($pdo);
			$locaux = "";
			//test the locaux object number: if exists get locaux else do nothing
			$locauxNumber = $locauxManager->getLocauxNumberByIdProjet($idProjet);
			if($locauxNumber != 0){
				/*$locauxPerPage = 10;
		        $pageNumber = ceil($locauxNumber/$locauxPerPage);
		        $p = 1;
		        if(isset($_GET['p']) and ($_GET['p']>0 and $_GET['p']<=$pageNumber)){
		            $p = $_GET['p'];
		        }
		        else{
		            $p = 1;
		        }
		        $begin = ($p - 1) * $locauxPerPage;
Esempio n. 13
0
//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['contrat-form-data'] = $_POST;
//If we get to this current ContratActionController through ClientActionController,
//which means, that the client data are valid, so we need to destroy the session
//"myFormData", that stores the client data form inputs
if (isset($_SESSION['myFormData'])) {
    unset($_SESSION['myFormData']);
}
//This var contains result message of CRUD action and the redirection url link
$actionMessage = "";
$typeMessage = "";
$redirectLink = "";
//class manager
$clientManager = new ClientManager($pdo);
$contratManager = new ContratManager($pdo);
$contratCasLibreManager = new ContratCasLibreManager($pdo);
$reglementPrevuManager = new ReglementPrevuManager($pdo);
$projetManager = new ProjetManager($pdo);
//The History Component is used in all ActionControllers to mention a historical version of each action
$historyManager = new HistoryManager($pdo);
//process starts
$nomProjet = $projetManager->getProjetById($idProjet)->nom();
//Action Add Processing Begin
if ($action == "add") {
    $codeClient = $_POST['codeClient'];
    //post input validation
    if (!empty($_POST['typeBien']) and !empty($_POST['prixNegocie']) and !empty($_POST['numero']) and !empty($_POST['bien']) and !empty($_POST['dateCreation']) and !empty($_POST['avance']) and !empty($_POST['modePaiement']) and !empty($_POST['dureePaiement']) and !empty($_POST['nombreMois']) and !empty($_POST['echeance'])) {
        if (!empty($_POST['prixNegocie'])) {
            $reference = 'C' . date('Ymd-his');
            $prixNegocie = htmlentities($_POST['prixNegocie']);
    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
    $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());
Esempio n. 15
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
    $mois = $_GET['mois'];
    $annee = $_GET['annee'];
    $idProjet = 0;
    $projetManager = new ProjetManager($pdo);
    $societeManager = new SocieteManager($pdo);
    $contratManager = new ContratManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $maisonManager = new MaisonManager($pdo);
    $terrainManager = new TerrainManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $contrats = $contratManager->getContratByMonthYear($mois, $annee);
    ?>
<!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>GELM - Management Application</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport" />
Esempio n. 16
0
    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'])) {
    //destroy contrat-form-data session
    $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);
    //reglements prevus
    $reglementsPrevusEnRetards = $reglementPrevuManager->getReglementPrevuEnRetard();
    $reglementsPrevusToday = $reglementPrevuManager->getReglementPrevuToday();
    $reglementsPrevusWeek = $reglementPrevuManager->getReglementPrevuWeek();
    $reglementsPrevusMonth = $reglementPrevuManager->getReglementPrevuMonth();
    //casLibre dates
    $casLibreEnRetards = $contratCasLibreManager->getReglementEnRetard();
    $casLibreToday = $contratCasLibreManager->getReglementToday();
    $casLibreWeek = $contratCasLibreManager->getReglementWeek();
    $casLibreMonth = $contratCasLibreManager->getReglementMonth();
    /*$codeContrat = $_GET['codeContrat'];
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/image-processing.php';
require_once '../lib/tcpdf/tcpdf.php';
//classes loading end
session_start();
//classes managers
$contratManager = new ContratManager($pdo);
$companyManager = new CompanyManager($pdo);
$clientManager = new ClientManager($pdo);
$projetManager = new ProjetManager($pdo);
$reglementsPrevu = new ReglementPrevu($pdo);
$contratCasLibre = new ContratCasLibre($pdo);
//classes
$idContrat = $_GET['idContrat'];
$contrat = $contratManager->getContratById($idContrat);
$client = $clientManager->getClientById($contrat->idClient());
$projet = $projetManager->getProjetById($contrat->idProjet());
$titreProjet = $projet->titre();
$contratTitle = "فسخ عقد";
$bien = "";
$typeBien = "";
$cave = "";
Esempio n. 18
0
        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'])) {
    //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();
Esempio n. 19
0
        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'];
$idSociete = $_POST['idSociete'];
$idContrat = $_POST['idContrat'];
$status = $_POST['status'];
//create classes managers
$contratManager = new ContratManager($pdo);
$locauxManager = new LocauxManager($pdo);
$appartementManager = new AppartementManager($pdo);
$maisonManager = new MaisonManager($pdo);
$terrainManager = new TerrainManager($pdo);
//create classes
$contrat = $contratManager->getContratById($idContrat);
$redirectLink = 'Location:../contrats-list.php?idProjet=' . $idProjet . '&idSociete=' . $idSociete;
if (isset($_GET['p']) and $_GET['p'] == 99) {
    $redirectLink = 'Location:../clients-search.php';
}
if ($contrat->typeBien() == "appartement") {
    if ($appartementManager->getAppartementById($contrat->idBien())->status() == "Disponible") {
        $appartementManager->updateStatus($status, $contrat->idBien());
        $contratManager->activerContrat($idContrat);
        $_SESSION['contrat-activation-success'] = "<strong>Opération valide : </strong>Le contrat est activé avec succès.";
Esempio n. 20
0
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
    $contratManager = new ContratManager($pdo);
    $contrats = $contratManager->getContratGroupByMonth();
    ?>
<!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>GELM - 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" />
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();
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") {
Esempio n. 22
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'])) {
    //les sources
    $idProjet = 0;
    $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();
    if (isset($_GET['idProjet']) and $_GET['idProjet'] > 0 and $_GET['idProjet'] <= $projetManager->getLastId()) {
        $idProjet = $_GET['idProjet'];
        $projet = $projetManager->getProjetById($idProjet);
        $companies = $companyManager->getCompanys();
        if (isset($_POST['idClient']) and $_POST['idClient'] > 0) {
            $idClient = $_POST['idClient'];
            $contrats = $contratManager->getContratsByIdClientByIdProjet($idClient, $idProjet);
            $contratNumber = -1;
        } else {
            $contrats = $contratManager->getContratsActifsByIdProjet($idProjet);
    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" or $_SESSION['userMerlaTrav']->profil() == "manager") {
    //classes managers
    $idProjet = $_GET['idProjet'];
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $contratNumber = $contratManager->getContratsNumberByIdProjet($idProjet);
    $contrats = $contratManager->getContratsDesistesByIdProjet($idProjet);
    ob_start();
    ?>
<style type="text/css">
    p, h1{
        text-align: center;
        text-decoration: underline;
    }
    table, tr, td, th {
        border-collapse: collapse;
        width:auto;
//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['contrat-form-data'] = $_POST;
//If we get to this current ContratActionController through ClientActionController,
//which means, that the client data are valid, so we need to destroy the session
//"myFormData", that stores the client data form inputs
if (isset($_SESSION['myFormData'])) {
    unset($_SESSION['myFormData']);
}
//This var contains result message of CRUD action and the redirection url link
$actionMessage = "";
$typeMessage = "";
$redirectLink = "";
//class manager
$clientManager = new ClientManager($pdo);
$contratManager = new ContratManager($pdo);
$contratCasLibreManager = new ContratCasLibreManager($pdo);
$reglementPrevuManager = new ReglementPrevuManager($pdo);
//The History Component is used in all ActionControllers to mention a historical version of each action
$historyManager = new HistoryManager($pdo);
//process starts
//Action Add Processing Begin
if ($action == "add") {
    $codeClient = $_POST['codeClient'];
    //post input validation
    if (!empty($_POST['typeBien']) and !empty($_POST['prixNegocie']) and !empty($_POST['numero']) and !empty($_POST['bien']) and !empty($_POST['dateCreation']) and !empty($_POST['avance']) and !empty($_POST['modePaiement']) and !empty($_POST['dureePaiement']) and !empty($_POST['nombreMois']) and !empty($_POST['echeance'])) {
        if (!empty($_POST['prixNegocie'])) {
            $prixNegocie = htmlentities($_POST['prixNegocie']);
            $numero = htmlentities($_POST['numero']);
            $typeBien = htmlentities($_POST['typeBien']);
            $idBien = htmlentities($_POST['bien']);
Esempio n. 25
0
{
    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'])) {
    //classes managers
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    //objs and vars
    $idProjet = $_GET['idProjet'];
    $projet = $projetManager->getProjetById($idProjet);
    $locaux = $locauxManager->getLocauxByIdProjet($idProjet);
    ob_start();
    ?>
<style type="text/css">
    p, h1{
        text-align: center;
        text-decoration: underline;
    }
    table, tr, td, th {
        border-collapse: collapse;
        width:auto;
Esempio n. 26
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']) ){
        //les sources
        $projetManager = new ProjetManager($pdo);
        $appartementManager = new AppartementManager($pdo);
        $locauxManager = new LocauxManager($pdo);
        $contratManager = new ContratManager($pdo);
        $clientManager = new ClientManager($pdo);
        $appartements = $appartementManager->getAppartementsNonVendu();
        $appartementsRevendre = $contratManager->getAppartementsRevendre();
        $locaux = $locauxManager->getLocauxNonVendu();
        $locauxRevendre = $contratManager->getLocauxRevendre();
?>
<!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" />
    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'];
$idSociete = $_POST['idSociete'];
$idContrat = $_POST['idContrat'];
//create classes managers
$contratManager = new ContratManager($pdo);
$redirectLink = 'Location:../contrats-list.php?idProjet=' . $idProjet . "&idSociete=" . $idSociete;
if (isset($_POST['paye'])) {
    $paye = htmlentities($_POST['paye']);
    $contratManager->updatePaiement($paye, $idContrat);
    $contrat = $contratManager->getContratById($idContrat);
    //add history data to db
    $projetManager = new ProjetManager($pdo);
    $historyManager = new HistoryManager($pdo);
    $projet = $projetManager->getProjetById($idProjet);
    $createdBy = $_SESSION['userMerlaTrav']->login();
    $created = date('Y-m-d h:i:s');
    $history = new History(array('action' => "Ajout Paiement Contrat Client", 'target' => "Table des contrats clients", 'description' => "Ajout Paiement Contrat Client - Client :  " . $contrat->nomClient() . " - CIN : " . $contrat->cin() . " - ID Contrat : " . $idContrat . " - Montant : " . $paye . " - Projet : " . $projet->nom(), 'created' => $created, 'createdBy' => $createdBy));
    //add it to db
    $historyManager->add($history);
    $_SESSION['contrat-paiement-success'] = "<strong>Opération valide : </strong>Le montant payé est modifié avec succès.";
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();
if (isset($_SESSION['userMerlaTrav'])) {
    $clientManager = new ClientManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $contratManager = new ContratManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $idAppartement = 0;
    if (isset($_GET['idLocaux']) and $_GET['idLocaux'] > 0 and $_GET['idLocaux'] <= $locauxManager->getLastId()) {
        $idLocaux = $_GET['idLocaux'];
        $local = $locauxManager->getLocauxById($idLocaux);
        $contrat = $contratManager->getContratByIdBien($local->id());
        $client = $clientManager->getClientById($contrat->idClient());
        $projet = $projetManager->getProjetById($contrat->idProjet());
        $piecesLocauxManager = new PiecesLocauxManager($pdo);
        $piecesNumber = $piecesLocauxManager->getPiecesLocauxNumberByIdLocaux($local->id());
        $pieces = "";
        if ($piecesNumber > 0) {
            $pieces = $piecesLocauxManager->getPiecesLocauxByIdLocaux($local->id());
        }
    }
    }
}
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
//post input processing
$idClient = htmlentities($_POST['client']);
if (!empty($_POST['projet']) && !empty($_POST['bien']) && !empty($_POST['nom'])) {
    $nom = htmlentities($_POST['nom']);
    $projet = htmlentities($_POST['projet']);
    $bien = htmlentities($_POST['bien']);
    $dateCreation = htmlentities($_POST['dateCreation']);
    $prixVente = htmlentities($_POST['prixVente']);
    $avance = htmlentities($_POST['avance']);
    $dateEcheance = htmlentities($_POST['dateEcheance']);
    $nb = htmlentities($_POST['nb']);
    $idClient = htmlentities($_POST['client']);
    //create a new Client object
    $contrat = new Contrat(array('dateCreation' => $dateCreation, 'prixVente' => $prixVente, 'avance' => $avance, 'dateEcheanceMois' => $dateEcheance, 'nb' => $nb, 'idClient' => $idClient, 'idProjet' => $projet, 'idBien' => $bien));
    $contratManager = new ContratManager($pdo);
    $contratManager->add($contrat);
    //update property state (reserve=yes)
    $bienManager = new BienManager($pdo);
    $bien = $bienManager->updateReserve('oui', $bien);
    $_SESSION['success']['contrat'] = 'Le contrat est ajouté avec succès !';
    header('Location:../contract-list.php?id=' . $idClient);
} else {
    $_SESSION['error']['client'] = "Vous devez remplir au moins le champs 'Nom du client', 'Projet' et le 'Bien' !";
    header('Location:../new-contract.php?id=' . $idClient);
}
Esempio n. 30
0
        }
        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 (isset($_GET['idProjet']))){
    	//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 =