28require_once NOALYSS_INCLUDE.
'/database/jrn_periode_sql.class.php';
44 $this->a_member[
"id"]=
$p_id;
45 $this->sql=
"select id,p_id,status,p_id,p_start,p_end,p_closed,p_exercice,jrn_def_id
48 join parm_periode using (p_id)";
50 $this->a_member=$this->
cn->get_row($this->sql.
" where id = $1",
51 [$this->a_member[
"id"]]);
70 $this->a_member=$this->
cn->get_row($this->sql.
" where id = $1",
71 [$this->a_member[
"id"]]);
76 $ret=$this->
cn->exec_sql($this->sql.
" where jrn_def_id = $1 order by p_start asc",[
$p_ledger_id]);
94 echo
'<table class="result" id="periode_tbl">';
98 echo
th(_(
"Date Début"));
99 echo
th(_(
"Date Fin"));
100 echo
th(_(
"Exercice"));
106 for (
$i=0;
$i<$nb_periode;
$i++)
123 $class=($p_num%2==0)?
"even":
"odd";
124 printf(
'<tr id="row_per_%d" per_ledger="%s" per_exercice="%s" jrn_ledger_id="%s" class="%s"> ',
125 $pa_row[
"id"], $pa_row[
"jrn_def_id"], $pa_row[
"p_exercice"],
131 if ($pa_row[
"status"] ==
"OP") {
133 $checkbox->set_attribute(
"per_id", $pa_row[
'id']);
134 $checkbox->set_range(
"sel_per_close_ck");
136 echo
"<td>".$checkbox->input().
"</td>";
140 echo
td(
format_date($pa_row[
"p_start"],
"YYYY-MM-DD",
"DD.MM.YYYY"));
141 echo
td(
format_date($pa_row[
"p_end"],
"YYYY-MM-DD",
"DD.MM.YYYY"));
142 echo
td($pa_row[
"p_exercice"]);
143 $status=($pa_row[
'p_closed']==
't')?_(
"Fermée"):_(
"Ouvert");
145 if ($pa_row[
"status"] ==
"OP") { echo _(
"Ouvert"); }
146 if ($pa_row[
"status"] ==
"CL") { echo _(
"Fermé"); }
150 if ($pa_row[
'status']==
'OP')
152 $javascript=sprintf(
"%s.close_periode('%d')", $p_js, $pa_row[
'id']);
155 elseif ($pa_row[
'status']==
'CL')
157 $javascript=sprintf(
"%s.open_periode('%d')", $p_js, $pa_row[
'id']);
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
th($p_string, $p_extra='', $raw='')
td($p_string='', $p_extra='')
surround the string with td
static fetch_array($ret, $p_indice=0, $p_mode=PGSQL_ASSOC)
wrapper for the function pg_fetch_array
static num_row($ret)
wrapper for the function pg_num_rows
static iconoff($p_id, $p_javascript, $p_style="")
Display a icon OFF.
static iconon($p_id, $p_javascript, $p_style="")
Display a icon ON.
Display the periode per ledger: close : reopen ... the close , open must be done thanks Periode.
load()
Load a row and return it as an array.
display_table($p_resource_psql, $p_js)
Display all the periode for a specific ledger the ledger is in m_jrn_periode_sql.
display_row($pa_row, $p_num, $p_js)
Display one row from jrn_periode with supplemental info.
get_resource_periode_ledger($p_ledger_id)
if( $delta< 0) elseif( $delta==0)