source: pmb4.2/trunk/fuentes/pmb/admin/netbase/relations1.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: 3.5 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: relations1.inc.php,v 1.16 2015-04-03 11:16:18 jpermanne Exp $
6
7if (stristr($_SERVER['REQUEST_URI'], ".inc.php")) die("no access");
8
9// la taille d'un paquet de notices
10$lot = SERIE_PAQUET_SIZE; // defini dans ./params.inc.php
11
12// taille de la jauge pour affichage
13$jauge_size = GAUGE_SIZE;
14
15// initialisation de la borne de départ
16if(!isset($start)) $start=0;
17
18$v_state=urldecode($v_state);
19
20print "<br /><br /><h2 align='center'>".htmlentities($msg["nettoyage_clean_relations_ban"], ENT_QUOTES, $charset)."</h2>";
21
22$query = pmb_mysql_query("DELETE bannettes FROM bannettes LEFT JOIN empr ON proprio_bannette = id_empr WHERE id_empr IS NULL AND proprio_bannette !=0");
23$affected += pmb_mysql_affected_rows();
24$query = pmb_mysql_query("DELETE equations FROM equations LEFT JOIN empr ON proprio_equation = id_empr WHERE id_empr IS NULL AND proprio_equation !=0 ");
25$affected += pmb_mysql_affected_rows();
26$query = pmb_mysql_query("DELETE bannette_equation FROM bannette_equation LEFT JOIN bannettes ON num_bannette = id_bannette WHERE id_bannette IS NULL ");
27$affected += pmb_mysql_affected_rows();
28$query = pmb_mysql_query("DELETE bannette_equation FROM bannette_equation LEFT JOIN equations on num_equation=id_equation WHERE id_equation is null");
29$affected += pmb_mysql_affected_rows();
30$query = pmb_mysql_query("DELETE bannette_abon FROM bannette_abon LEFT JOIN empr on num_empr=id_empr WHERE id_empr is null");
31$affected += pmb_mysql_affected_rows();
32$query = pmb_mysql_query("DELETE bannette_abon FROM bannette_abon LEFT JOIN bannettes ON num_bannette=id_bannette WHERE id_bannette IS NULL ");
33$affected += pmb_mysql_affected_rows();
34$query = pmb_mysql_query("delete caddie_content from caddie join caddie_content on (idcaddie=caddie_id and type='NOTI') left join notices on object_id=notice_id where notice_id is null");
35$affected = pmb_mysql_affected_rows();
36
37$query = pmb_mysql_query("delete bannette_contenu FROM bannette_contenu left join notices on num_notice=notice_id where notice_id is null ");
38$affected += pmb_mysql_affected_rows();
39
40$query = pmb_mysql_query("delete bannette_contenu FROM bannette_contenu left join bannettes on num_bannette=id_bannette where id_bannette is null ");
41$affected += pmb_mysql_affected_rows();
42
43$query = pmb_mysql_query("DELETE avis FROM avis LEFT JOIN notices ON num_notice=notice_id WHERE notice_id IS NULL ");
44
45$query = pmb_mysql_query("DELETE FROM categories WHERE libelle_categorie='' ");
46
47$v_state .= "<br /><img src=../../images/d.gif hspace=3>".htmlentities($msg["nettoyage_suppr_relations"], ENT_QUOTES, $charset)." : ";
48$v_state .= $affected." ".htmlentities($msg["nettoyage_res_suppr_relations_ban"], ENT_QUOTES, $charset);
49$opt = pmb_mysql_query('OPTIMIZE TABLE bannette_contenu');
50// mise à jour de l'affichage de la jauge
51print "<table border='0' align='center' width='$table_size' cellpadding='0'><tr><td class='jauge'>
52                        <img src='../../images/jauge.png' width='$jauge_size' height='16'></td></tr></table>
53                        <div align='center'>100%</div>";
54print "
55        <form class='form-$current_module' name='process_state' action='./clean.php' method='post'>
56                <input type='hidden' name='v_state' value=\"".urlencode($v_state)."\">
57                <input type='hidden' name='spec' value=\"$spec\">
58                <input type='hidden' name='pass2' value=\"2\"
59        </form>
60        <script type=\"text/javascript\"><!--
61                document.forms['process_state'].submit();
62                -->
63        </script>";
Note: See TracBrowser for help on using the repository browser.