-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathimpressionChangementStatut.php
60 lines (47 loc) · 1.05 KB
/
impressionChangementStatut.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
error_reporting(E_ALL);
require_once("class.authentification.php");
require_once("class.demandeListe.php");
require_once("class.demande.php");
require_once("class.log.php");
require_once("class.validation.php");
$objAuth = authentification::instance();
#$objLog = log::instance();
#$objvalid= validation::instance();
if (getParam('logout') == '1')
{
session_destroy();
header("Location: auth.php");
exit();
}
if (!$objAuth->estIdentifie())
{
header("Location: auth.php");
exit();
}
$objDemande = new demande();
$objDemande->ouvrir(getParam('id'));
$objDemande->setStatus(DEMANDE_STATUS_IMPRIME);
if ($objDemande->sauvegarde())
{
printn("Le statut est maintenant : imprimé.<br><br>Vous pouvez fermer la fenetre.");
}
else
{
printn("Erreur! Impossible de changer le statut!");
}
exit(0);
function getParam($param)
{
if (isset($_POST[$param]))
{
return $_POST[$param];
}
if (isset($_GET[$param]))
{
return $_GET[$param];
}
return null;
}
function printn ($txt) { print $txt."\n"; }
?>