コード例 #1
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';
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);
コード例 #2
0
<?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
$idSociete = htmlentities($_POST['idSociete']);
$idPiece = htmlentities($_POST['idPiece']);
$piecesManager = new PiecesSocieteManager($pdo);
$piecesManager->delete($idPiece);
$_SESSION['pieces-delete-success'] = "<strong>Opération valide : </strong>Le document est supprimé avec succès.";
header('Location:../company-pieces.php?idSociete=' . $idSociete);
コード例 #3
0
ファイル: company-pieces.php プロジェクト: aassou/gelm
    } 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'])) {
    //les sources
    $idSociete = 0;
    $societeManager = new SocieteManager($pdo);
    if (isset($_GET['idSociete']) and $_GET['idSociete'] > 0 and $_GET['idSociete'] <= $societeManager->getLastId()) {
        $idSociete = $_GET['idSociete'];
        $societe = $societeManager->getSocieteById($idSociete);
        $piecesSocieteManager = new PiecesSocieteManager($pdo);
        $piecesSociete = $piecesSocieteManager->getPiecesSocietesByIdSociete($idSociete);
    }
    ?>
<!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" />