noalyss Version-9
bank.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// Copyright Author Dany De Bontridder danydb@aevalys.eu
20/*!\brief include from supplier.inc.php and concerned only the supplier card and
21 * the supplier category
22 */
23if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
24global $g_user , $http;
25
26$low_action=$http->request('sb',"string",'list');
27/*! \file
28 * \brief Called from the module 'Gestion' to manage the supplier
29 */
30$href=basename($_SERVER['PHP_SELF']);
31
32// by default open liste
33if ( $low_action == '' )
34 $low_action='list';
35
36
37//-----------------------------------------------------
38// Remove a card
39//-----------------------------------------------------
40if ( isset($_POST['delete_card'] ) )
41{
42 if ( $g_user->check_action(FICADD) == 0 )
43 {
44 alert(_('Vous ne pouvez pas enlever de fiche'));
45 return;
46 }
47
48 $f_id = $http->request('f_id','number');
49
50 $fiche=new Bank($cn,$f_id);
51 $fiche->remove();
52 $low_action="list";
53
54}
55
56//-----------------------------------------------------
57// list of supplier
58//-----------------------------------------------------
59if ( $low_action == "list" )
60{
61
62 ?>
63 <div class="content">
64 <div>
65 <form method="get" action="<?php echo $href; ?>">
66 <?php
67 echo dossier::hidden();
68 echo '<h2>' ._( "Exercice")." " . $g_user->get_exercice() . '</h2>';
69 $a=$http->get("query","string","");
70 echo _("Cherche ").HtmlInput::filter_table_form("tiers_tb", '0,1,2', 1,"query",$a);
71
72 $choice_cat=$http->request("choice_cat", "string",1);
73
74 if ( $choice_cat == 1 )
75 {
76 $sel_card=new ISelect('cat');
77 $sel_card->value=$cn->make_array('select fd_id, fd_label from fiche_def '.
78 ' where frd_id=$1'.
79 ' order by fd_label ',1,array(FICHE_TYPE_FIN));
80 $sel_card->selected=$http->get("cat","number",-1);
81 $sel_card->javascript=' onchange="waiting_box();submit(this);"';
82 echo _('Catégorie :').$sel_card->input();
83 }
84 else
85 {
86 $cat=$http->request('cat',"string", '');
87 echo HtmlInput::hidden("cat", $cat);
88 echo HtmlInput::hidden('choice_cat', 0);
89 }
90 $nooperation=new ICheckBox('noop');
91 $nooperation->selected=(isset($_GET['noop']))?true:false;
92 echo _('Inclure les banques sans opération :').$nooperation->input();
93
94 ?>
95 <input type="submit" class="button" name="submit_query" value="<?php echo _('recherche')?>">
96 <input type="hidden" name="ac" value="<?php echo $_REQUEST['ac']?>">
97 </form>
98 </div>
99 <?php
100 $supplier=new Bank($cn);
101 $search=$http->get("query","string","");
102 $sql="";
103 if ( isset($_GET['cat']))
104 {
105 $cat=$http->get("cat","number");
106 if ($cat!= -1 ) $sql = sprintf(" and fd_id = %s", $cat);
107 }
108 $noop=(isset($_GET['noop']))?false:true;
109
110 echo '<div class="content">';
111 echo $supplier->Summary($search,'bank',$sql,$noop);
112
113
114 echo '<br>';
115 echo '<br>';
116 echo '<br>';
117 if ($g_user->check_action(FICADD)==1)
118 {
119 /* Add button */
120 $f_add_button=new IButton('add_card');
121 $f_add_button->label=_('Créer une nouvelle fiche');
122 $f_add_button->set_attribute('win_refresh','yes');
123
124 $f_add_button->set_attribute('type_cat',FICHE_TYPE_FIN);
125 $f_add_button->javascript=" select_card_type(this);";
126 echo $f_add_button->input();
127
128 $f_cat_button=new IButton('add_cat');
129 $f_cat_button->set_attribute('type_cat',FICHE_TYPE_FIN);
130 $f_cat_button->set_attribute('ipopup','ipop_cat');
131 $f_cat_button->label=_('Ajout d\'une catégorie');
132 $f_cat_button->javascript='add_category(this)';
133 echo $f_cat_button->input();
134 }
135
136 echo '</div>';
137 echo '</div>';
138
139
140}
141/*----------------------------------------------------------------------
142 * Detail for a card, Suivi, Contact, Operation,... *
143 * cc stands for supplier card
144 *----------------------------------------------------------------------*/
145if ( $low_action == 'detail')
146{
147 /* Menu */
148 require_once('category_card.inc.php');
149 return;
150}
151
152
153
155?>
html_page_stop()
end tag
Definition: ac_common.php:468
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:738
$from_poste name
$input_from type
Definition: balance.inc.php:65
$low_action
Definition: bank.inc.php:26
global $http
Definition: bank.inc.php:24
global $g_user
Definition: bank.inc.php:24
$href
Definition: bank.inc.php:30
$_GET['qcode']
class admin are a specific kind of card
Definition: bank.class.php:34
static hidden($p_name, $p_value, $p_id="")
Html Input.
Html Input.
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
const FICHE_TYPE_FIN
Definition: constant.php:250
const FICADD
$_POST['ac']
Definition: do.php:310