Esempio n. 1
0
 public static function Create($domain, $tld_id, $customerid, $orderitemid, $statusid = "", $authcode = "")
 {
     $thedomain = new Domains();
     if (!is_numeric($statusid)) {
         $statusid = Statuses::id("processing", "domains");
     }
     list($domain, $tld) = explode('.', $domain);
     $retval = self::findByDomainName($domain, $tld, null, true);
     $date_end = Shineisp_Commons_Utilities::add_date(date('d-m-Y'), null, 12);
     $tldInfo = DomainsTlds::getbyID($tld_id);
     if (count($retval) == 0) {
         $thedomain->domain = $domain;
         $thedomain->tld = $tldInfo['WhoisServers']['tld'];
         $thedomain->tld_id = $tldInfo['tld_id'];
         $thedomain->customer_id = $customerid;
         $thedomain->orderitem_id = $orderitemid;
         $thedomain->status_id = $statusid;
         $thedomain->registrars_id = Isp::getActiveISPID();
         $thedomain->creation_date = date('Y-m-d');
         $thedomain->expiring_date = Shineisp_Commons_Utilities::formatDateIn($date_end);
         $thedomain->modification_date = date('Y-m-d');
         $thedomain->authinfocode = $authcode;
         $thedomain->autorenew = true;
         $thedomain->save();
         return $thedomain->getIncremented();
     } else {
         return $retval[0]['domain_id'];
     }
 }