It was only a test to see if it works.... I am trying all kinds of possibilities to achieve what i need.
The mail has to be send 14days after publishing a new listing because it is annoying for advertiser that if you put an item for sale you instantly receive an email on how to change status.... After 14 days is more logical because then you can start saying to advertiser that if the item isn't sold yet they can use promotional offers on your site to sell more easily and faster.
For a programmer this probably takes 15 min off time ...... For me 3days till now :-)
Next tryout is this in ModelBO:
public function date_range($pk_i_id, $first, $last, $step = '+14 day', $output_format = 'd/m/Y') {
$dao = new DAO();
$table = 't_item';
$dao->dao->select('dt_expiration_date');
$dao->dao->where('pk_i_id', $pk_i_id);
$dao->dao->from(DB_TABLE_PREFIX . $table);
$result = $dao->dao->get();
$dates = array();
$current = strtotime($first);
$last = strtotime($last);
while( $current <= $last ) {
$dates[] = date($output_format, $current);
$current = strtotime($step, $current);
}
return $dates;
}
}