"; print pmb_bidi("

".$empr->prenom." ".$empr->nom."

".$empr->adr1."
".$empr->adr2."
".$empr->cp." ".$empr->ville."
".$empr->mail."
".$empr->tel1."
".$empr->tel2."
"); function show_lines_list() { global $id_empr,$msg,$charset; //Liste des recouvrements print "
\n "; $requete="select recouvr_id,id_expl,date_rec,libelle,montant, expl_notice,expl_bulletin, recouvr_type, date_pret,date_relance1,date_relance2,date_relance3, expl_cote , expl_cb from recouvrements left join exemplaires on expl_id=id_expl where empr_id=$id_empr order by date_rec,recouvr_id"; $resultat=pmb_mysql_query($requete); $pair=false; while ($r=pmb_mysql_fetch_object($resultat)) { if (!$pair) $pair_impair = "odd"; else $pair_impair = "even"; $tr_javascript=" onmouseover=\"this.className='surbrillance'\" onmouseout=\"this.className='$pair_impair'\" "; $pair=!$pair; if ($r->id_expl) { if ($r->expl_notice) $notice=new mono_display($r->expl_notice); elseif ($r->expl_bulletin) { $req="select bulletin_notice from bulletins where bulletin_id=$r->expl_bulletin"; $res=pmb_mysql_query($req); $id_bull_notice=pmb_mysql_result($res,0,0); $notice = new serial_display($id_bull_notice); } $libelle=strip_tags(html_entity_decode($notice->header,ENT_QUOTES,$charset)); } else $libelle=$r->libelle; if(!$r->recouvr_type) { print pmb_bidi(""; print ""; }elseif ($r->id_expl) { $requete="select expl_prix, prix from exemplaires, notices where (notice_id=expl_notice or notice_id=expl_bulletin) and expl_id =".$r->id_expl; //http://localhost/~ngantier/pmb/circ.php?categ=visu_ex&form_cb_expl=p $res_prix=pmb_mysql_query($requete); $comment_prix=''; if($r_prix=pmb_mysql_fetch_object($res_prix)) { if(!$comment_prix=$r_prix->expl_prix)$comment_prix=$r_prix->prix; } print pmb_bidi(""; print ""; } } print "
".htmlentities($msg["relance_recouvrement_date"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_type"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_titre"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_cb"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_cote"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_pret_date"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_relance_date1"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_relance_date2"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_relance_date3"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_prix_calcul"],ENT_QUOTES,$charset)." ".htmlentities($msg["relance_recouvrement_montant"],ENT_QUOTES,$charset)."
".format_date($r->date_rec)." ".htmlentities($msg["relance_recouvrement_amende"],ENT_QUOTES,$charset)." ".htmlentities($libelle,ENT_QUOTES,$charset)." ".$r->expl_cb." ".htmlentities($r->expl_cote,ENT_QUOTES,$charset)." ".format_date($r->date_pret)." ".format_date($r->date_relance1)." ".format_date($r->date_relance2)." ".format_date($r->date_relance3)." ".comptes::format_simple($r->montant)." "); if (!$r->id_expl) print ""; else print " "; print "
".format_date($r->date_rec)." ".htmlentities($msg["relance_recouvrement_prix"],ENT_QUOTES,$charset)." ".htmlentities($libelle,ENT_QUOTES,$charset)." ".$r->expl_cb." ".htmlentities($r->expl_cote,ENT_QUOTES,$charset)." ".format_date($r->date_pret)." ".format_date($r->date_relance1)." ".format_date($r->date_relance2)." ".format_date($r->date_relance3)." ".htmlentities($comment_prix,ENT_QUOTES,$charset)." ".comptes::format_simple($r->montant)." "); print "
"; print "
"; } function show_recouvr_form($recouvr_id) { global $msg,$charset; if ($recouvr_id) { $requete="select libelle,montant from recouvrements where recouvr_id=$recouvr_id"; $resultat=pmb_mysql_query($requete); if (pmb_mysql_num_rows($resultat)) { $r=pmb_mysql_fetch_object($resultat); $libelle=$r->libelle; $montant=$r->montant; } } print "
"; print "
"; print "
"; print "
"; print "
"; } if(!isset($act_line)) $act_line = ''; switch ($act_line) { case "update_line": show_recouvr_form($recouvr_id); break; case "rec_update_line": if ($recouvr_id) { $requete="update recouvrements set libelle='".$libelle."', montant='".$montant."' where recouvr_id=$recouvr_id"; pmb_mysql_query($requete); } else { $requete="insert into recouvrements (empr_id, date_rec, libelle, montant) values($id_empr,now(),'".$libelle."','".$montant."')"; pmb_mysql_query($requete); } show_lines_list(); break; case "del_line": for ($i=0; $idocument.location='./circ.php?categ=relance&sub=recouvr&act=recouvr_liste';"; break; case "solde": $requete="select sum(montant) from recouvrements where empr_id='$id_empr'"; $resultat=pmb_mysql_query($requete); $solde=@pmb_mysql_result($resultat,0,0); if ($solde) { //Crédit du compte lecteur $compte_id=comptes::get_compte_id_from_empr($id_empr,2); if ($compte_id) { $cpte=new comptes($compte_id); $id_transaction=$cpte->record_transaction("",$solde,1,$comment=$msg["relance_recouvrement_solde_recouvr"],$encaissement=0); if ($id_transaction) { $cpte->validate_transaction($id_transaction); //Débit du compte bibliothèque $requete="insert into transactions (compte_id,user_id,user_name,machine,date_enrgt,date_prevue,date_effective,montant,sens,realisee,commentaire,encaissement) values( 0,$PMBuserid,'".$PMBusername."','".$_SERVER["REMOTE_ADDR"]."',now(),now(),now(), $solde,-1,1,'".sprintf($msg["relance_recouvrement_solde_recouvr_bibli"],$id_empr)."',0)"; } } } pmb_mysql_query("delete from recouvrements where empr_id='".$id_empr."'"); print ""; break; default: show_lines_list(); break; } print " "; ?>