noalyss Version-9
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
stock_cfg.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
21// Copyright Author Dany De Bontridder danydb@aevalys.eu
22
23/**
24 * @file
25 * @brief Manage the repository
26 *
27 */
28if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
29require_once NOALYSS_INCLUDE.'/database/stock_sql.class.php';
30
32
33if ($g_parameter->MY_STOCK == 'N')
34{
35 echo '<h2 class="notice">';
36 echo _("Vous n'utilisez pas de gestion de stock");
37 echo '</h2>';
38 return;
39}
40if ( isset ($_POST['add_stock']))
41{
42 $post_name=$http->post('r_name');
43 if ( noalyss_strlentrim($post_name) != 0)
44 {
45 $st=new Stock_Sql($cn);
46 $st->from_array($_POST);
47 $st->insert();
48 }
49}
50if ( isset ($_POST['mod_stock']))
51{
52 $post_name=$http->post('r_name');
53 if ( noalyss_strlentrim($post_name) != 0)
54 {
55
56 $st=new Stock_Sql($cn,$http->post('r_id',"number"));
57 $st->from_array($_POST);
58 $st->update();
59 }
60}
62$p_url=HtmlInput::get_to_string(array("ac","gDossier"));
63
64$tb->add(_("Nom"), $p_url, " order by r_name asc", "order by r_name desc", "ona", "ond");
65$tb->add(_("Adresse"), $p_url, " order by r_adress asc", "order by r_adress desc", "oaa", "oad");
66$tb->add(_("Ville"), $p_url, " order by r_city asc", "order by r_city desc", "ova", "ovd");
67$tb->add(_("Pays"), $p_url, " order by r_country asc", "order by r_country desc", "opa", "opd");
68$tb->add(_("Téléphone"), $p_url, " order by r_phone asc", "order by r_phone desc", "opa", "opd");
69
70$sql="select * from stock_repository ";
71
72$ord=$http->get("ord","string","ona");
73$order=$tb->get_sql_order($ord);
74
75$array=$cn->get_array($sql." ".$order);
76
77?>
78<div class="content">
79
80<table class="result">
81 <tr>
82 <th><?php echo $tb->get_header(0)?></th>
83 <th><?php echo $tb->get_header(1)?></th>
84 <th><?php echo $tb->get_header(2)?></th>
85 <th><?php echo $tb->get_header(3)?></th>
86 <th><?php echo $tb->get_header(4)?></th>
87 </tr>
88<?php for ($i=0;$i<count($array);$i++): ?>
89 <tr>
90 <td>
91 <?php echo h($array[$i]['r_name'])?>
92 </td>
93 <td>
94 <?php echo h($array[$i]['r_adress'])?>
95 </td>
96 <td>
97 <?php echo h($array[$i]['r_city'])?>
98 </td>
99 <td>
100 <?php echo h($array[$i]['r_country'])?>
101 </td>
102 <td>
103 <?php echo h($array[$i]['r_phone'])?>
104 </td>
105 <td>
106 <?php
107 $js=' onclick="stock_repo_change(\''.dossier::id().'\',\''.$array[$i]['r_id'].'\')"';
108 echo HtmlInput::button("mod", _("Modifier"), $js);
109 ?>
110 </td>
111 </tr>
112
113<?php endfor;?>
114</table>
115 <?php echo HtmlInput::button("show_add_depot_d", _("Ajout d'un dépot"), "onclick=\"$('add_depot_d').show();\"");?>
116 <div id="add_depot_d" class="inner_box2" style="display:none">
117 <?php echo HtmlInput::title_box(_("Ajouter un dépôt"),"add_depot_d","hide")?>
118 <form method="post">
119 <div style="display:flex;flex-direction: column;padding:2ch;">
120 <div>
121 Nom
122 </div>
123 <div>
124 <?php $name=new IText("r_name","");$name->css_size="80%"; echo $name->input();?>
125 </div>
126 <div>
127 Adresse
128 </div>
129 <div>
130 <?php $name=new IText("r_adress",""); $name->css_size="80%";echo $name->input();?>
131
132 </div>
133 <div>
134 Ville
135 </div>
136 <div>
137 <?php $name=new IText("r_city","");$name->css_size="80%"; echo $name->input();?>
138 </div>
139 <div>
140 Pays
141 </div>
142 <div>
143 <?php $name=new IText("r_country",""); $name->css_size="80%";echo $name->input();?>
144 </div>
145 <div>
146 Téléphone
147 </div>
148 <div>
149 <?php $name=new IText("r_phone","");$name->css_size="80%"; echo $name->input();?>
150 </div>
151
152 </div>
153
154 <?php echo HtmlInput::submit("add_stock",_("Sauver"))?>
155 </form>
156 </div>
157</div>
th($p_string, $p_extra='', $raw='')
Definition ac_common.php:58
noalyss_strlentrim($p_string)
tr($p_string, $p_extra='')
Definition ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition ac_common.php:83
global $g_parameter
global $g_user
if no group available , then stop
h( $row[ 'oa_description'])
$opd_description style
$input_from id
_("actif, passif,charge,...")
Html Input.
Description of class_syn_sort_table.
ORM abstract of the table public.stock_repository.
$all table
$_POST['ac']
Definition do.php:312
$ord
Definition menu.inc.php:116
if($g_parameter->MY_STOCK=='N') if(isset( $_POST[ 'add_stock'])) if(isset($_POST['mod_stock'])) $tb