Plugins  LAST
 All Data Structures Files Functions Variables Pages
key.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 gestion des clefs de répartitions
27  *
28  */
29 require_once 'class_copro_key.php';
30 global $cn,$gDossier;
31 
32 // ajout nouvelle clef
33 if ( isset($_POST['add_key']))
34 {
35  /**
36  * @todo ajout verification double chargement
37  */
38  $a=new Copro_key();
39  $a->insert($_POST);
40 }
41 
42 // Mise à jour
43 if ( isset($_POST['mod_key']))
44 {
45  $a=new Copro_key();
46  $a->cr_id=$_POST['cr_id'];
47  $a->update($_POST);
48 }
49 
50 
51 $sql="select cr_id,cr_name,cr_note,cr_tantieme,
52  coalesce( (select sum(crd_amount) from
53  coprop.clef_repartition_detail as crd
54  where crd.cr_id=cr.cr_id) ,0) as delta
55  from
56  coprop.clef_repartition as cr
57  order by cr_name";
58 
59 $a_key=$cn->get_array($sql);
60 ?>
61 <div id="key_list">
62 <table class="result">
63  <tr>
64  <th>
65  Nom
66  </th>
67  <th>
68  Note
69  </th>
70  <th>
71  Tantième
72  </th>
73  <th>
74  Différence
75  </th>
76  <th>
77 
78  </th>
79  </tr>
80 <?php
81 for ($i=0;$i < count($a_key);$i++):
82  $js=sprintf("mod_key('%s','%s','%s','%s')",$gDossier,$_REQUEST['plugin_code'],$_REQUEST['ac'],$a_key[$i]['cr_id']);
83  $mod_key=HtmlInput::anchor($a_key[$i]['cr_name'],"","onclick=\"$js\"");
84 ?>
85  <tr id="row<?php echo $a_key[$i]['cr_id']?>">
86  <td>
87  <?php echo $mod_key?>
88  </td>
89  <td>
90  <?php echo h($a_key[$i]['cr_note'])?>
91  </td>
92  <td class="num">
93  <?php echo nbm($a_key[$i]['cr_tantieme'])?>
94  </td>
95  <td class="num">
96  <?php echo nbm($a_key[$i]['delta'])?>
97  </td>
98  <td id="col<?php echo $a_key[$i]['cr_id']?>">
99  <?php
100  $js="onclick=remove_key('".$_REQUEST['plugin_code']."','".$_REQUEST['ac']."','".$_REQUEST['gDossier']."','".$a_key[$i]['cr_id']."')";
101  echo HtmlInput::anchor("enlever","",$js);
102  ?>
103  </td>
104 
105  </tr>
106 <?php
107 endfor;
108 ?>
109 </table>
110  <?php $js=sprintf("add_key('%s','%s','%s')",$gDossier,$_REQUEST['plugin_code'],$_REQUEST['ac']);
111  echo HtmlInput::button("add_key","Ajout clef","onclick=\"$js\"");
112  ?>
113  </div>
114 
115 
116 <div id="keydetail_div"></div>
endfor
global $cn
Definition: key.inc.php:29
$mod_key
Definition: key.inc.php:83
global $gDossier
Definition: key.inc.php:29
$a_key
Definition: key.inc.php:59
if(isset($_POST['add_key'])) if(isset($_POST['mod_key'])) $sql
Definition: key.inc.php:51
$categorie_appel table
$_REQUEST['sb']
Definition: am_print.php:39