Hey, all. I have a question that is perplexing to me, but possible simple to others...
Here’s the scenario (the code in question will follow).
I have a module that was built for me that is subscription based in nature. One function allows the customer to purchase a set number of download credits for a year, but releases them every 30 days. (example: customer x purchases 36 download credits for $99. They get released 3 download credits per 30 days).
That said, here’s the code I need help with (question will follow):
Here’s where I need the help:Code:if(in_array(1,$fields)){ if($schedule_period ==1) $nextdate = mktime(0, 0, 0, date("m") , date("d")+30, date("Y")); if($schedule_period ==12) $nextdate = mktime(0, 0, 0, date("m") , date("d")+360, date("Y")); $next_schedule =date("d-m-Y",$nextdate); $next = mktime(0, 0, 0, date("m") , date("d")+$nextdate, date("Y")); $updateon = date("d-m-Y",$nextdate); mysql_query("UPDATE " . TABLE_CUSTOMERS . " SET pending_downloads = $products_downloads ,update_left=$schedule_period,update_on='$updateon',allow_downloads = $products_downloads WHERE customers_id ='".$_SESSION[customer_id]."'");
Logically speaking I need this:
if($schedule_period ==1) then the “UPDATE” should print $updateon for “update_on”.
if($schedule_period ==12) then the “UPDATE” should print todays date +30 for “update_on.”
Does that make sense what I’m asking? I realize I’m not the best in making this make sense, but hopefully that’s enough detail to help get things going.
Feel free to ask any questions. I’ll do my best to talk through this thing.
Thanks!
Cris


Reply With Quote




