noalyss Version-9
stock_inv_histo.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 * @file
24 * @brief history of manuel change
25 *
26 */
27if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
29
30if ( isset($_POST['del']))
31{
32 if (isset($_POST['ok']))
33 {
34 if ($g_user->can_write_repo($_POST['r_id']))
35 {
36 $cn->exec_sql('delete from stock_change where c_id=$1',array($_POST['c_id']));
37 }
38 else
39 {
40 alert(_("Vous ne pouvez pas modifier ce dépôt"));
41 }
42 }
43 else
44 {
45 alert(_("Opération non effacée: vous n'avez pas confirmé"));
46 }
47}
48$profile=$g_user->get_profile();
50$default_exercice=$g_user->get_exercice();
51$p_exercice=$http->get("p_exercice", "string",$default_exercice);
52
53$a_change=$cn->get_array("select *,to_char(c_date,'DD.MM.YY') as str_date from stock_change as sc
54 join stock_repository as sr on (sc.r_id=sr.r_id)
55 where sc.r_id in (select r_id from profile_sec_repository where p_id=$1)
56 and c_date >= (select min(p_start) from parm_periode where p_exercice = $2)
57 and c_date <= (select max(p_end) from parm_periode where p_exercice = $2)
58 order by c_date",array($profile,$p_exercice));
59
60
62?>
63<div class="content">
64 <form method="get" class="print">
65 <?php echo HtmlInput::get_to_hidden(array('gDossier','ac',));?>
66 <?php echo $exercice->select('p_exercice',$p_exercice)->input();?>
67 <?php echo HtmlInput::submit("filter", _('Valider')); ?>
68 </form>
69<table class="result">
70 <tr>
71
72 <th>
73 <?php echo _('Date')?>
74 </th>
75 <th>
76 <?php echo _('Commentaire')?>
77 </th>
78 <th>
79 <?php echo _('Dépot')?>
80 </th>
81 <th>
82 <?php echo _('Utilisateur') ?>
83 </th>
84 <th>
85
86 </th>
87 </tr>
88 <?php for ($e=0;$e<count($a_change);$e++): ?>
89 <?php $class=($e%2==0)?' class="even" ':' class="odd" '; ?>
90 <tr <?php echo $class?>>
91
92 <td>
93 <?php echo $a_change[$e]['str_date']?>
94 </td>
95 <td>
96 <?php echo h($a_change[$e]['c_comment'])?>
97 </td>
98 <td>
99 <?php echo h($a_change[$e]['r_name'])?>
100 </td>
101 <td>
102 <?php echo $a_change[$e]['tech_user']?>
103 </td>
104 <td>
105 <?php echo HtmlInput::anchor(_("Détail"),"javascript:void()",sprintf("onclick=\"stock_inv_detail('%s','%s')\"",$gDossier,$a_change[$e]['c_id']));?>
106 </td>
107
108 </tr>
109 <?php endfor; ?>
110</table>
111</div>
th($p_string, $p_extra='', $raw='')
Definition: ac_common.php:58
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
alert($p_msg, $buffer=false)
alert in javascript
Definition: ac_common.php:738
global $g_user
if no group available , then stop
h( $row[ 'oa_description'])
$input_from id
Definition: balance.inc.php:63
$class
about the accountancy period (usually 1 year starting in January until december) = exercice
static anchor($p_text, $p_url="", $p_js="", $p_style=' class="line" ', $p_title="click", array $p_attribute=[])
Return a simple anchor with a url or a javascript if $p_js is not null then p_url will be javascript:...
static get_to_hidden($array)
transform $_GET data to hidden
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
manage the http input (get , post, request) and extract from an array
$all table
$_POST['ac']
Definition: do.php:310
if(isset($_POST['del'])) $profile
$default_exercice