Example #1
0
 public static function create($iduser, $durationMins)
 {
     $model = new CrugeSession();
     $model->iduser = $iduser;
     $model->created = CrugeUtil::now();
     $model->lastusage = $model->created;
     $model->expire = CrugeUtil::makeExpirationDateTime($durationMins);
     $model->status = 1;
     $model->usagecount = 1;
     $model->ipaddress = CrugeUtil::getIpAddress();
     return $model;
 }
Example #2
0
 public static function create($iduser, $durationMins)
 {
     //        1371837161
     //        1371837076
     //        $timestamp = strtotime(time());
     //        echo date("Y-m-d H:i:s", '1371838876');
     //        die(", ".time()."");
     //        die(", ".$durationMins."");
     $model = new CrugeSession();
     $model->iduser = $iduser;
     $model->created = CrugeUtil::now();
     $model->lastusage = $model->created;
     $model->expire = CrugeUtil::makeExpirationDateTime($durationMins);
     $model->status = 1;
     $model->usagecount = 1;
     $model->ipaddress = CrugeUtil::getIpAddress();
     return $model;
 }