noalyss
Version-9
include
stock_state.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 show the state of the repository
26
*
27
*/
28
if
( ! defined (
'ALLOWED'
) ) die(
'Appel direct ne sont pas permis'
);
29
global
$cn
,
$g_parameter
,
$g_user
;
30
31
// Show the form
32
// Get by exercice
33
// Get type = table or list
34
$iexercice
=
new
ISelect
(
'state_exercice'
);
35
$iexercice
->value=
$cn
->make_array(
"select max(p_end) as date_end, p_exercice from parm_periode group by p_exercice order by 2 desc"
);
36
$per
=
new
Periode
(
$cn
,
$g_user
->get_periode());
37
$per
->load();
38
$date_limit
=
$per
->limit_year(
$per
->p_exercice);
39
$last_day
=
$per
->last_day(
$date_limit
[
'end'
]);
40
$last_day
=
format_date
(
$last_day
,
'DD.MM.YYYY'
,
'YYYY-MM-DD'
);
41
$iexercice
->selected=(isset(
$_GET
[
'state_exercice'
]))?
$_GET
[
'state_exercice'
]:
$last_day
;
42
43
$presentation
=
new
ISelect
(
"present"
);
44
$presentation
->value=array (
45
array(
"value"
=>
"T"
,
"label"
=>
"Tableau récapitulatif"
),
46
array(
"value"
=>
"L"
,
"label"
=>
"Liste"
)
47
);
48
$presentation
->selected=(isset(
$_GET
[
'present'
]))?
$_GET
[
'present'
]:
"T"
;
49
require_once NOALYSS_TEMPLATE.
'/stock_state_search.php'
;
50
51
$stock
=
new
Stock
(
$cn
);
52
53
54
$stock
->summary(
$_GET
);
55
56
?>
format_date
format_date($p_date, $p_from_format='YYYY-MM-DD', $p_to_format='DD.MM.YYYY')
format the date, when taken from the database the format is MM-DD-YYYY
Definition:
ac_common.php:852
$_GET
$_GET['qcode']
Definition:
category_followup.inc.php:53
ISelect
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Definition:
iselect.class.php:40
Periode
For the periode tables parm_periode and jrn_periode.
Definition:
periode.class.php:33
Stock
manage the stocks
Definition:
stock.class.php:37
$last_day
$last_day
Definition:
stock_state.inc.php:39
$g_user
global $g_user
Definition:
stock_state.inc.php:29
$cn
global $cn
Definition:
stock_state.inc.php:29
$date_limit
$date_limit
Definition:
stock_state.inc.php:38
$presentation
$presentation
Definition:
stock_state.inc.php:43
$stock
$stock
Definition:
stock_state.inc.php:51
$g_parameter
global $g_parameter
Definition:
stock_state.inc.php:29
$iexercice
$iexercice
Definition:
stock_state.inc.php:34
$per
$per
Definition:
stock_state.inc.php:36