SoilentRed
Caaan do!
I've tried countless approaches to this stupid calculation while checking out the posts on the fabrik site. things have gotten wacky and my brain has fallen out.
I simply creating an installment plan
I've read some things about converting the data to / from a string so i added this
but now I get error 500
stripping it all away and just having
actually returns the date, but adding
anywhere results in the date looking like 0000-00-00 00:00:00
Can someone simply help me add a month per row in my loop until a condition is met.
THANKS!!! ADFHSIGNJRETFKVSSKIRVOEFJ
I simply creating an installment plan
Code:
$base = 1600;
$installmentConstant = (int) '{afab_repman_signup___installment_plan_raw}';
$instAmtPaid = (int) '{afab_repman_signup___installment_plan_raw}';
$numOfInstallments = $base / $installmentConstant;
$count = 1;
$date = $formModel->getElementData('afab_repman_signup___first_payment_date');
$date = new DateTime($date);
while ( $installmentConstant <= $base ) {
$myQuery->values(
implode(',',
array(
$myDb->quote('{afab_repman_signup___date_time}'),
$myDb->quote('{afab_repman_signup___new_user_id}'),
$myDb->quote('{afab_repman_signup___nia_agent_id}'),
$myDb->quote($installmentConstant),
$myDb->quote($date),
$myDb->quote($nonMemberRepman),
$myDb->quote('{afab_repman_signup___full_name}'),
$myDb->quote('{afab_repman_signup___company_name}'),
$myDb->quote('{afab_repman_signup___agent_name}'),
$myDb->quote($numOfInstallments),
$myDb->quote($count),
$myDb->quote('{afab_repman_signup___franchise_fee}'),
$myDb->quote('{afab_repman_signup___franchise_charge}')
)
)
);
$installmentConstant = $installmentConstant + $instAmtPaid;
$myDateFormat = $date->modify('+1 month')->format('Y-m-d H:i:s');
$formModel->updateFormData($date, $myDateFormat, true);
$date = new DateTime($date);
$count++;
}
I've read some things about converting the data to / from a string so i added this
Code:
$myDateFormat = $date->modify('+1 month')->format('Y-m-d H:i:s');
$formModel->updateFormData($date, $myDateFormat, true);
$date = new DateTime($date);
stripping it all away and just having
Code:
$date = $formModel->getElementData('afab_repman_signup___first_payment_date');
Code:
$date = new DateTime($date);
anywhere results in the date looking like 0000-00-00 00:00:00
Can someone simply help me add a month per row in my loop until a condition is met.
THANKS!!! ADFHSIGNJRETFKVSSKIRVOEFJ