24require_once NOALYSS_INCLUDE.
'/database/form_detail_sql.class.php';
25require_once NOALYSS_INCLUDE.
'/database/form_definition_sql.class.php';
59 return $this->form_definition->getp(
"fr_label");
70 if (DEBUGNOALYSS > 1) {
71 tracedebug(
"impress.debug.log",__FILE__.
"71.get_row({$p_start},{$p_end},{$p_type_date})");
73 $Res=$this->form_definition->cn->exec_sql(
"select fo_id ,
78 fr_label from form_detail
79 inner join form_definition on fr_id=fo_fr_id
81 order by fo_pos",array($this->form_definition->getp(
"fr_id")));
90 if ( $p_type_date ==
'0' || $p_type_date==
"periode") {
92 }
elseif ($p_type_date ==
'1' || $p_type_date==
"calendar") {
95 throw new Exception(
"ACR93:invalid type_date [ {$p_type_date} ] ");
105 $l_line[
'fo_formula'],
122 $this->form_definition->save();
130 $this->form_definition->load();
135 $this->form_definition->delete();
145 $sql=
"select fr_id,fr_label from form_definition order by fr_label";
146 $ret=$this->form_definition->cn->exec_sql(
$sql);
165 $sql=$this->form_definition->cn->make_array(
"select fr_id,fr_label from form_definition order by fr_label");
177 fputcsv($p_file,array($this->form_definition->getp(
"fr_label")));
178 $array=$this->form_definition->get_cn()->get_array(
"select fo_label,fo_pos,fo_formula
182 ,array($this->form_definition->getp(
"fr_id"))
187 fputcsv($p_file,array(
$row[
"fo_label"],
199 if ( empty ($_FILES) )
return;
202 alert(
"Nom de fichier est vide");
205 $file_report=tempnam(
'tmp',
'file_report');
206 if ( move_uploaded_file($_FILES[
'report'][
'tmp_name'],$file_report))
209 $file=fopen($file_report,
'r');
211 if ( empty(
$data) )
return;
213 $cn=$this->form_definition->cn;
214 $id=$this->form_definition->getp(
"fr_id");
233 $c=$this->form_definition->getp(
"fr_id");
235 $ret=$this->form_definition->cn->exec_sql(
"select fr_label from form_definition where fr_id=$1",array($c));
244 require_once NOALYSS_INCLUDE.
"/template/acc_report-create.php";
253 $name->id=
"fr_name_inplace";
256 $iName->set_callback(
"ajax_misc.php");
257 $iName->add_json_param(
"op",
"report_definition");
258 $iName->add_json_param(
"sa",
"change_name");
260 $iName->add_json_param(
"p_id", $this->form_definition->getp(
"fr_id"));
noalyss_strlentrim($p_string)
alert($p_msg, $buffer=false)
alert in javascript
Class rapport Create, view, modify and parse report.
exist($p_id=0)
check if a report exist
__construct($p_cn, $p_id=-1)
Constructor.
load()
the fr_id MUST be set before calling
save()
save into form and form_def
upload()
upload a definition of a report and insert it into the database
get_list()
get a list from form_definition of all defined form
get_name()
Return the report's name.
set_form_definition($form_definition)
export_csv($p_file)
write to a file the definition of a report
make_array()
To make a SELECT button with the needed value, it is used by the SELECT widget.
get_row($p_start, $p_end, $p_type_date)
return all the row and parse formula from a report
create()
display a form for creating a new report by importing it or set manually
static fetch_all($ret)
wrapper for the function pg_fetch_all
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 id()
return the 'gDossier' value after a check
static parse_formula($p_cn, $p_label, $p_formula, $p_start, $p_end, $p_eval=true, $p_type_date=0, $p_sql="")
Inplace_edit class for ajax update of HtmlInput object.
if( $delta< 0) elseif( $delta==0)