batch/1.1/old/majAsso.php

58 lines
2.9 KiB
PHP
Raw Normal View History

<?
set_time_limit(360);
$eol=" <br/>\r\n";
include_once('/var/www/_includes/mysql.php');
include_once('/var/www/_includes/timer.php');
$con = mysql_pconnect('localhost', 'root', 'catsysyo92');
if (!($con === false)) {
if (mysql_select_db('jo', $con) === false)
die('Could not select database: ' . mysql_error());
}
2013-06-19 08:24:49 +00:00
/** Mise <EFBFBD> jour de la date de d<EFBFBD>claration **
$nbPages=2;
for ($i=0; $i<$nbPages; $i++) {
unset($RP);
$RP=mysql_select('asso', 'Num_Annonce, Date_Parution, Num_Parution, Assoc_Date_Declaration', "1 AND Assoc_Date_Declaration <>'' AND Assoc_Date_Declaration2 IS NULL LIMIT 0,10000");
//Assoc_Date_Declaration, Assoc_Date_Declaration2
$nb=count($RP);
2013-06-19 08:24:49 +00:00
echo date ('Y/m/d - H:i:s') ." - Il y a $nb annonces <20> mettre <20> jour !$eol";
//die();
foreach ($RP as $key => $tabAnn) {
$tabUpdate=array('Assoc_Date_Declaration2'=>dateT('d M Y', 'Y-m-d', $tabAnn['Assoc_Date_Declaration']));
$where="Num_Annonce='".$tabAnn['Num_Annonce']."' AND Date_Parution='".$tabAnn['Date_Parution']."' AND Num_Parution='".$tabAnn['Num_Parution']."'";
if (!mysql_update('asso', $tabUpdate, $where, true))
2013-06-19 08:24:49 +00:00
echo date ('Y/m/d - H:i:s') .' - ERREUR : MySql n<>'. mysql_errno() .') : '. mysql_error() . $eol;
// else
// echo date ('Y/m/d - H:i:s') ." - OK : $where ". dateT('d M Y', 'Y-m-d', $tabAnn['Assoc_Date_Declaration']) . $eol;
}
2013-06-19 08:24:49 +00:00
echo date ('Y/m/d - H:i:s') ." - Mise <20> jour des $i / $nbPages pages...$eol";
flush();
}
**/
$nbPages=1;
for ($i=0; $i<$nbPages; $i++) {
unset($RP);
$RP=mysql_select('asso', 'Num_Annonce, Date_Parution, Num_Parution, Assoc_Date_Declaration, Assoc_Nom, Departement, Type_Annonce, Assoc_Objet, Assoc_Adresse, Assoc_NObjet, Assoc_AObjet, Assoc_NAdresse, Assoc_Fusion, Assoc_Annulation, Assoc_ANom, Assoc_NNom', "1 AND Assoc_Date_Declaration <>'' AND Assoc_Date_Declaration2 IS NULL LIMIT 0,1000");
//Assoc_Date_Declaration, Assoc_Date_Declaration2
$nb=count($RP);
2013-06-19 08:24:49 +00:00
echo date ('Y/m/d - H:i:s') ." - Il y a $nb annonces <20> mettre <20> jour !$eol";
//die();
foreach ($RP as $key => $tabAnn) {
2013-06-19 08:24:49 +00:00
/* SERAPIS Culturel 404 2006-06-03 20060022 24 D<>claration <20> la sous-pr<70>fecture de Sarlat-la-Can<61>... Cr<43>ation (d<>claration d'association)*/
$tabUpdate=array('Assoc_Date_Declaration2'=>dateT('d M Y', 'Y-m-d', $tabAnn['Assoc_Date_Declaration']));
$where="Num_Annonce='".$tabAnn['Num_Annonce']."' AND Date_Parution='".$tabAnn['Date_Parution']."' AND Num_Parution='".$tabAnn['Num_Parution']."'";
if (!mysql_update('asso', $tabUpdate, $where, true))
2013-06-19 08:24:49 +00:00
echo date ('Y/m/d - H:i:s') .' - ERREUR : MySql n<>'. mysql_errno() .') : '. mysql_error() . $eol;
// else
// echo date ('Y/m/d - H:i:s') ." - OK : $where ". dateT('d M Y', 'Y-m-d', $tabAnn['Assoc_Date_Declaration']) . $eol;
}
2013-06-19 08:24:49 +00:00
echo date ('Y/m/d - H:i:s') ." - Mise <20> jour des $i / $nbPages pages...$eol";
flush();
}
echo date ('Y/m/d - H:i:s') ." - FIN !!!$eol";
?>