<?php
// +-------------------------------------------------+
// | 2002-2007 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
// +-------------------------------------------------+
// $Id: abts_abonnements.class.php,v 1.68.4.6 2025/10/24 12:12:25 dgoron Exp $

if (stristr($_SERVER['REQUEST_URI'], ".class.php")) die("no access");

global $class_path, $include_path;
require_once($include_path."/templates/abts_abonnements.tpl.php");
require_once($class_path."/abts/abts_abonnement.class.php");

class abts_abonnements {
    
    public $abonnements = array(); //Tableau des IDs des modèles
    
    public function __construct($id_perio,$localisation=0) {
        $where_localisation = '';
        $localisation = intval($localisation);
        if ($localisation > 0) {
            $where_localisation=" and location_id = $localisation ";
        }
        $requete="select abt_id from abts_abts where num_notice=$id_perio $where_localisation order by abt_name";
        $resultat=pmb_mysql_query($requete);
        while ($r=pmb_mysql_fetch_object($resultat)) {
            $abonnement=new abts_abonnement($r->abt_id);
            if (!$abonnement->error) {
                $this->abonnements[]=$abonnement;
            }
        }
    }
}
