Plugins  LAST
 All Data Structures Files Functions Variables Pages
am_histo.inc.php
Go to the documentation of this file.
1 <?php
2 /*
3  * This file is part of NOALYSS.
4  *
5  * NOALYSS is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 2 of the License, or
8  * (at your option) any later version.
9  *
10  * NOALYSS is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with NOALYSS; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 /* $Revision$ */
20 
21 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
22 /*!\file
23  * \brief print all
24  */
25 $sql="select quick_code,a_id,ha_id,h_amount,jr_internal,h_year,h_pj,vw_name
26  from amortissement.amortissement
27  join amortissement.amortissement_histo using (a_id)
28  join vw_fiche_attr using(f_id) where h_amount > 0";
29 
30 $header=new Sort_Table();
31 $r=HtmlInput::array_to_string(array('ac','gDossier','sa','sb','plugin_code'),$_REQUEST);
32 $url=basename($_SERVER['PHP_SELF']).$r;
33 $header->add('Quick_code',$url,'order by 1 asc','order by 1 desc','qca','qcd');
34 $header->add('Nom',$url,'order by vw_name asc','order by vw_name desc','na','nd');
35 $header->add('Montant',$url,'order by h_amount asc','order by h_amount desc','aa','ad');
36 $header->add('Année',$url,'order by h_year asc','order by h_year desc','ya','yd');
37 $header->add('Pièce',$url,'order by h_pj asc','order by h_pj desc','pja','pjd');
38 $header->add('N° interne',$url,'order by jr_internal asc','order by jr_internal desc','nia','nid');
39 
40 $ord=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'na';
41 
42 $sql_ord=$header->get_sql_order($ord);
43 
44 $sql.=$sql_ord;
45 
46 if ( isset($_POST['remove']))
47  {
48  $nb_sel=count($_POST['p_sel']);
49  for ($i = 0 ; $i < $nb_sel ;$i++)
50  {
51  if ( isset($_POST['p_sel'][$i]))
52  {
53  $cn->exec_sql("update amortissement.amortissement_histo set h_amount=0,h_pj='',jr_internal=null where ha_id=$1",
54  array($_POST['p_sel'][$i]));
55  }
56  }
57  }
58 $array=$cn->get_array($sql);
59 require_once('template/listing_histo.php');
60 
$url
$header
$r
if(isset($_POST['remove'])) $array
$sql_ord
$_REQUEST['sb']
Definition: am_print.php:39
$sql
$ord
global $cn