session_start();
//post input processing
$param = $_GET['param'];
$idEmploye = htmlentities($_POST['idEmploye']);
$idProjet = htmlentities($_POST['idProjet']);
if (!empty($_POST['nom'])) {
    $nom = htmlentities($_POST['nom']);
    $cin = htmlentities($_POST['cin']);
    $email = htmlentities($_POST['email']);
    $telephone = htmlentities($_POST['telephone']);
    $etatCivile = htmlentities($_POST['etatCivile']);
    $dateDebut = htmlentities($_POST['dateDebut']);
    $dateSortie = htmlentities($_POST['dateSortie']);
    $photo = htmlentities($_POST['photo']);
    if (!empty($_FILES['newPhoto']) and $_FILES['newPhoto']['error'] == 0) {
        $photo = imageProcessing($_FILES['newPhoto'], '/photo_employes_societe/');
    }
    $employe = new EmployeProjet(array('id' => $idEmploye, 'nom' => $nom, 'cin' => $cin, 'etatCivile' => $etatCivile, 'telephone' => $telephone, 'photo' => $photo, 'email' => $email, 'dateDebut' => $dateDebut, 'dateSortie' => $dateSortie));
    $employeManager = new EmployeProjetManager($pdo);
    $employeManager->update($employe);
    $_SESSION['employe-update-success'] = "<strong>Opération valide : </strong>Les informations de l'employé '" . $nom . "' sont modifiées avec succès.";
    $location = "employes-projet.php?idProjet=" . $idProjet;
    if ($param == 2) {
        $location = "employe-projet-profile.php?idEmploye=" . $idEmploye;
    }
    header('Location:../' . $location);
} else {
    $_SESSION['employe-update-error'] = "<strong>Erreur Modification Employé : </strong>Vous devez remplir au moins le champ 'Nom'.";
    $location = "employes-projet.php?idProjet=" . $idProjet;
    if ($param == 2) {
        $location = "employe-societe-profile.php?idEmploye=" . $idEmploye;
    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';
//classes loading end
session_start();
//post input processing
$idSociete = htmlentities($_POST['idSociete']);
$url = "";
$idCheque = htmlentities($_POST['idCheque']);
if (file_exists($_FILES['urlCopieCheque']['tmp_name']) || is_uploaded_file($_FILES['urlCopieCheque']['tmp_name'])) {
    $url = imageProcessing($_FILES['urlCopieCheque'], '/pieces/pieces_cheque/');
    $chequeManager = new ChequeManager($pdo);
    $chequeManager->updateCopieCheque($url, $idCheque);
    $_SESSION['cheque-copie-update-success'] = "<strong>Opération valide : </strong>La copie chèque est modifiée avec succès.";
    //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 Copie Chèque", 'target' => "Table des chèques", 'description' => "Modification de la copie du chèque- ID : " . $idCheque, 'created' => $created, 'createdBy' => $createdBy));
    //add it to db
    $historyManager->add($history);
} else {
    $_SESSION['cheque-copie-update-error'] = "<strong>Erreur Modification Copie Chèque : </strong>Vous devez séléctionner un fichier.";
}
header('Location:../company-cheques.php?idSociete=' . $idSociete);
        $history = new History(array('action' => "Ajout", 'target' => "Table des paiements clients ", 'description' => "Ajout 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 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";
        }
{
    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';
//classes loading end
session_start();
$idProjet = htmlentities($_POST['idProjet']);
$idLocaux = htmlentities($_POST['idLocaux']);
$redirect = 'Location:../locaux.php?idProjet=' . $idProjet;
if ($_GET['p'] == 2) {
    $redirect = 'Location:../locaux-detail.php?idLocaux=' . $idLocaux . '&idProjet=' . $idProjet;
}
if (file_exists($_FILES['url']['tmp_name']) || is_uploaded_file($_FILES['url']['tmp_name'])) {
    $url = imageProcessing($_FILES['url'], '/pieces/pieces_locaux/');
    $nom = "Fiche descriptif du local commercial";
    //htmlentities($_POST['nom']);
    $pieceLocaux = new PiecesLocaux(array('nom' => $nom, 'url' => $url, 'idLocaux' => $idLocaux));
    $pieceLocauxManager = new PiecesLocauxManager($pdo);
    $pieceLocauxManager->add($pieceLocaux);
    $_SESSION['pieces-add-success'] = "<strong>Opération valide : </strong>La pièce a été ajouté avec succès.";
    header($redirect);
} else {
    $_SESSION['pieces-add-error'] = "<strong>Erreur Ajout Pièces Local : </strong>Vous devez ajouté un lien.";
    header($redirect);
}
示例#5
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/image-processing.php';
//classes loading end
session_start();
$idProjet = htmlentities($_POST['idProjet']);
$idSociete = htmlentities($_POST['idSociete']);
if (file_exists($_FILES['urlPieceProjet']['tmp_name']) || is_uploaded_file($_FILES['urlPieceProjet']['tmp_name'])) {
    $url = imageProcessing($_FILES['urlPieceProjet'], '/pieces/pieces_projet/');
    echo $url;
    $description = htmlentities($_POST['descriptionProjet']);
    $pieceProjet = new PiecesProjet(array('url' => $url, 'description' => $description, 'idProjet' => $idProjet, 'createdBy' => $_SESSION['userMerlaTrav']->login(), 'created' => date('Y-m-d')));
    $piecesProjetManager = new PiecesProjetManager($pdo);
    $piecesProjetManager->add($pieceProjet);
    $_SESSION['pieces-add-success'] = "<strong>Opération valide : </strong>Le document a été ajouté avec succès.";
} else {
    $_SESSION['pieces-add-error'] = "<strong>Erreur Ajout Documents : </strong>Vous devez ajouté un document.";
}
$redirect = "Location:../projects-by-company.php?idSociete=" . $idSociete;
if (isset($_GET['source']) and $_GET['source'] == 2) {
    $redirect = "Location:../projet-details.php?idProjet=" . $idProjet . "&idSociete=" . $idSociete;
}
header($redirect);
         $redirectLink = "Location:../contrat.php?codeContrat=" . $codeContrat;
         if (isset($_POST['source']) and $_POST['source'] == "clients-list") {
             $redirectLink = "Location:../clients-list.php";
         }
     } else {
         $actionMessage = "<strong>Erreur Modification Client : </strong>Vous devez remplir le champ <strong>&lt;Prix de vente&gt;</strong>.";
         $typeMessage = "error";
         $redirectLink = "Location:../contrat.php?codeContrat=" . $codeContrat;
     }
 } else {
     if ($action == "updateImageNote") {
         $codeContrat = htmlentities($_POST['codeContrat']);
         $imageNote = "";
         $idContrat = htmlentities($_POST['idContrat']);
         if (file_exists($_FILES['note-client-image']['tmp_name']) || is_uploaded_file($_FILES['note-client-image']['tmp_name'])) {
             $imageNote = imageProcessing($_FILES['note-client-image'], '/pieces/pieces_notes_clients/');
             $contratManager->updateImageNote($idContrat, $imageNote);
             $actionMessage = "<strong>Opération valide : </strong>Image Note est modifiée avec succès.";
             $typeMessage = "success";
         } else {
             $actionMessage = "<strong>Erreur Modification Image Note : </strong>Vous devez séléctionner un fichier.";
             $typeMessage = "error";
         }
         $redirectLink = "Location:../contrat.php?codeContrat=" . $codeContrat . "&idProjet=" . $idProjet;
         if (isset($_POST['source']) and $_POST['source'] == "clients-modification") {
             $redirectLink = "Location:../clients-modification.php";
         }
     } else {
         if ($action == "updateObservation") {
             $idContrat = htmlentities($_POST['idContrat']);
             $codeContrat = htmlentities($_POST['codeContrat']);
<?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';
include '../lib/image-processing.php';
//classes loading end
session_start();
$idProjet = htmlentities($_POST['idProjet']);
$idTerrain = htmlentities($_POST['idTerrain']);
if (file_exists($_FILES['url']['tmp_name']) || is_uploaded_file($_FILES['url']['tmp_name'])) {
    $url = imageProcessing($_FILES['url'], '/pieces/pieces_terrain/');
    $nom = htmlentities($_POST['nom']);
    $pieceTerrain = new PiecesTerrain(array('nom' => $nom, 'url' => $url, 'idTerrain' => $idTerrain));
    $pieceTerrainManager = new PiecesTerrainManager($pdo);
    $pieceTerrainManager->add($pieceTerrain);
    $_SESSION['pieces-add-success'] = "<strong>Opération valide : </strong>La pièce a été ajouté avec succès.";
    header('Location:../terrain.php?idProjet=' . $idProjet . '#listTerrain');
} else {
    $_SESSION['pieces-add-error'] = "<strong>Erreur Ajout Pièces Terrain : </strong>Vous devez ajouté un lien.";
    header('Location:../terrain.php?idProjet=' . $idProjet . '#listTerrain');
}
<?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';
include '../lib/image-processing.php';
//classes loading end
session_start();
$idProjet = htmlentities($_POST['idProjet']);
$idLivraison = htmlentities($_POST['idLivraison']);
if (file_exists($_FILES['url']['tmp_name']) || is_uploaded_file($_FILES['url']['tmp_name'])) {
    $url = imageProcessing($_FILES['url'], '/pieces/pieces_livraison/');
    $nom = htmlentities($_POST['nom']);
    $livraisonPieces = new LivraisonPieces(array('nom' => $nom, 'url' => $url, 'idLivraison' => $idLivraison));
    $livraisonPiecesManager = new LivraisonPiecesManager($pdo);
    $livraisonPiecesManager->add($livraisonPieces);
    $_SESSION['pieces-add-success'] = "<strong>Opération valide : </strong>La pièce a été ajoutée avec succès.";
    header('Location:../livraisons-list.php?idProjet=' . $idProjet);
} else {
    $_SESSION['pieces-add-error'] = "<strong>Erreur Ajout Documents Livraison : </strong>Vous devez ajouté un lien.";
    header('Location:../livraisons-list.php?idProjet=' . $idProjet);
}
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        //create object
        $appartementPiece = new AppartementPieces(array('nom' => $nom, 'url' => $url, 'idAppartement' => $idAppartement, 'created' => $created, 'createdBy' => $createdBy));
        //add it to db
        $appartementPiecesManager->add($appartementPiece);
        $actionMessage = "Opération Valide : Pièce Appartement Ajouté(e) avec succès.";
        $typeMessage = "success";
    } else {
        $actionMessage = "Erreur Ajout Appartement Pièce : Vous devez sélectionner un fichier !";
        $typeMessage = "error";
    }
} else {
    if ($action == "update") {
        if (file_exists($_FILES['url']['tmp_name']) || is_uploaded_file($_FILES['url']['tmp_name'])) {
            $url = imageProcessing($_FILES['url'], '/pieces/pieces_appartement/');
            $nom = htmlentities($_POST['nom']);
            $updatedBy = $_SESSION['userMerlaTrav']->login();
            $updated = date('Y-m-d h:i:s');
            //create object
            $appartementPiece = new AppartementPieces(array('nom' => $nom, 'url' => $url, 'idAppartement' => $idAppartement, 'updated' => $updated, 'updatedBy' => $updatedBy));
            //add it to db
            $appartementPiecesManager->update($appartementPiece);
            $actionMessage = "Opération Valide : Pièce Appartement Modifié(e) avec succès.";
            $typeMessage = "success";
        } else {
            $actionMessage = "Erreur Ajout Appartement Pièce : Vous devez sélectionner un fichier !";
            $typeMessage = "error";
        }
    } else {
        if ($action == "delete") {
示例#10
0
//classes loading end
session_start();
$db = $pdo;
$annoncesManager = new AnnonceManager($db);
$image1 = "";
$image2 = "";
$image3 = "";
$image1 = imageProcessing($_FILES['image_upload1']);
if ($image1 == "../view/themes/images/logo_bootshop.png") {
    $image1 = $_SESSION['image1_' . $_GET['id']];
}
$image2 = imageProcessing($_FILES['image_upload2']);
if ($image2 == "../view/themes/images/logo_bootshop.png") {
    $image2 = $_SESSION['image2_' . $_GET['id']];
}
$image3 = imageProcessing($_FILES['image_upload3']);
if ($image3 == "../view/themes/images/logo_bootshop.png") {
    $image3 = $_SESSION['image3_' . $_GET['id']];
}
// $image1 = "../view/themes/images/logo_bootshop.png";
// $image2 = "../view/themes/images/logo_bootshop.png";
// $image3 = "../view/themes/images/logo_bootshop.png";
if (isset($_POST['srchCat']) and isset($_POST['srchVille']) and isset($_POST['titre']) and isset($_POST['description']) and isset($_POST['prix'])) {
    $categorie = $_POST['srchCat'];
    $ville = $_POST['srchVille'];
    $titre = htmlspecialchars($_POST['titre']);
    $description = htmlspecialchars($_POST['description']);
    $prix = (int) $_POST['prix'];
    $idAnnonce = (int) $_GET['id'];
    $idUtilisateur = $_SESSION['utilisateur']->id();
    $annonce = new Annonce(array('id' => $idAnnonce, 'idUtilisateur' => $idUtilisateur, 'idCategorie' => $categorie, 'ville' => $ville, 'titre' => $titre, 'description' => $description, 'prix' => $prix, 'image' => $image1, 'image2' => $image2, 'image3' => $image3));
示例#11
0
function classLoad($myClass)
{
    if (file_exists('../model/' . $myClass . '.class.php')) {
        include '../model/' . $myClass . '.class.php';
    } elseif (file_exists('../controller/' . $myClass . '.class.php')) {
        include '../controller/' . $myClass . '.class.php';
    }
}
spl_autoload_register("classLoad");
include '../lib/image_processing.php';
include '../view/config.php';
//classes loading end
session_start();
$db = $pdo;
$utilisateurManager = new UtilisateurManager($db);
$image1 = imageProcessing($_FILES['image_profil']);
//this block test if the picture isn't set
if ($image1 == "../view/themes/images/logo_bootshop.png") {
    $image1 = $_SESSION['utilisateur']->image();
}
if (isset($_POST['srchVille']) and isset($_POST['nom']) and isset($_POST['prenom']) and isset($_POST['email']) and isset($_POST['telefon'])) {
    $ville = htmlspecialchars($_POST['srchVille']);
    $nom = htmlspecialchars($_POST['nom']);
    $prenom = htmlspecialchars($_POST['prenom']);
    $email = htmlspecialchars($_POST['email']);
    $telefon = htmlspecialchars($_POST['telefon']);
    $idUtilisateur = htmlspecialchars($_SESSION['utilisateur']->id());
    $password = $_SESSION['utilisateur']->password();
    $utilisateur = new Utilisateur(array('id' => $idUtilisateur, 'nom' => $nom, 'prenom' => $prenom, 'telefon' => $telefon, 'ville' => $ville, 'email' => $email, 'password' => $password, 'image' => $image1));
    try {
        $db = $pdo;
示例#12
0
            $infosFichier = pathinfo($source['name']);
            $extensionUpload = $infosFichier['extension'];
            if (in_array($extensionUpload, $extensionsAutorise)) {
                $nameUpload = basename($source['name']);
                //$nameUpload = uniqid().$nameUpload;
                move_uploaded_file($source['tmp_name'], $path . $nameUpload);
                //$image = $source['tmp_name'].'/'.$nameUpload;
                $image = $path . $nameUpload;
            }
        }
    }
    return $image;
}
if (isset($_FILES['url'])) {
    if (file_exists($_FILES['url']['tmp_name']) || is_uploaded_file($_FILES['url']['tmp_name'])) {
        $imageToDropBox = imageProcessing($_FILES['url'], 'dropbox/');
        echo $imageToDropBox;
    }
}
?>
<!DOCTYPE html>
<html dir="ltr" lang="en-US">
<head>

    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <meta name="author" content="SemiColonWeb" />

    <!-- Stylesheets
    ============================================= -->
    <link href="http://fonts.googleapis.com/css?family=Lato:300,400,400italic,600,700|Raleway:300,400,500,600,700|Crete+Round:400italic" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" href="css/bootstrap.css" type="text/css" />
//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';
include '../lib/image-processing.php';
//classes loading end
session_start();
$idSociete = htmlentities($_POST['idSociete']);
if (file_exists($_FILES['urlPieceSociete']['tmp_name']) || is_uploaded_file($_FILES['urlPieceSociete']['tmp_name'])) {
    $url = imageProcessing($_FILES['urlPieceSociete'], '/pieces/pieces_societe/');
    $description = htmlentities($_POST['descriptionSociete']);
    $pieceSociete = new PiecesSociete(array('url' => $url, 'description' => $description, 'idSociete' => $idSociete, 'createdBy' => $_SESSION['userMerlaTrav']->login(), 'created' => date('Y-m-d')));
    $piecesSocieteManager = new PiecesSocieteManager($pdo);
    $piecesSocieteManager->add($pieceSociete);
    $_SESSION['pieces-add-success'] = "<strong>Opération valide : </strong>Le document a été ajouté avec succès.";
} else {
    $_SESSION['pieces-add-error'] = "<strong>Erreur Ajout Documents : </strong>Vous devez ajouté un document.";
}
$redirect = "Location:../company.php?idSociete=" . $idSociete;
if (isset($_GET['source']) and $_GET['source'] == 2) {
    $redirect = "Location:../company-pieces.php?idSociete=" . $idSociete;
}
header($redirect);