$nl->from_dt = DB_DataObject::sqlValue("NOW()");
-
+ $nl->to_dt = DB_DataObject::sqlValue("NOW() + INTERVAL 7 DAY");
if ($ov->find(true)) {
if (strtotime($ov->to_date) > time()) {
continue;
}
$nl->from_dt = $ov->to_date;
-
-
+
if ($ov->rate == $rate) {
// modify the old one to expire
$ov->update($oo);
continue;
}
+ } else {
+ // no previous record...
+ $nl->from_dt = '1970-01-01 00:00:00';
}
- // create a new row.
-
-
-
+ // create a new row.
+ $nl->insert();
}
-
-
-
-
-
}
+
+
+
+
}