function check_quota() { $error = check_quota_resa($this->id_empr, $this->id_notice, $this->id_bulletin); if ($error["ERROR"]) { $this->message = $error["MESSAGE"]; $this->force = $error["FORCE"]; } return $error["ERROR"]; }
} if ($id_notice || $id_bulletin) { // c'est une pose de résa if ($id_notice) { $opac_notices_depliable = 0; $liens_opac = array(); $ouvrage_resa = aff_notice($id_notice, 1); } else { $ouvrage_resa = bulletin_affichage_reduit($id_bulletin, 1); } $message_resa = ""; $resa_check = check_statut($id_notice, $id_bulletin); $already = allready_loaned($id_notice, $id_bulletin, $_SESSION["id_empr_session"]); if ($resa_check == 1 && !$already) { // document sélectionné -> création de la réservation $res_resa_OK = check_quota_resa($_SESSION["id_empr_session"], $id_notice, $id_bulletin); if ($res_resa_OK['ERROR']) { $message_resa = $msg["resa_failed"] . " : " . $res_resa_OK['MESSAGE']; } else { $id_resa_ajoutee = 0; $requete2 = "SELECT COUNT(1) FROM resa WHERE resa_idempr=" . $_SESSION["id_empr_session"] . " AND resa_idnotice='" . $id_notice . "' and resa_idbulletin='" . $id_bulletin . "' "; $result2 = @pmb_mysql_query($requete2, $dbh); $nb = pmb_mysql_result($result2, 0, 0); if ($nb) { // on ne peut pas réserver deux fois un même ouvrage $message_resa = $msg["resa_doc_deja_reserve"] . " "; } else { $has_expl = 1; if ($pmb_location_reservation) { $rqt = "SELECT expl_id FROM exemplaires WHERE expl_notice='" . $id_notice . "'\n\t\t\t\t\t\t\t\t\tAND expl_bulletin='" . $id_bulletin . "' and expl_location in (select resa_loc from resa_loc where resa_emprloc={$empr_location})"; $res_expl = pmb_mysql_query($rqt, $dbh);