function Fermer(obj,type_doc) { var id_obj=parent.document.getElementById(obj); if(type_doc==1) id_obj.className='lien_date'; else if(type_doc==2) id_obj.className= 'lien_date_hs'; else if(type_doc==3) id_obj.className= 'lien_date_hs_p'; else id_obj.className= ''; parent.kill_frame_periodique(); }
!!form!!
ENDOFFILE; function gen_serie($id,$nom,$nombre) { $serie="
$nom
"; return $serie; } function gen_hors_serie($id,$modele_name,$checked,$nom,$numero) { global $msg; $serie="
$modele_name
".$msg["abonnements_attribuer_un_numero"]."
"; return $serie; } $form="
!!date_parution!!
".$msg["abonnements_edition_serie"]." :
!!series!!
".$msg["abonnements_hors_serie"]." : !!hors_series!!  
"; $type_doc=0; switch ($act) { case 'update': $requete = "delete FROM abts_grille_abt WHERE num_abt='$abonnement_id' and date_parution ='$date_parution' "; pmb_mysql_query($requete, $dbh); $requete = "SELECT distinct (modele_name) ,abts_grille_abt.modele_id from abts_modeles, abts_grille_abt where num_abt='$abonnement_id' and abts_grille_abt.modele_id = abts_modeles.modele_id "; $resultat=pmb_mysql_query($requete); while($r=pmb_mysql_fetch_object($resultat)){ $modele_name=$r->modele_name; $modele_id=$r->modele_id; $nombre= $serie[$modele_id]; /* if($nombre){ $requete = "INSERT INTO abts_grille_abt SET num_abt='$abonnement_id', date_parution ='$date_parution', modele_id = '$modele_id', type = '1', nombre='$nombre'"; pmb_mysql_query($requete, $dbh); $type_serie=1; }*/ for($i=1;$i<=$nombre;$i++){ $requete = "INSERT INTO abts_grille_abt SET num_abt='$abonnement_id', date_parution ='$date_parution', modele_id='$modele_id', type = '1', nombre='1', ordre='$i' "; pmb_mysql_query($requete, $dbh); $type_serie=1; } if (isset($check_hors_serie[$modele_id])){ $numero= $numero[$modele_id]; $requete = "INSERT INTO abts_grille_abt SET num_abt='$abonnement_id', date_parution ='$date_parution', modele_id = '$modele_id', type = '2', numero='$numero', nombre='1', ordre='1' "; pmb_mysql_query($requete, $dbh); $type_horsserie=2; } } $type_doc= $type_horsserie+$type_serie; $form=""; break; case 'change': $form=""; break; default: $series=""; $hors_series=""; $requete = "SELECT distinct (modele_name) ,abts_grille_abt.modele_id from abts_modeles, abts_grille_abt where num_abt='$abonnement_id' and abts_grille_abt.modele_id = abts_modeles.modele_id "; $resultat=pmb_mysql_query($requete); if(pmb_mysql_num_rows($resultat)) { while($r=pmb_mysql_fetch_object($resultat)){ $modele_name=$r->modele_name; $modele_id=$r->modele_id; $nombre=0; $requete = "SELECT COUNT(*) as nombre from abts_grille_abt where num_abt='$abonnement_id' and date_parution ='$date_parution' and modele_id = '$modele_id' and type='1' "; $resultat_nb=pmb_mysql_query($requete); if($r_nb=pmb_mysql_fetch_object($resultat_nb)){ $nombre=$r_nb->nombre; } $series.=gen_serie($modele_id,$modele_name,$nombre); $checked=""; $numero=""; $requete = "SELECT numero from abts_grille_abt where num_abt='$abonnement_id' and date_parution ='$date_parution' and modele_id = '$modele_id' and type='2' "; $resultat_nb=pmb_mysql_query($requete); if($r_nb=pmb_mysql_fetch_object($resultat_nb)){ $numero=$r_nb->numero; $checked= "checked"; } $hors_series.=gen_hors_serie($modele_id,$modele_name,$checked,$nom,$numero); } } $form=str_replace("!!series!!",$series,$form); $form=str_replace("!!hors_series!!",$hors_series,$form); $form=str_replace("!!date_parution!!",formatdate($date_parution),$form); break; } print str_replace("!!form!!",$form,$templates); print "" ?>