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

class_attribut.php

Go to the documentation of this file.
00001 <?
00002 /*
00003  *   This file is part of PhpCompta.
00004  *
00005  *   PhpCompta is free software; you can redistribute it and/or modify
00006  *   it under the terms of the GNU General Public License as published by
00007  *   the Free Software Foundation; either version 2 of the License, or
00008  *   (at your option) any later version.
00009  *
00010  *   PhpCompta is distributed in the hope that it will be useful,
00011  *   but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *   GNU General Public License for more details.
00014  *
00015  *   You should have received a copy of the GNU General Public License
00016  *   along with PhpCompta; if not, write to the Free Software
00017  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00018 */
00019 /* $Revision: 1.2 $ */
00020 // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr
00028 class Attribut {
00029   var $ad_id;                   
00030   var $ad_text;                 
00031   var $av_text;                 
00032   var $cn;                      
00033   function Attribut($p_ad_id) {
00034     $this->ad_id=$p_ad_id;
00035     $this->cn=-1;
00036   }
00037 
00038 }
00039 
00050 function SortAttributeById($p_attribut) {
00051   for ($i=0;$i< sizeof($p_attribut)-1;$i++) {
00052       if ( $p_attribut[$i]->ad_id > $p_attribut[$i+1]->ad_id ) {
00053         // then swap them
00054         $t=$p_attribut[$i];
00055         $p_attribut[$i]=$p_attribut[$i+1];
00056         $p_attribut[$i+1] = $t;
00057         $i=0;
00058       }
00059     }
00060   
00061   return $p_attribut;
00062 }