0 Members and 1 Guest are viewing this topic.

*

bart

  • *
  • 18
  • osDate Version: osDateEvo v1.3
update account as admin is not updating levelend
« on: November 26, 2018, 12:07:20 PM »
Hi,
I have updated a client in the admin area. But now his account is not updated for levelend. He still sees his last levelend.

You can add something like this:

Code: [Select]
$sql = "SELECT `level`, `levelend` FROM `" . $aDatabaseSettings['prefix'] . "user` WHERE (`id` = '" . idealcheckout_escapeSql($aParams['user_id']) . "') LIMIT 1;";
if($aUser = idealcheckout_database_getRecord($sql))
{
$sql = "SELECT `name`, `activedays` FROM `" . $aDatabaseSettings['prefix'] . "membership` WHERE (`roleid` = '" . idealcheckout_escapeSql($aTransaction['to_membership']) . "') LIMIT 1;";
if($aMembership = idealcheckout_database_getRecord($sql))
{
$iActiveDays = $aMembership['activedays'];
}
else
{
$iActiveDays = 365;
}

if(($aUser['level'] != $aTransaction['to_membership']) || ($aUser['levelend'] == '') || ($aUser['levelend'] < time()))
{
$iLevelend = strtotime('+' . $iActiveDays . ' days');
}
else
{
$iLevelend = strtotime('+' . $iActiveDays . ' days', $aUser['levelend']);
}

$sql = "UPDATE `" . $aDatabaseSettings['prefix'] . "user` SET `level` = '" . idealcheckout_escapeSql($aTransaction['to_membership']) . "', `levelend` = '" . idealcheckout_escapeSql($iLevelend) . "' WHERE (`id` = '" . idealcheckout_escapeSql($aParams['user_id']) . "') LIMIT 1";
idealcheckout_database_query($sql) or idealcheckout_log('ERROR: ' . idealcheckout_database_error() . '<br><br>FILE: ' . __FILE__ . '<br><br>LINE: ' . __LINE__);
}

*

bart

  • *
  • 18
  • osDate Version: osDateEvo v1.3
Re: update account as admin is not updating levelend
« Reply #1 on: November 26, 2018, 12:41:32 PM »
ok, solved this by adding an s.

Code: [Select]
$levelend = strtotime("+$activedays days",time());

*

Pharg

  • *****
  • 3,156
    • OsDateFourm
  • osDate Version: osDateEvo v1.3
Re: update account as admin is not updating levelend
« Reply #2 on: November 26, 2018, 08:38:06 PM »
Hi Bart,

I just tested the Membership Management in the admin on osDateEvo v1.3 and it's
working perfectly.

What version osDate are you talking about?
Regards,
Pharg ( Phill )

Don't Personal Message me unless it's about a sensitive matter!!

REMEMBER TO ALWAYS BACKUP BEFORE MAKING ANY CHANGES!!

osDateEvo v1.3 | PHP: 5.3.42 & PHP: 7.2 | MySQL: 5.5.35