Plugins  LAST
 All Data Structures Files Functions Variables Pages
lot.inc.php
Go to the documentation of this file.
1 <?php
2 
3 /*
4  * This file is part of NOALYSS.
5  *
6  * NOALYSS is free 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 is distributed 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 /* $Revision$ */
21 
22 // Copyright (c) 2002 Author Dany De Bontridder dany@alchimerys.be
23 
24 /**
25  * @file
26  * @brief liaison entre lot et copropriétaires
27  *
28  */
30 
31 //require_once 'include/class_coprop-lot_coprop.php';
32 /* Add button */
33 $f_add_button=new IButton('add_card');
34 $f_add_button->label=_('Créer une nouvelle fiche');
35 $f_add_button->set_attribute('ipopup','ipop_newcard');
36 $f_add_button->set_attribute('jrn',-1);
37 $filter=$g_copro_parameter->categorie_lot.",".$g_copro_parameter->categorie_coprop.",".$g_copro_parameter->categorie_immeuble;
38 $f_add_button->javascript=" this.filter='$filter';this.jrn=-1;select_card_type(this);";
39 
40 
41 
42 /**
43  * @todo ajouter tri
44  */
45 
46 // liste Immeuble
47 
48 $a_immeuble=$cn->get_array(" select f_id,vw_name,quick_code
49  from vw_fiche_attr
50  where
51  fd_id=$1
52  ",array($g_copro_parameter->categorie_immeuble));
53 
54 /*
55  * Liste coprop par immeuble
56  */
57 $coprop=$cn->prepare("coprop"," select distinct coprop_id,
58  vw_name as copro_name,
59  vw_first_name as copro_first_name,
60  quick_code as copro_qcode
61  from
62  coprop.summary as s join vw_fiche_attr on (coprop_id::numeric=f_id)
63  where
64  coalesce(s.building_id,'')=$1
65  ");
66 /*
67  * Liste coprop par immeuble
68  */
69 $lot=$cn->prepare("lot"," select distinct lot_id,
70  vw_name as lot_name,
71  quick_code as lot_qcode,
72  vw_description as lot_desc
73  from
74  coprop.summary as s join vw_fiche_attr on (lot_id::numeric=f_id)
75  where
76  coalesce(s.building_id,'')=$1 and coalesce(s.coprop_id,'')=$2
77  ");
78 /*
79  * Lot sans immeuble or coprop
80  */
81 $a_undef_lot=$cn->get_array(" select lot_id,
82  vw_name as lot_name,
83  quick_code as lot_qcode,
84  vw_description as lot_desc
85  from
86  coprop.summary as s join vw_fiche_attr on (lot_id::numeric=f_id)
87  where
88  coalesce(s.building_id,'')='' or coalesce(s.coprop_id,'')=''
89  or coalesce(s.building_id,'') not in (select building_id from coprop.summary)
90  or coalesce(s.coprop_id,'') not in (select coprop_id from coprop.summary)
91  ");
92 
93 echo $f_add_button->input();
94 
95 require_once 'template/coprop_lot_list.php';
96 
97 echo $f_add_button->input();
98 
99 ?>
$coprop
Definition: lot.inc.php:57
$a_immeuble
Definition: lot.inc.php:48
$a_undef_lot
Definition: lot.inc.php:81
$filter
Definition: lot.inc.php:37
global $cn
Definition: lot.inc.php:29
$lot
Definition: lot.inc.php:69
$f_add_button
Definition: lot.inc.php:33
global $g_copro_parameter
Definition: lot.inc.php:29