-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcancella_anno_sociale.php
54 lines (43 loc) · 1.99 KB
/
cancella_anno_sociale.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
<?php
/*======================================================================+
File name : cancella_anno_sociale.php
Begin : 2012-12-29
Last Update : 2013-01-13
Description : delete social year
Author: Sergio Capretta
(c) Copyright:
Sergio Capretta
ITALY
www.sinx.it
Sinx for Association - Gestionale per Associazioni no-profit
Copyright (C) 2011 by Sergio Capretta
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
=========================================================================+
*/
session_start();
$user = $_SESSION['utente'];
if ($user) {
include ('./dati_db.inc');
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$tabelle = array('tb_primanota','tb_ricevute','tb_fatture','tb_tot_fatture');
foreach($tabelle as $tabella)
mysql_query("truncate $tabella") or die(header('location: ./errore.html'));//"<b>Errore:</b> Impossibile eseguire la query della Combo"
$tabelle2 = array('tb_conto_economico','tb_stato_patrimoniale');
foreach($tabelle2 as $tabella)
mysql_query("UPDATE $tabella SET valore='0'") or die(header('location: ./errore.html'));//"<b>Errore:</b> Impossibile eseguire la query della Combo"
header('location: ./conferma.html'); //Vado alla pagina di conferma
} else {
header('Location: ./index.php');
}
?>