-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomptabilite.php
More file actions
62 lines (56 loc) · 1.44 KB
/
comptabilite.php
File metadata and controls
62 lines (56 loc) · 1.44 KB
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
61
62
<?php
require_once 'includes/preload.php';
$controller->check_user();
$page->name = 'comptabilite';
$page->title = 'Gestion des catégories comptables';
$action = GETPOST('action');
$id = GETPOST('id');
$is_parent = GETPOST('is_parent');
$object = new ComptaCateg($PDOdb);
if(!empty($id)) $object->fetch($id);
$TComptes = $object->fetchParents();
$TNotAllowed = array(TRESO_CA_CATEG_ID, TRESO_EX_CATEG_ID, TRESO_CH1_CATEG_ID, TRESO_CH2_CATEG_ID);
$deleteRight = (!in_array($id, $TNotAllowed));
switch($action) {
case 'view':
// TODO check
break;
case 'update':
$object->set_vars();
$res = $object->save();
if($res) {
header('Location:./comptabilite.php');
} else {
echo 'Erreur, veuillez contacter l\'administrateur';
}
exit;
break;
case 'create':
$object->set_vars();
$res = $object->save();
if($res) {
header('Location:./comptabilite.php');
} else {
echo 'Erreur, veuillez contacter l\'administrateur';
}
exit;
break;
case 'delete':
$res = $object->delete();
if($res) {
header('Location:./comptabilite.php');
} else {
echo 'Erreur, veuillez contacter l\'administrateur';
}
break;
case 'new':
case 'edit':
break;
default:
$action = 'sumary';
break;
}
include 'tpl/header.tpl.php';
include 'tpl/menu.tpl.php';
include 'tpl/comptabilite.tpl.php';
include 'tpl/footer.tpl.php';