00001 <?
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 class rapport {
00029 var $db;
00030 var $id;
00031 var $name;
00033 function rapport($p_cn,$p_id) {
00034 $this->db=$p_cn;
00035 $this->id=$p_id;
00036 $this->name='UNDEF';
00037 }
00040 function GetName() {
00041 $ret=execSql($this->db,"select fr_label from formdef where fr_id=".$this->id);
00042 if (pg_NumRows($ret) == 0) return $this->name;
00043 $a=pg_fetch_array($ret,0);
00044 $this->name=$a['fr_label'];
00045 return $this->name;
00046 }
00053 function GetRow($p_start,$p_end) {
00054
00055 $Res=ExecSql($this->db,"select fo_id ,
00056 fo_fr_id,
00057 fo_pos,
00058 fo_label,
00059 fo_formula,
00060 fr_label from form
00061 inner join formdef on fr_id=fo_fr_id
00062 where fr_id =".$this->id.
00063 "order by fo_pos");
00064 $Max=pg_NumRows($Res);
00065 if ($Max==0) { $this->row=0;return null;}
00066 $col=array();
00067 for ($i=0;$i<$Max;$i++) {
00068 $l_line=pg_fetch_array($Res,$i);
00069 $col[]=ParseFormula($this->db,
00070 $l_line['fo_label'],
00071 $l_line['fo_formula'],
00072 $p_start,
00073 $p_end
00074 );
00075
00076 }
00077 $this->row=$col;
00078 return $col;
00079 }
00080 }
00081 ?>