-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompte.php
More file actions
59 lines (53 loc) · 1.16 KB
/
compte.php
File metadata and controls
59 lines (53 loc) · 1.16 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
<?php
require_once 'includes/preload.php';
$controller->check_user();
$page->name = 'compte';
$page->title = 'Gestion des comptes en banque';
$action = GETPOST('action');
$id = GETPOST('id');
$object = new Account($PDOdb);
if(!empty($id)) $object->fetch($id);
$TComptes = $object->fetchAll();
switch($action) {
case 'view':
// TODO check
break;
case 'update':
$object->set_vars();
$res = $object->save();
if($res) {
header('Location:./compte.php');
} else {
echo 'Erreur, veuillez contacter l\'administrateur';
}
exit;
break;
case 'create':
$object->set_vars();
$res = $object->save();
if($res) {
header('Location:./compte.php');
} else {
echo 'Erreur, veuillez contacter l\'administrateur';
}
exit;
break;
case 'delete':
$res = $object->delete();
if($res) {
header('Location:./compte.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/compte.tpl.php';
include 'tpl/footer.tpl.php';