noalyss Version-9
anc_key.inc.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS isfree software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * NOALYSS isdistributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright 2014 Author Dany De Bontridder ddebontridder@yahoo.fr
21
22/**
23 * @file
24 * @brief manage distribution keys for Analytic accountancy, this file is called by
25 * do.php
26 * @see do.php
27 *
28 */
29if (!defined('ALLOWED'))
30 die('Appel direct ne sont pas permis');
31global $cn, $g_user;
32global $http;
33
34$op=$http->request("op", "string", "list");
35switch ($op)
36{
37 case 'list':
40 break;
41 case 'consult':
42 try
43 {
44 $id=$http->request("key", "number");
45 $key=new Anc_Key($id);
46 if (isset($_POST['save_key']))
47 {
48 $key->save($_POST);
51
52 break;
53 }
54 $key->input();
55 }
56 catch (Exception $e)
57 {
59 echo span($e->getMessage(), ' class="warning"');
62 }
63 break;
64 case 'delete_key':
65 try
66 {
67 $id=$http->request("key", "number");
68 $key=new Anc_Key($id);
69 $key->delete();
70 }
71 catch (Exception $e)
72 {
73 echo span($e->getMessage(), ' class="warning"');
74 }
77}
78?>
span($p_string, $p_extra='')
Definition: ac_common.php:43
record_log($p_message)
Record an error message into the log file of the server.
Definition: ac_common.php:1342
global $http
Definition: anc_key.inc.php:32
global $g_user
Definition: anc_key.inc.php:31
global $cn
Definition: anc_key.inc.php:31
$op
Definition: anc_key.inc.php:34
Class to manage distribution keys for Analytic accountancy.
static display_list()
display a list of keys, choose one to modify it
static key_add()
show a form for adding a key + button to display it
$_POST['ac']
Definition: do.php:310