Plugins  LAST
 All Data Structures Files Functions Variables Pages
material_add.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 
23 /*!\file
24  * \brief add material
25  */
26 $date=new IDate('p_date');
27 $p_year=new INum('p_year');
28 $p_number=new INum('p_number');
29 $p_card=new ICard('p_card');
30 $p_date=new IDate('p_date');
31 $p_card->size=25;
32 $list=$cn->make_list('select fd_id from fiche_def where frd_id=7');
33 if ( $list == '')
34  {
35 
36  echo h2info(_('Matériel à amortir'));
37  echo h2(_('Attention pas de catégorie de fiche à amortir'),'class="error"');
38  }
39 else
40  {
41  $p_date->value=HtmlInput::default_value_post('p_date',"");
42  $p_year->value=HtmlInput::default_value_post('p_year',"");
43  $p_number->value=HtmlInput::default_value_post('p_number',"");
44 
45  $p_card->set_attribute('typecard',$list);
46  $p_card->set_attribute('label','p_card_label');
47  $p_card->javascript=sprintf(' onchange="fill_data_onchange(\'%s\');" ',
48  $p_card->name);
49  $p_card->set_function('fill_data');
50  $p_card->set_dblclick("fill_ipopcard(this);");
51  $p_card->value=HtmlInput::default_value_post('p_card','');
52 
53  $p_deb=new IPoste('p_deb');
54  $p_deb->set_attribute('jrn',0);
55  $p_deb->set_attribute('account','p_deb');
56  $p_deb->set_attribute('label','p_deb_label');
57  $deb_span=new ISpan('p_deb_label');
58  $p_deb->value=HtmlInput::default_value_post('p_deb','');
59 
60  $p_cred=new IPoste('p_cred');
61  $p_cred->set_attribute('jrn',0);
62  $p_cred->set_attribute('account','p_cred');
63  $p_cred->set_attribute('label','p_cred_label');
64  $p_cred->value=HtmlInput::default_value_post('p_cred','');
65 
66  $cred_span=new ISpan('p_cred_label');
67 
68  $p_amount=new INum('p_amount');
69  $p_amount->value=HtmlInput::default_value_post('p_amount','');
70 
71  $p_card_deb=new ICard('p_card_deb');
72  $p_card_deb->typecard = "all";
73  $p_card_deb->value=HtmlInput::default_value_post('p_card_deb','');
74 
75  $p_card_cred=new ICard('p_card_cred');
76  $p_card_cred->set_attribute('typecard'," select fd_id from fiche_def where frd_id=".FICHE_TYPE_MATERIAL);
77  $p_card_cred->value=HtmlInput::default_value_post('p_card_cred','');
78 
79  $select_type=new ISelect('type');
80  $select_type->id='select_type_id';
81  $select_type->value=array(array('label'=>'--Faites un choix --','value'=>-1),
82  array('label'=>'Poste comptable','value'=>'0'),
83  array('label'=>'Fiche','value'=>'1')
84  );
85 
86  $select_type->selected=HtmlInput::default_value_post('type','-1');
87 
88  $select_type->javascript=' onchange = "show_selected_material(this);"';
89  require_once ('template/material_add.php');
90  }
91  ?>
92 <script>
93 show_selected_material($('select_type_id'));
94 
95 </script>
$select_type
$p_card_deb
$cred_span
function show_selected_material(obj)
$p_card_cred
global $cn