Пример #1
0
 public function __construct($fichier)
 {
     $xml_struct = new xml_struct();
     $ret = $xml_struct->ouvrir($fichier);
     if ($ret) {
         $this->fichier = $fichier;
         $nb_dates = $xml_struct->compter_elements(_MODULE_RESA_DATE);
         for ($cpt = 0; $cpt < $nb_dates; $cpt++) {
             $xml_struct->pointer_sur_balise(_MODULE_RESA_DATE);
             $date = $xml_struct->lire_n($cpt);
             if (strlen($date) > 0) {
                 list($jour, $mois, $an) = explode("/", $date);
                 $date_tag = (int) mktime(0, 0, 0, (int) $mois, (int) $jour, (int) $an);
                 $statut = $xml_struct->lire_n_attribut(_MODULE_RESA_ATTR_STATUT, $cpt);
                 if (strlen($statut) > 0) {
                     $partie = $xml_struct->lire_n_attribut(_MODULE_RESA_ATTR_PARTIE, $cpt);
                     if (!strcmp($partie, _MODULE_RESA_ATTR_PARTIE_AM)) {
                         $this->statuts_am[$date_tag] = $statut;
                     } elseif (!strcmp($partie, _MODULE_RESA_ATTR_PARTIE_PM)) {
                         $this->statuts_pm[$date_tag] = $statut;
                     } else {
                         $this->statuts_am[$date_tag] = $statut;
                         $this->statuts_pm[$date_tag] = $statut;
                     }
                 }
             }
             $xml_struct->pointer_sur_origine();
         }
     }
 }