Analytique accountancy : check date + message

This commit is contained in:
Dany De Bontridder 2011-05-16 13:42:27 +00:00
parent 17552157cc
commit c8879ebbb7
3 changed files with 26 additions and 2 deletions

View file

@ -31,7 +31,20 @@ class Anc_Acc_Link extends Anc_Print
{
$this->cn=$p_cn;
}
function check()
{
/*
* check date
*/
if (($this->from != '' && isDate ($this->from) == 0)
||
($this->to != '' && isDate ($this->to) == 0))
return -1;
return 0;
}
/**
*@brief get the parameters
*/

View file

@ -149,6 +149,11 @@ class Anc_Acc_List extends Anc_Acc_Link
function display_html()
{
bcscale(2);
if ( $this->check() != 0)
{
alert('Désolé mais une des dates données n\'est pas valide');
return;
}
//---------------------------------------------------------------------------
// Card - Acc
//---------------------------------------------------------------------------
@ -365,7 +370,7 @@ class Anc_Acc_List extends Anc_Acc_Link
function export_csv()
{
bcscale(2);
if ( $this->check () != 0 ) {echo "DATE INVALIDE";exit();}
//---------------------------------------------------------------------------
// Card - Acc
//---------------------------------------------------------------------------

View file

@ -115,6 +115,11 @@ class Anc_Table extends Anc_Acc_Link
function display_html()
{
bcscale(2);
if ( $this->check() != 0)
{
alert('Désolé mais une des dates données n\'est pas valide');
return;
}
if ( $this->card_poste=='1')
{
@ -229,6 +234,7 @@ class Anc_Table extends Anc_Acc_Link
function export_csv()
{
bcscale(2);
if ( $this->check () != 0 ) {echo "DATE INVALIDE";exit();}
if ( $this->card_poste=='1')
{