if (!$id) { $return['error'] = "no input"; } else { $rqt = "select niveau_biblio, typdoc from notices where notice_id='" . $id . "'"; $res = pmb_mysql_query($rqt); if (pmb_mysql_num_rows($res)) { $r = pmb_mysql_fetch_object($res); $enrichment = new enrichment($r->niveau_biblio, $r->typdoc); switch ($action) { case "gettype": $typeofenrichment = $enrichment->getTypeOfEnrichment($id); $return["result"] = $typeofenrichment; break; default: if ($enrichPage) { $enhance = $enrichment->getEnrichment($id, $type, $enrich_params, $enrichPage); } else { $enhance = $enrichment->getEnrichment($id, $type, $enrich_params); } $return["result"] = $enhance; break; } $return["state"] = 1; } } //On renvoie du JSON dans le charset de PMB... if (!$debug) { header("Content-Type:application/json; charset={$charset}"); $return = charset_pmb_normalize($return); print json_encode($return); }