2012-10-16 07:44:31 +00:00
< ?
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 **
2012-10-16 07:44:31 +00:00
$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 " ;
2012-10-16 07:44:31 +00:00
//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 ;
2012-10-16 07:44:31 +00:00
// 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 " ;
2012-10-16 07:44:31 +00:00
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 " ;
2012-10-16 07:44:31 +00:00
//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)*/
2012-10-16 07:44:31 +00:00
$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 ;
2012-10-16 07:44:31 +00:00
// 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 " ;
2012-10-16 07:44:31 +00:00
flush ();
}
echo date ( 'Y/m/d - H:i:s' ) . " - FIN !!! $eol " ;
?>