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

fiche_def Class Reference

define Class fiche and fiche def, those class are using class attribut More...


Public Member Functions

 fiche_def ($p_cn, $p_id=0)
 GetAttribut ()
 Get attribut of a fiche_def.
 Get ()
 Get attribut of the fiche_def.
 GetAll ()
 Get all the fiche_def.
 HasAttribute ($p_attr)
 Check in vw_fiche_def if a fiche has a attribut X.
 Display ()
 Display a fiche_def object into a table.

Data Fields

 $cn
 $id
 $label
 $class_base
 $fiche_def
 $create_account
 $all
 $attribut


Detailed Description

define Class fiche and fiche def, those class are using class attribut

Definition at line 30 of file class_fiche.php.


Constructor & Destructor Documentation

fiche_def::fiche_def p_cn,
p_id = 0
 

Definition at line 39 of file class_fiche.php.

References $p_id.

Referenced by GetAll().

00039                                       {
00040     $this->cn=$p_cn;
00041     $this->id=$p_id;
00042   }


Member Function Documentation

fiche_def::Display  ) 
 

Display a fiche_def object into a table.

Returns:
HTML row

Definition at line 129 of file class_fiche.php.

References $r.

00130    {
00131 
00132      $r=sprintf("<TD>%s</TD>",$this->id);
00133      $r.=sprintf("<TD>%s</TD>",$this->label);
00134      $r.=sprintf("<TD>%s</TD>",$this->class_base);
00135      $r.=sprintf("<TD>%s</TD>",$this->fiche_def);
00136      return $r;
00137    }

fiche_def::Get  ) 
 

Get attribut of the fiche_def.

Definition at line 74 of file class_fiche.php.

References $Ret, $row, $sql, ExecSql(), frd_id, label, and return.

00074                  {
00075     if ( $this->id == 0 ) 
00076       return 0;
00077     $sql="select * from fiche_def ".
00078       " where fd_id=".$this->id;
00079     $Ret=ExecSql($this->cn,$sql);
00080     if ( ($Max=pg_NumRows($Ret)) == 0 )
00081       return ;
00082     $row=pg_fetch_array($Ret,0);
00083     $this->label=$row['fd_label'];
00084     $this->class_base=$row['fd_class_base'];
00085     $this->fiche_def=$row['frd_id'];
00086     $this->create_account=$row['fd_create_account'];
00087   }

fiche_def::GetAll  ) 
 

Get all the fiche_def.

Returns:
an array of fiche_def object

Definition at line 94 of file class_fiche.php.

References $i, $Ret, $row, $sql, ExecSql(), fiche_def(), frd_id, and return.

00094                    {
00095    $sql="select * from fiche_def ";
00096 
00097     $Ret=ExecSql($this->cn,$sql);
00098     if ( ($Max=pg_NumRows($Ret)) == 0 )
00099       return ;
00100 
00101     for ( $i = 0; $i < $Max;$i++) {
00102       $row=pg_fetch_array($Ret,$i);
00103       $this->all[$i]=new fiche_def($this->cn,$row['fd_id']);
00104       $this->all[$i]->label=$row['fd_label'];
00105       $this->all[$i]->class_base=$row['fd_class_base'];
00106       $this->all[$i]->fiche_def=$row['frd_id'];
00107       $this->all[$i]->create_account=$row['fd_create_account'];
00108     }
00109   }

fiche_def::GetAttribut  ) 
 

Get attribut of a fiche_def.

Returns:
string value of the attribute none

Definition at line 51 of file class_fiche.php.

References $i, $Ret, $row, $sql, $t, ExecSql(), and return.

00051                          {
00052     $sql="select * from jnt_fic_attr ".
00053       " natural join attr_def where fd_id=".$this->id.
00054       " order by ad_id";
00055 
00056     $Ret=ExecSql($this->cn,$sql);
00057 
00058     if ( ($Max=pg_NumRows($Ret)) == 0 )
00059       return ;
00060     for ($i=0;$i < $Max;$i++) {
00061       $row=pg_fetch_array($Ret,$i);
00062       $t = new Attribut($row['ad_id']);
00063       $t->ad_text=$row['ad_text'];
00064       $this->attribut[$i]=$t;
00065     }
00066     return $this->attribut;
00067   }

fiche_def::HasAttribute p_attr  ) 
 

Check in vw_fiche_def if a fiche has a attribut X.

Parameters:
$p_attr attribut to check
Returns:
true or false

Definition at line 119 of file class_fiche.php.

References CountSql().

00119                                 {
00120    return (CountSql($this->cn,"select * from vw_fiche_def where ad_id=$p_attr and fd_id=".$this->id)>0)?true:false;
00121 
00122  }


Field Documentation

fiche_def::$all
 

Definition at line 37 of file class_fiche.php.

fiche_def::$attribut
 

Definition at line 38 of file class_fiche.php.

fiche_def::$class_base
 

Definition at line 34 of file class_fiche.php.

fiche_def::$cn
 

Definition at line 31 of file class_fiche.php.

fiche_def::$create_account
 

Definition at line 36 of file class_fiche.php.

fiche_def::$fiche_def
 

Definition at line 35 of file class_fiche.php.

fiche_def::$id
 

Definition at line 32 of file class_fiche.php.

fiche_def::$label
 

Definition at line 33 of file class_fiche.php.


The documentation for this class was generated from the following file: