1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| <?php
$libZend = '../../../library/Zend-1.9.3/';
set_include_path($libZend . PATH_SEPARATOR . get_include_path());
include_once('Zend/Mail.php');
include_once('../config.php');
function getFRDate($date) {
$date_us = $date;
$date_fr = implode('/',array_reverse (explode('-',$date_us)));
return $date_fr;
}
/*** Mise a jour de annonces clients ***/
$sql = "SELECT `poste_id`,`poste_date_update` FROM `clients`,`postes` WHERE `clients`.`cli_id`=`postes`.`cli_id` and `clients`.`cli_actualiseAnnonce`=1";
$query = mysql_query($sql);
while ($row = mysql_fetch_object($query)) {
if (isset($row->poste_date_update)) {
$maDateAjout= SUBSTR($row->poste_date_update,0,10);
$maDateAjout2=getFRDate($maDateAjout);
$dans30jours = date($maDateAjout2, mktime(0, 0, 0, date("m"), date("d")+30, date("Y")));
$dateAuj= SUBSTR (now(),0,10);
if($dateAuj>$dans30jours){
$maDateAujUs=date('Y-m-d H:i:s');
$sql2="UPDATE `postes` SET `poste_date_update`= '".$maDateAujUs."' WHERE `poste_id` ='".$row->poste_id."'";
$query2 = mysql_query($sql2);
}
}
} |
Partager