Incremental Dates for each record
I am afraid that I am not a php programmer, just a dreamweaver user with a DataAssist server behaviour.
I have created a page which allows users to set up a pre-selected number of pre-payments i.e 1-12, as well as frequency i.e 7, 14, 28 etc as well as a selected date i.e. this can be any date in the future.
This means that I need to enter the first date that they select into the first record then increment each date for the following number of records/pre-payments and the date should increment by the frequency.
I have used dataassist to create the multiple inserts but am stuck on how I should proceed.
So far, I have a hidden date field which I have added the following code...
<input name="hf_date_<?php echo $RepeatSelectionCounter_1; ?>" type="hidden" id="hf_date_<?php echo $RepeatSelectionCounter_1; ?>" value="<?php $date = $row_Recordsetcustomers['date'];
$frequency = $row_Recordsetcustomers['frequency'];
$newdate = strtotime ( '+ 7 day' , strtotime ( $date) ) ;
$newdate = date ( 'Y-m-d H:i:s' , $newdate); echo $newdate; ?>[" />
The repeat selection counter is part of the dataassist server behaviour, so has to remain within the page. The section in bold is the code that I have added. The '+ 7 day' will be the frequency variable.
It appears to add the advanced date, not the initial selected date; and then adds this date to all the pre-payments/records.
Hopefully some one can guide me as to where I am going wrong!
Thanks in advance