function rec_retour($line) { global $action_piege, $piege_resa; $form_cb_expl = $line; $expl = new expl_to_do($form_cb_expl); //print $expl->cb_tmpl; //if(!$form_cb_expl) exit; $expl->do_form_retour($action_piege, $piege_resa); print $expl->expl_form; return; // la suite n'est plus utilisé if ($form_cb_expl) { print "<hr />"; // étape 1 : on regarde si le code-barre est connu if ($stuff = check_barcode($form_cb_expl)) { $stuff = check_pret($stuff); $stuff = check_resa($stuff); // on a maintenant un gros objet $stuff avec toutes les infos pour traiter les choses // les propriétés de cet objet sont visibles dans la fonction show_reports() plus bas // show_report($stuff); // uncomment for debugging // appel de la fonction do_retour, qui va gérer tout cela do_retour_secouru($stuff); } else { print "<div class='erreur'>" . $form_cb_expl . " : Exemplaire inconnu" . "</div>"; } } }
function pret_construit_infos_stat($id_expl) { global $dbh; $query = "select * from exemplaires where expl_id='{$id_expl}' "; $result = mysql_query($query, $dbh); $stuff = mysql_fetch_object($result); if (!$stuff->expl_id) { // exemplaire inconnu return FALSE; } $stuff = check_pret($stuff); $stuff = check_resa($stuff); return $stuff; }
function fetch_data() { global $dbh, $msg; global $pmb_confirm_retour; global $confirmation_retour_tpl, $retour_ok_tpl; $this->build_cb_tmpl($msg[660], $msg[661], $msg[circ_tit_form_cb_expl], $this->url, 1); if ($this->expl_cb) { $query = "select * from exemplaires where expl_cb='" . $this->expl_cb . "' "; } elseif ($this->expl_id) { $query = "select * from exemplaires where expl_id='" . $this->expl_id . "' "; } else { return; } $result = pmb_mysql_query($query, $dbh); $this->expl = pmb_mysql_fetch_object($result); if (!$this->expl->expl_id) { return false; } else { $this->expl_cb = $this->expl->expl_cb; $this->expl_id = $this->expl->expl_id; // récupération des infos exemplaires if ($this->expl->expl_notice) { $notice = new mono_display($this->expl->expl_notice, 0); $this->expl->libelle = $notice->header; } else { $bulletin = new bulletinage_display($this->expl->expl_bulletin); $this->expl->libelle = $bulletin->display; } if ($this->expl->expl_lastempr) { // récupération des infos emprunteur $query_last_empr = "select empr_cb, empr_nom, empr_prenom from empr where id_empr='" . $this->expl->expl_lastempr . "' "; $result_last_empr = pmb_mysql_query($query_last_empr, $dbh); if (pmb_mysql_num_rows($result_last_empr)) { $last_empr = pmb_mysql_fetch_object($result_last_empr); $this->expl->lastempr_cb = $last_empr->empr_cb; $this->expl->lastempr_nom = $last_empr->empr_nom; $this->expl->lastempr_prenom = $last_empr->empr_prenom; } } } $query = "select lender_libelle from lenders where idlender='" . $this->expl->expl_owner . "' "; $result_expl_owner = pmb_mysql_query($query, $dbh); if (pmb_mysql_num_rows($result_expl_owner)) { $expl_owner = pmb_mysql_fetch_object($result_expl_owner); $this->expl_owner_name = $expl_owner->lender_libelle; } $rqt = "SELECT transfert_flag \tFROM exemplaires INNER JOIN docs_statut ON expl_statut=idstatut \n\t\t\tWHERE expl_id=" . $this->expl_id; $res = pmb_mysql_query($rqt) or die(pmb_mysql_error() . "<br /><br />" . $rqt); $value = pmb_mysql_fetch_array($res); $this->trans_aut = $value[0]; $this->expl = check_pret($this->expl); $this->expl = check_resa($this->expl); $this->expl = check_resa_planning($this->expl); // récupération localisation exemplaire $query = "SELECT t.tdoc_libelle as type_doc, l.location_libelle as location, s.section_libelle as section, docs_s.statut_libelle as statut FROM docs_type t, docs_location l, docs_section s, docs_statut docs_s"; $query .= " WHERE t.idtyp_doc=" . $this->expl->expl_typdoc; $query .= " AND l.idlocation=" . $this->expl->expl_location; $query .= " AND s.idsection=" . $this->expl->expl_section; $query .= " AND docs_s.idstatut=" . $this->expl->expl_statut; $query .= " LIMIT 1"; $result = pmb_mysql_query($query, $dbh); $this->info_doc = pmb_mysql_fetch_object($result); // En profiter pour faire le menage doc à ranger $rqt = "delete from resa_ranger where resa_cb='" . $this->expl_cb . "' "; $res = pmb_mysql_query($rqt, $dbh); // flag confirm retour if ($pmb_confirm_retour) { $this->expl_form .= $confirmation_retour_tpl; } elseif ($this->expl->pret_idempr) { $this->expl_form .= $retour_ok_tpl; } return true; }