if (!preg_match(",^((age|jour|mois|annee)_relatif|date|mois|annee|jour|heure|age)(_[a-z]+)?$,", $col, $regs)) return '';
$boucle = $boucles[$idb];
$table = $boucle->show;
-
+ // si c'est une colonne de la table, ne rien faire
+ if(isset($table['field'][$col])) return '';
+
if (!$table['date'] && !isset($GLOBALS['table_date'][$table['id_table']])) return '';
$pred = $date_orig = isset($GLOBALS['table_date'][$table['id_table']])? $GLOBALS['table_date'][$table['id_table']] : $table['date'];
$col = $regs[1];
# Recherche de l'existence du champ date_xxxx,
# si oui choisir ce champ, sinon choisir xxxx
- if ($table['field']["date$suite"])
+ if (isset($table['field']["date$suite"]))
$date_orig = 'date'.$suite;
else
$date_orig = substr($suite, 1);
$col_vraie = "";// comparer a un int (par defaut)
break;
case 'jour_relatif':
- $col = "LEAST(TO_DAYS(".$date_compare.")-TO_DAYS(".
- $date_orig."), DAYOFMONTH(".$date_compare.
- ")-DAYOFMONTH(".$date_orig.")+30.4368*(MONTH(".
- $date_compare.")-MONTH(".$date_orig.
- "))+365.2422*(YEAR(".$date_compare.")-YEAR(".
- $date_orig.")))";
+ $col = "(TO_DAYS(".$date_compare.")-TO_DAYS(".$date_orig."))";
$col_vraie = "";// comparer a un int (par defaut)
break;
case 'mois_relatif':