/** * Save Product Purchase */ public function save() { $nextBillingDate = DBConnection::format_date($this->post['nextbillingdate']); $this->get['ppurchase']->setTerm($this->post['term']->getTermLength()); $this->get['ppurchase']->setNextBillingDate($nextBillingDate); $this->get['ppurchase']->setNote($this->post['note']); update_ProductPurchaseDBO($this->get['ppurchase']); // Success $this->setMessage(array("type" => "[CHANGES_SAVED]")); $this->reload(); }
/** * Save Hosting Service Purchase */ public function save() { $nextBillingDate = DBConnection::format_date($this->post['nextbillingdate']); $this->get['hspurchase']->setTerm($this->post['term']->getTermLength()); $this->get['hspurchase']->setNextBillingDate($nextBillingDate); $this->get['hspurchase']->setDomainName($this->post['domain']); $this->get['hspurchase']->setServerID($this->post['server']->getID()); $this->get['hspurchase']->setNote($this->post['note']); update_HostingServicePurchaseDBO($this->get['hspurchase']); // Success $this->setMessage(array("type" => "[CHANGES_SAVED]")); $this->reload(); }
/** * Increment Next Billing Date */ public function incrementNextBillingDate() { $nextBillingDateTS = DBConnection::date_to_unix($this->getNextBillingDate()); $oldBillingDate = getdate($nextBillingDateTS); $nextBillingDate = DBConnection::format_date(mktime(0, 0, 1, $oldBillingDate['mon'] + $this->getTerm(), $oldBillingDate['mday'], $oldBillingDate['year'])); $this->setNextBillingDate($nextBillingDate); return $nextBillingDate; }