source: pmb4.2/trunk/fuentes/pmb/admin/netbase/subcollections.inc.php @ 815

Last change on this file since 815 was 815, checked in by jrpelegrina, 4 years ago

Initial release of pmb 4.2

  • Property svn:executable set to *
File size: 2.3 KB
Line 
1<?php
2// +-------------------------------------------------+
3// © 2002-2004 PMB Services / www.sigb.net pmb@sigb.net et contributeurs (voir www.sigb.net)
4// +-------------------------------------------------+
5// $Id: subcollections.inc.php,v 1.12 2015-04-03 11:16:18 jpermanne Exp $
6
7if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) die("no access");
8
9require_once("$class_path/subcollection.class.php");
10
11// la taille d'un paquet de notices
12$lot = SUBCOLLECTION_PAQUET_SIZE; // defini dans ./params.inc.php
13
14// taille de la jauge pour affichage
15$jauge_size = GAUGE_SIZE;
16
17// initialisation de la borne de départ
18if(!isset($start)) $start=0;
19
20$v_state=urldecode($v_state);
21
22print "<br /><br /><h2 align='center'>".htmlentities($msg["nettoyage_suppr_subcollections"], ENT_QUOTES, $charset)."</h2>";
23
24$query = pmb_mysql_query("SELECT sub_coll_id from sub_collections left join notices on sub_coll_id=subcoll_id where subcoll_id is null ");
25$affected=0;
26if($affected = pmb_mysql_num_rows($query)){
27        while ($ligne = pmb_mysql_fetch_object($query)) {
28                $subcoll = new subcollection($ligne->sub_coll_id);
29                $subcoll->delete();
30        }
31}
32
33//Nettoyage des informations d'autorités pour les sous collections
34subcollection::delete_autority_sources();
35
36$query = pmb_mysql_query("update notices left join sub_collections ON sub_coll_id=subcoll_id SET subcoll_id=0 WHERE sub_coll_id is null");
37
38$spec = $spec - CLEAN_SUBCOLLECTIONS;
39$v_state .= "<br /><img src=../../images/d.gif hspace=3>".htmlentities($msg["nettoyage_suppr_subcollections"], ENT_QUOTES, $charset)." : ";
40$v_state .= $affected." ".htmlentities($msg["nettoyage_res_suppr_subcollections"], ENT_QUOTES, $charset);
41$opt = pmb_mysql_query('OPTIMIZE TABLE sub_collections');
42// mise à jour de l'affichage de la jauge
43print "<table border='0' align='center' width='$table_size' cellpadding='0'><tr><td class='jauge'>
44                <img src='../../images/jauge.png' width='$jauge_size' height='16'></td></tr></table>
45                <div align='center'>100%</div>";
46print "
47        <form class='form-$current_module' name='process_state' action='./clean.php?spec=$spec&start=0' method='post'>
48                <input type='hidden' name='v_state' value=\"".urlencode($v_state)."\">
49                <input type='hidden' name='spec' value=\"$spec\">
50                </form>
51        <script type=\"text/javascript\"><!--
52                document.forms['process_state'].submit();
53                -->
54        </script>";
Note: See TracBrowser for help on using the repository browser.