Plugins  LAST
 All Data Structures Files Functions Variables Pages
ajax_mod_key.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 modifie clef
27  *
28  */
29 $key=$cn->get_array("SELECT cr_name, cr_note,cr_tantieme
30  FROM coprop.clef_repartition where cr_id=$1",array($key_id));
31 
32 $str_message="Modification ".h($key[0]['cr_name']);
33 
34 $note=new ITextarea('cr_note');
35 $note->value=$key[0]['cr_note'];
36 
37 $note->heigh=6;
38 $note->width=80;
39 $note->style='style="border:solid blue 1px;vertical-align:text-top;" ';
40 
41 $name=new IText('cr_name');
42 $name->value=$key[0]['cr_name'];
43 $name->size=60;
44 
45 $tantieme=new INum('cr_tantieme');
46 $tantieme->javascript='onchange="format_number(this,0);compute_key();"';
47 $tantieme->value=round($key[0]['cr_tantieme']);
48 
49 $alot=$cn->get_array("select lot_fk as f_id,
50  (select ad_value from fiche_detail where f_id=lot_fk and ad_id=1) as name,
51  (select ad_value from fiche_detail where f_id=lot_fk and ad_id=23) as qcode,
52  (select ad_value from fiche_detail where f_id=lot_fk and ad_id=9) as desc,
53  crd_amount as l_part
54  from
55  coprop.clef_repartition_detail
56  where cr_id=$1
57  union
58 select
59 f_id,vw_name as name,quick_code as qcode,vw_description as desc, 0 as l_part
60  from vw_fiche_attr where fd_id=$2
61  and f_id not in (select lot_fk from coprop.clef_repartition_detail where cr_id=$1)",array($key_id,$g_copro_parameter->categorie_lot));
62 
63 $init_tantieme=$cn->get_value("select sum(crd_amount) from
64  coprop.clef_repartition_detail
65  where cr_id=$1",array($key_id));
66 
67 echo '<form id="fkey" method="post">';
68 echo HtmlInput::hidden('cr_id',$key_id);
69 require_once 'template/key_detail.php';
70 echo HtmlInput::submit("mod_key","Modifier",' onclick="return confirm (\'Vous confirmez?\')"');
71 echo HtmlInput::button('rlist','Retour liste',' onclick="$(\'key_list\').show();$(\'keydetail_div\').hide()"');
72 echo '</form>';
73 ?>
$init_tantieme
$name
$alot
global $g_copro_parameter
$str_message
$key
$note
$tantieme
global $cn