-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
53 lines (48 loc) · 1.7 KB
/
index.php
File metadata and controls
53 lines (48 loc) · 1.7 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
<?php
require_once 'includes/preload.php';
$page->TJavascript[] = 'js/sph-index.js';
$page->TJavascript[] = 'js/huebee.pkgd.min.js';
$page->TCss[] = 'css/huebee.css';
$controller->check_user();
$page->name = 'index';
$page->title = 'Accueil - SPH Gestion des Adhérents';
$session = new Session($PDOdb);
$TFullSessions = $session->fetchAllFull(1);
$TNotFullSessions = $session->fetchAllFull(0);
$TEmptySessions = $session->fetchAllFull(-1);
$adherent = new Adherent($PDOdb);
$TAdherents = $adherent->fetchAllFor(array(array('column'=>'statut', 'operator'=>'>','value'=>'0')));
$TNewAdherents = $adherent->fetchAllFor(array(array('column'=>'statut', 'operator'=>'=','value'=>'0')));
$TLastAdherents = $adherent->fetchAllLast();
$TNotPaidAdherents = $adherent->fetchAllFor(array(array('column'=>'statut', 'operator'=>'=','value'=>'1')));
$coach = new User($PDOdb);
$TCoachs = $coach->fetchAll();
switch ($action) {
case 'new' :
$payment->set_vars();
$payment->save();
header('Location:./index.php?id=' . $id . '&year=' . $year . '&posy=' . $posy);
break;
case 'edit' :
$payment->set_vars();
if (! empty($payment->status) && ($payment->datep == '1970-01-01' || empty($payment->datep))) $payment->status = 0;
$payment->save();
//var_dump($_POST);exit;
header('Location:./index.php?id=' . $id . '&year=' . $year . '&posy=' . $posy);
break;
case 'delete' :
$payment->set_vars();
$payment->delete();
header('Location:./index.php?id=' . $id . '&year=' . $year . '&posy=' . $posy);
break;
default :
$action = 'view';
break;
}
// Cas vue interface pour login
if ($action == 'view') {
include 'tpl/header.tpl.php';
include 'tpl/menu.tpl.php';
include 'tpl/index.tpl.php';
include 'tpl/footer.tpl.php';
}