doctrine - Temporary users in Zend framework 2 -
i'm struggling temporary users in zend framework 2. want cms temporary users. give them startdate , enddate, want check if they're active , current date between start , enddate.
the "out of date" no value in database, can't check on database. possible check in login zfcuser if user active , not out of date?
my overview users working check, other pictogram when user out of date. example:
public function customstate() { $state = $this->getstate(); $curdate = new \datetime('midnight'); //if (state = 1 , current date after startdate) , (current date before enddate or enddate empty) if (($state == '1' && $this->startdate <= $curdate) && ($curdate <= $this->enddate || !isset($this->enddate))) { $this->setstate('1'); } //if state = 1 , currentdate not between start- , enddate, set state on 2 elseif ($state == '1' && ($this->startdate > $curdate || $curdate > $this->enddate)) { $this->setstate('2'); } //if state = 2, set state on 3 elseif ($state == '2') { $this->setstate('3'); } }
so create "customstate" "active", "out of date", , "inactive". in database have state (with active , inactive) , start , enddate. idea how fix this?
Comments
Post a Comment