Main Page | Namespace List | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

ac_common.php File Reference

common utilities for a lot of procedure, classe More...

Go to the source code of this file.

Functions

 echo_error ($p_log)
 log error into the /tmp/phpcompta_error.log it doesn't work on windows
 cmpDate ($p_date, $p_date_oth)
 Compare 2 dates.
 isNumber ($p_int)
 check if the argument is a number
 isDate ($p_date)
 Verifie qu'une date est bien formaté en d.m.y et est valable.
 formatDate ($p_date)
 call cmpDate
 html_page_start ($p_theme="", $p_script="", $p_script2="")
 Default page header for each page.
 html_page_stop ()
 end tag
 html_button_logout ()
 Button logout.
 NoAccess ()
 Echo no access and stop.
 FormatString ($p_string)
 Fix the problem with the quote char for the database.
 ShowItem ($p_array, $p_dir='V', $class="mtitle", $class_ref="mtitle", $default="", $p_extra="")
 store the string which print
 echo_warning ($p_string)
 warns
 make_array ($p_cn, $p_sql, $p_null=0)
 make a array with the sql
 getPeriodeName ($p_cn, $p_id, $pos='p_start')
 Show the periode which found thanks its id.
 getPeriodeFromMonth ($p_cn, $p_date)
 Return the period corresponding to the date.
 getPeriodeFromDate ($p_cn, $p_date)
 Return the period corresponding to the date.


Detailed Description

common utilities for a lot of procedure, classe

Definition in file ac_common.php.


Function Documentation

cmpDate p_date,
p_date_oth
 

Compare 2 dates.

Parameters:
date 
date2 
Returns:
  • == 0 les dates sont identiques
  • > 0 date1 > date2
  • < 0 date1 < date2

Definition at line 53 of file ac_common.php.

References isDate().

Referenced by VerifData(), and VerifyOperationDate().

echo_error p_log  ) 
 

log error into the /tmp/phpcompta_error.log it doesn't work on windows

Parameters:
log message
Returns:
nothing

Definition at line 36 of file ac_common.php.

References echo_debug().

Referenced by AddFiche(), AddForm(), AddModele(), DeleteRapt(), ExecSql(), form_verify_input(), FormAchInput(), FormAchView(), FormatString(), FormFin(), FormODS(), FormVenInput(), FormVenteView(), GetFicheJrn(), getPeriodeName(), GetTvaPoste(), Imp(), InsertRapt(), isValid(), Remove(), Document_modele::Save(), save_upload_document(), fiche::update(), UpdateFiche(), UpdateJrn(), UpdateModele(), VerifData(), and VerifyOperationDate().

echo_warning p_string  ) 
 

warns

Parameters:
: 
  • string gen :
  • none
Returns:
:
  • none

Definition at line 269 of file ac_common.php.

Referenced by GetFicheJrn(), and IsFicheOfJrn().

formatDate p_date  ) 
 

call cmpDate

Returns:
the date or the quoted string null

Definition at line 120 of file ac_common.php.

References isDate().

FormatString p_string  ) 
 

Fix the problem with the quote char for the database.

Parameters:
$p_string 
Returns:
a string which won't let strange char for the database

Definition at line 208 of file ac_common.php.

References echo_error().

Referenced by AddFiche(), AddForm(), AddModele(), action::Confirm(), fiche::CountByDef(), action::Display(), fiche::GetByQCode(), fiche::insert(), InsertJrn(), ListJrn(), RecordFin(), RecordInvoice(), RecordSell(), Remove(), parm_code::Save(), Document_modele::Save(), action::SaveStage2(), ShowActionList(), Supplier::Summary(), Customer::Summary(), contact::Summary(), Admin::Summary(), fiche::update(), action::Update(), UpdateComment(), UpdateFiche(), UpdateForm(), Own::UpdateRow(), and ViewJrn().

getPeriodeFromDate p_cn,
p_date
 

Return the period corresponding to the date.

Parameters:
: 
  • p_cn database connection
  • the date 'DD.MM.YYYY'
    Returns:
    : parm_periode.p_id

Definition at line 355 of file ac_common.php.

References $a, and ExecSql().

getPeriodeFromMonth p_cn,
p_date
 

Return the period corresponding to the date.

Parameters:
p_cn database connection
the month + year 'MM.YYYY'
Returns:
: parm_periode.p_id

Definition at line 335 of file ac_common.php.

References $a, and ExecSql().

Referenced by ParseFormula().

getPeriodeName p_cn,
p_id,
pos = 'p_start'
 

Show the periode which found thanks its id.

Parameters:
$p_cn database connection
p_id 
Start or end
Returns:
: string

Definition at line 315 of file ac_common.php.

References $a, $ret, and echo_error().

html_button_logout  ) 
 

Button logout.

Returns:
nothing

Definition at line 182 of file ac_common.php.

html_page_start p_theme = "",
p_script = "",
p_script2 = ""
 

Default page header for each page.

Parameters:
default theme
$p_script 
$p_script2 another js script
Returns:
none

Definition at line 133 of file ac_common.php.

References $cn, $Res, $style, DbConnect(), and ExecSql().

html_page_stop  ) 
 

end tag

Definition at line 170 of file ac_common.php.

isDate p_date  ) 
 

Verifie qu'une date est bien formaté en d.m.y et est valable.

Parameters:
$p_date 
Returns:
  • null si la date est invalide ou malformaté
  • $p_date si tout est bon

Definition at line 97 of file ac_common.php.

References echo_debug().

Referenced by cmpDate(), action::Confirm(), form_verify_input(), formatDate(), ListJrn(), VerifData(), VerifyOperationDate(), and ViewJrn().

isNumber p_int  ) 
 

check if the argument is a number

Parameters:
$p_int number to test
Returns:
  • 1 it's a number
  • 0 it is not

Definition at line 76 of file ac_common.php.

Referenced by AddFiche(), AddModele(), ComputeTotalVat(), ComputeVat(), DeleteRapt(), form_verify_input(), FormAchInput(), FormAchView(), FormODS(), FormVenInput(), FormVenteView(), fiche::insert(), InsertRapt(), RecordFin(), RecordInvoice(), RecordODS(), RecordSell(), Remove(), Document_modele::Save(), and fiche::update().

make_array p_cn,
p_sql,
p_null = 0
 

make a array with the sql

Parameters:
$cn dbatabase connection
$sql related sql
Returns:
: a double array [value,label]

Definition at line 282 of file ac_common.php.

References $a, $i, $r, $row, label, and value.

Referenced by action::Confirm(), action::Display(), Document_modele::form(), FormAchInput(), FormVenInput(), FormVenteView(), and ShowFormTransfert().

NoAccess  ) 
 

Echo no access and stop.

Returns:
nothing

Definition at line 192 of file ac_common.php.

References exit.

ShowItem p_array,
p_dir = 'V',
class = "mtitle",
class_ref = "mtitle",
default = "",
p_extra = ""
 

store the string which print

/*

Definition at line 228 of file ac_common.php.

References $ret, and $title.

Referenced by MenuAdmin(), ShowJrn(), ShowMenuAdvanced(), ShowMenuCompta(), ShowMenuDocument(), and ShowMenuParam().


Generated on Tue Jun 27 01:39:29 2006 for phpcompta by  doxygen 1.4.4