public function get($id) { $get = false; $sp = _daoSp(); $sp->addCondition('idinter', '=', $id); if (count($r = $this->findBy($sp)) > 0) { $get = $r[0]; $now = date('d/m/Y'); $d1 = CopixDateTime::yyyymmddhhiissToTimeStamp($get->datederniere); $d2 = CopixDateTime::timestampToyyyymmdd($d1); $datederniere = CopixDateTime::yyyymmddToDate($d2, '/'); $get->depuis = round(CopixDateTime::timeBetween($datederniere, $now) / (60 * 60 * 24)); //var_dump($get->depuis); } return $get; }