diff --git a/Repositories/statistics/includes/inc.class.mysql.es.php b/Repositories/statistics/includes/inc.class.mysql.es.php index 7c5d423..0ecd656 100755 --- a/Repositories/statistics/includes/inc.class.mysql.es.php +++ b/Repositories/statistics/includes/inc.class.mysql.es.php @@ -669,7 +669,7 @@ function addFourWeeksCondition ( $range, &$where_parts ) { if ( $range == '4w' ) - $this->addStringCondition( 'request_date', '>=', 'DATE_SUB(CURDATE(),INTERVAL 1 MONTH)', $where_parts ); + $this->addExprCondition( 'request_date', '>=', 'DATE_SUB(CURDATE(),INTERVAL 1 MONTH)', $where_parts ); } /* @@ -714,6 +714,28 @@ $where_parts[] = "$column $op $value"; } + /* + NJS 2006-06-16 + + addExprCondition() + arguments: + $column the name of the SQL column + $op the comparison operator + $expr the expression to be tested + $where_parts reference to an array to which to add the new + condition string + returns: void + + Add to the list of WHERE conditions a generic condition for a + column to be tested against some arbitrary expression. Any + validation of the value should be done prior to calling this + function. + */ + function addExprCondition ( $column, $op, $expr, &$where_parts ) + { + $where_parts[] = "$column $op $expr"; + } + }