01-22-2019, 12:37 PM
(This post was last modified: 01-22-2019, 12:38 PM by LBC.)
I can see that from another filled in column which is called membership.
It either says 10cc or 5cc in there (10cc is 12 months, 5cc is 6 months)
Ok. So it will be something like this.
However you figure out the length, it needs to wind up as a 6 or 12.
$length = 6;
then
echo date('Y-m-d', strtotime("+".$length." months", strtotime($user->data()->validity)));
Can you tell me what column stores the length and what the length looks like? Is it a word? is it 6 or 12?
Nope. That's fine.
if($user->data()->membership == '5cc'){
$length = 6;
}elseif($user->data()->membership =='10cc'){
$length = 6;
}
if(isset($length)){
echo date('Y-m-d', strtotime("+".$length." months", strtotime($user->data()->validity)));
}
I think that will do it.
Can you paste the chunk of the form itself from the input of time through lessons left? Maybe copy the code and paste on pastebin and share the link here.