forked from strk/sinx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathInsProgetto.php
285 lines (236 loc) · 8.48 KB
/
InsProgetto.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<?php
/*======================================================================+
File name : InsProgetto.php
Begin : 2013-08-05
Last Update : 2013-08-06
Description : Compilation Association's Project
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 == 'admin') {
$limit='';
} else if ($user == 'limitato') {
$limit='disabled';
}
include('./top.inc');
include('./menu.inc');
include ('./dati_db.inc');
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
//Recupero l'ultimo id della tabella
$Query = "SELECT id FROM tb_tot_progetto ORDER BY id DESC LIMIT 1";
$Qultimoid = mysql_query($Query);
$ultimoid=mysql_fetch_row($Qultimoid)
?>
<center><h3>Creazione e gestione progetti</h3></center>
<!-- Per Stampare progetti -->
<p><center><b>Stampa Progetto</b></center></p>
<form action='./stampa_progetto.php' method='POST'>
<table align='center' border='0' width='45%'>
<tr>
<td width='80%'><font color="red">Numero Progetto *:</td>
<td><select name="numero" >
<option value="" selected="selected"></option>
<?php
$query = "SELECT id
FROM tb_tot_progetto
ORDER BY id";
$rs=mysql_query($query)
or die("<b>Errore:</b> Impossibile eseguire la query della Combo");
while ($row=mysql_fetch_row($rs))
{
echo "<option>" .$row["0"]. "</option>";
}
?>
</select></td>
<td colspan='2' align='center'>
<input value='- Stampa progetto -' type='submit' <? echo($limit); ?>></td>
</tr>
</table>
</form>
<hr style="width: 90%; height: 2px;">
<!-- Registrare progetto in primanota-->
<p><center><b>Registra e chiudi Progetto</b></center></p>
<form action='./chiusura_progetto.php' method='POST'>
<table align='center' border='0' width='70%'>
<tr>
<td width='150'><font color="red">Voce Conto economico*:</td>
<td colspan='2'>
<p><center>
<select name="contoec" >
<option value="" selected="selected">Causale</option>
<?php
$query = "SELECT descrizione FROM tb_conto_economico";
$rs=mysql_query($query)
or die("<b>Errore:</b> Impossibile eseguire la query della Combo");
while ($row=mysql_fetch_row($rs))
{
echo "<option>" .$row["0"]. "</option>";
}
?>
</center></p><br><small><sub><i>Inserire la causale</small></i></sub></td>
</tr>
<tr>
<td><font color="red">Numero Progetto *:</td>
<td ><select name="id" >
<option value="" selected="selected"></option>
<?php
$query = "SELECT id
FROM tb_tot_progetto
ORDER BY id";
$rs=mysql_query($query)
or die("<b>Errore:</b> Impossibile eseguire la query della Combo");
while ($row=mysql_fetch_row($rs))
{
echo "<option>" .$row["0"]. "</option>";
}
?>
</select></td>
<td>
<fieldset>
<legend><small>Incasso in:</small></legend>
<small>Cassa</small><input type="radio" name="incasso" value="cassa" checked="checked"/>
<small>Banca</small><input type="radio" name="incasso" value="banca"/>
</fieldset>
</td>
<td colspan='2' align='center'>
<input value='- Registra -' type='submit' <? echo($limit); ?>></td>
</tr>
</table>
</form>
<hr style="width: 80%; height: 2px;">
<!-- Compilazione nuov progetto o gestione -->
<p align="center"><b>Nuovo Progetto</b></p>
<center><small>I campi contrassegnati con l'asterisco sono obbligatori</small></center>
<br>
<form action='./conf_dati_progetto.php' method='POST'>
<table align='center' border='0' width='80%'>
<tbody>
<tr>
<td width='30%'>N.ro Progetto:</td>
<td><? echo(($ultimoid["0"])+1); ?></td><td width='30%'><font color="red">Associato di riferimento *:</td>
</tr>
<td width='30%'>Descrizione Progetto:</td>
<td><textarea name='formcontent' rows="3" cols="60"></textarea></td>
<td width='80%' VALIGN="top"><select name="nome" >
<option value="" selected="selected"></option>
<?php
$query = "SELECT nome FROM tb_anagrafe ORDER BY nome";
$rs=mysql_query($query)
or die("<b>Errore:</b> Impossibile eseguire la query della Combo");
while ($row=mysql_fetch_row($rs))
{
echo "<option>" .$row["0"]. "</option>";
}
?>
</select></td>
</tr>
<tr>
<td width='30%'>Data:</td>
<td width='20%'><small><input name='data' size='10' type='text' value=<?php echo date('d-m-Y') ?>></small></td><td></td>
</tr>
</table>
<!-- <br><br><br><br><br>
<table align='center' border='0' width='80%'>
<tbody>
<tr>
<td height='25px' width='50%'><small>Descrizione</small></td>
<td height='25px' width='10%'><small>Quantità</small></td>
<td height='25px' width='30%'><small>Prezzo un.</small></td>
<td height='25px' width='10%'><small>Iva %</small></td>
</tr>
</table>
<table align='center' border='0' width='80%'>
<tr>
<td><input name='Descr' size='42%' type='text'></td>
<td><input name='Qta' size='5%' type='text'></td>
<td><input name='prezzoun' size='22%' type='text'></td>
<td><input name='iva' size='8%' type='text'></td>
</tr>
</table>
<p><center><small>Per inserire più voci nella stessa fattura, basta inserire lo stesso numero di fattura, il programma inserirà in coda la voce e calcolerà automaticamente il totale</small></center></p> -->
<table align='center' border='0' width='30%'>
<tr>
<td colspan='2' align='center'>
<input value='- Crea Progetto -' type='submit' <? echo($limit); ?>></td>
</tr>
</tbody>
</table>
</form>
<!-- Per Visualizzare e modificare Progetto -->
<hr style="width: 60%; height: 2px;">
<p><center><b>Gestione Progetti</b></center></p>
<form action='./visual_progetto.php' method='POST'>
<table align='center' border='0' width='45%'>
<tr>
<td width='80%'><font color="red">Numero Progetto *:</td>
<td><select name="numero" >
<option value="" selected="selected"></option>
<?php
$query = "SELECT id
FROM tb_tot_progetto
ORDER BY id";
$rs=mysql_query($query)
or die("<b>Errore:</b> Impossibile eseguire la query della Combo");
while ($row=mysql_fetch_row($rs))
{
echo "<option>" .$row["0"]. "</option>";
}
?>
</select></td>
<td colspan='2' align='center'>
<input value='- Vai al Progetto -' type='submit'></td>
</tr>
</table>
</form>
<p><center><small>Da qui è possibile visualizzare i dettagli per singolo Progetto e modificare</small></center></p>
<hr style="width: 40%; height: 2px;">
<!-- popolo la tabella progetti -->
<p align="center"><small><b>Elenco Progetti</b></small></p>
<table class='bordo' align='center' cellpadding='0' cellspacing='0' width='60%'>
<tr>
<td height='25px' width='10%' align='center'><small><b>num</b></small></td>
<td width='10%'><small><b>data</b></small></td>
<td width='30%'><small><b>nome riferimento</b></small></td>
<td width='40%'><small><b>descrizione</b></small></td>
</tr>
<?php
$Query = "SELECT * FROM tb_tot_progetto ORDER BY id";
$rs=mysql_query($Query)
or die('' . mysql_error());
while ($row=mysql_fetch_array($rs))
{
echo <<<EOM
<tr>
<td height='25px' align='center'><small>$row[id]</small></td>
<td height='25px'><small>$row[data]</small></td>
<td height='25px'><small>$row[nome]</small></td>
<td height='25px'><small>$row[descrizione]</small></td>
</tr>
EOM;
}
echo <<<EOT
</table><p></p>
EOT;
mysql_close();
include('./menusx.inc');
include('./botton.inc');
?>