noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
customer.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/**
21 * \file
22 * \brief include from and concerned only the customer card and
23 * the customer category
24 */
25if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
27
28
29$low_action = $http->request("sb","string","list");
30/** \file
31 * \brief Called from the module "Gestion" to manage the customer
32 */
33$href=basename($_SERVER['PHP_SELF']);
34
35// by default open liste
36if ($low_action == "")
37 $low_action = "list";
38
39
40//-----------------------------------------------------
41// Remove a card
42//-----------------------------------------------------
43if (isset($_POST['action_fiche']))
44{
45 if ( $_POST['action_fiche'] == 'delete_card')
46 {
47 if ($g_user->check_action(FICADD) == 0)
48 {
49 alert(j(_('Vous ne pouvez pas enlever de fiche')));
50 return;
51 }
52
53 $f_id = $http->request('f_id',"number");
54
55 $fiche = new Customer($cn, $f_id);
56 $fiche->remove();
57 $low_action = "list";
58 }
59}
60
61//-----------------------------------------------------
62// list of customer
63//-----------------------------------------------------
64if ($low_action == "list")
65{
66 ?>
67 <div class="content">
68 <div>
69 <?php
70
71 Customer::form_search($href, FICHE_TYPE_CLIENT);
72
73 ?>
74 </div>
75 <?php
76 $client = new Customer($cn);
77 $search=$http->get("query","string","");
78 $sql = "";
79 if (isset($_GET['cat']))
80 {
81 $cat=$http->get("cat","number");
82 if ($cat!= -1)
83 $sql = sprintf(" and fd_id = %s", $cat);
84 }
85 $noop = (isset($_GET['noop'])) ? false : true;
86 echo '<div class="content">';
87 echo $client->Summary($search, 'customer', $sql, $noop);
88
89
90 echo '<br>';
91 echo '<br>';
92 echo '<br>';
93 /* Add button */
94 $f_add_button = new IButton('add_card');
95 $f_add_button->class="smallbutton";
96 $f_add_button->label = _('Créer une nouvelle fiche');
97 $f_add_button->set_attribute('ipopup', 'ipop_newcard');
98 $f_add_button->set_attribute('win_refresh', 'yes');
99// $list=$cn->make_list("select fd_id from fiche_def where frd_id=$1",array(FICHE_TYPE_CLIENT));
100 $f_add_button->set_attribute('type_cat', FICHE_TYPE_CLIENT);
101 $f_add_button->javascript = " select_card_type(this);";
102 echo $f_add_button->input();
103
104 $f_cat_button=new IButton('add_cat');
105 $f_cat_button->set_attribute('ipopup','ipop_cat');
106 $f_cat_button->set_attribute('type_cat',FICHE_TYPE_CLIENT);
107 $f_cat_button->label=_('Ajout d\'une catégorie');
108 $f_cat_button->javascript='add_category(this)';
109 echo $f_cat_button->input();
110
111 echo '</div>';
112 echo '</div>';
113
114
115}
116/*----------------------------------------------------------------------
117 * Detail for a card, Suivi, Contact, Operation,... *
118 * cc stands for customer card
119 *----------------------------------------------------------------------*/
120if ( $low_action == 'detail')
121{
122 /* Menu */
123 require_once NOALYSS_INCLUDE.'/category_card.inc.php';
124 return;
125}
126
128?>
html_page_stop()
end tag
j($p_string)
escape correctly php string to javascript
Definition ac_common.php:96
alert($p_msg, $buffer=false)
alert in javascript
global $g_user
if no group available , then stop
$low_action
Definition adm.inc.php:27
$href
Definition adm.inc.php:31
if(trim($query)==''|| $filter=='') $search
_("actif, passif,charge,...")
$_GET['qcode']
class Customer are a specific kind of card
manage the http input (get , post, request) and extract from an array
Html Input.
const FICHE_TYPE_CLIENT
Definition constant.php:259
const FICADD
$_POST['ac']
Definition do.php:323