コード例 #1
0
function cree_export_notices($liste = array(), $typeexport = 'pmbxml2marciso', $expl = 1, $param_export)
{
    global $base_path;
    global $keep_expl, $dbh;
    $keep_expl = $expl;
    // Récupération des notices
    $n_notices = count($liste);
    if ($n_notices == 0) {
        return "";
    } else {
        // Export !
        $z = 0;
        $e_notice = "";
        $nb_notices = 0;
        $_SESSION["param_export"]["notice_exporte"] = array();
        $_SESSION["param_export"]["bulletin_exporte"] = array();
        while ($z < count($liste)) {
            $id = $liste[$z];
            // Exclure de l'export (opac, panier) les fiches interdites de diffusion dans administration, Notices > Origines des notices NG72
            $sql = "select orinot_diffusion from origine_notice,notices where notice_id = '{$id}' and origine_catalogage = orinot_id";
            $res = pmb_mysql_query($sql, $dbh);
            if (pmb_mysql_num_rows($res)) {
                $diffusable = pmb_mysql_result($res, 0, 0);
                if ($diffusable) {
                    $export = new start_export($id, $typeexport, $param_export);
                    $e_notice .= $export->output_notice;
                    $nb_notices++;
                }
            }
            $z++;
        }
    }
    if ($nb_notices > 0) {
        $e_notice = $export->get_header() . $e_notice . $export->get_footer();
    }
    return $e_notice;
}
コード例 #2
0
ファイル: export.php プロジェクト: noble82/proyectos-ULS
         $id_externe = substr($cart_[$z], 2);
         $is_externe = true;
         $requete = "SELECT source_id FROM external_count WHERE rid=" . $id_externe;
         $myQuery = pmb_mysql_query($requete, $dbh);
         $source_id = pmb_mysql_result($myQuery, 0, 0);
         $sql = "select 1 from entrepot_source_{$source_id} where recid='" . $id_externe . "' group by ufield,usubfield,field_order,subfield_order,value";
     }
     $res = pmb_mysql_query($sql, $dbh);
     if ($ligne = pmb_mysql_fetch_array($res)) {
         $nb_fiche++;
         $export = new start_export($id_externe ? $id_externe : $cart_[$z], $typeexport, $is_externe);
         $exportation .= $export->output_notice;
     }
 }
 if ($nb_fiche > 0) {
     $exportation = $export->get_header() . $exportation . $export->get_footer();
     header("Content-type: " . $export->get_mime_type());
     header('Content-Disposition: attachment; filename="export.' . $export->get_suffix() . '"');
     print $exportation;
     global $pmb_logs_activate;
     if ($pmb_logs_activate) {
         global $log, $infos_notice, $infos_expl;
         $rqt = " select empr_prof,empr_cp, empr_ville as ville, empr_year, empr_sexe,  empr_date_adhesion, empr_date_expiration, count(pret_idexpl) as nbprets, count(resa.id_resa) as nbresa, code.libelle as codestat, es.statut_libelle as statut, categ.libelle as categ, gr.libelle_groupe as groupe,dl.location_libelle as location \n\t\t\t\t\t\tfrom empr e\n\t\t\t\t\t\tleft join empr_codestat code on code.idcode=e.empr_codestat\n\t\t\t\t\t\tleft join empr_statut es on e.empr_statut=es.idstatut\n\t\t\t\t\t\tleft join empr_categ categ on categ.id_categ_empr=e.empr_categ\n\t\t\t\t\t\tleft join empr_groupe eg on eg.empr_id=e.id_empr\n\t\t\t\t\t\tleft join groupe gr on eg.groupe_id=gr.id_groupe\n\t\t\t\t\t\tleft join docs_location dl on e.empr_location=dl.idlocation\n\t\t\t\t\t\tleft join resa on e.id_empr=resa_idempr\n\t\t\t\t\t\tleft join pret on e.id_empr=pret_idempr\n\t\t\t\t\t\twhere e.empr_login='******'\n\t\t\t\t\t\tgroup by resa_idempr, pret_idempr";
         $res = pmb_mysql_query($rqt);
         if ($res) {
             $empr_carac = pmb_mysql_fetch_array($res);
             $log->add_log('empr', $empr_carac);
         }
         $log->add_log('num_session', session_id());
         $log->add_log('expl', $infos_expl);
         $log->add_log('docs', $infos_notice);