This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » PHP » Incremental Dates for each record
Reply

Incremental Dates for each record

john henderson
Member



Since: 05 Feb 2009
Posts: 5
Posted 26 May 2009 16:25:24

Hi All,

I am afraid that I am not a php programmer, just a dreamweaver user with a DataAssist server behaviour. [:I]

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.

It appears to add the advanced date, not the user selected date; and then adds it to all the pre-payments/records. [!]

Hopefully some one can guide me as to where I am going wrong!

Thanks in advance


John Henderson

Hi All,

I am afraid that I am not a php programmer, just a dreamweaver user with a DataAssist server behaviour. [:I]

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.

It appears to add the advanced date, not the user selected date; and then adds it to all the pre-payments/records. [!]

Hopefully some one can guide me as to where I am going wrong!

Thanks in advance


John Henderson
Patrick Julicher
Official Representative



Since: 04 Feb 2002
Posts: 1,208
Replied 25 Jun 2009 16:05:52
Hi John,

Did you contact DataAssist with this question?

Kind regards, Patrick
john henderson
Member



Since: 05 Feb 2009
Posts: 5
Replied 15 Sep 2009 18:33:17
Sorry for such a late reply, but I did contact DataAssist and they helped me as much as they could. In the end, after endless searches I found the answer myself through examples and trial and error.

Thanks for asking
Patrick Julicher
Official Representative



Since: 04 Feb 2002
Posts: 1,208
Replied 16 Sep 2009 17:34:11
Hi John,

Thanks for your feedback.

Kind regards, Patrick

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency