parent_form(); } public function callback_days_left($item){ $days = $this->days($item->p_end_date); if($days < 0){ $out = 'Completed'; }else{ $out = '' . $days . ' days left'; } return $out; } private function days($date) { $now = time(); // or your date as well $your_date = strtotime($date); $datediff = $your_date - $now; return round($datediff / (60 * 60 * 24)); } public function callback_featured_image($item){ $src = $item->p_image ? '/uploads/images/'.$item->p_image : '/admin/assets/img/profile.png'; return ''; } public function callback_OreStimate($item){ //$out = $this->OreLavorateByCommessa($item->coIDcommessa); $out = $this->model->GetStimaByCommessa($item->coIDcommessa); //if ($out>0) { return $out;} if ($out>0) { return number_format($out,2);} return number_format(0,2); } public function callback_OreLavorate($item){ //$out = $this->OreLavorateByCommessa($item->coIDcommessa); $out = $this->model->GetOreByCommessa($item->coIDcommessa); //if ($out>0) { return $out;} if ($out>0) { return number_format($out,2);} return number_format(0,2); } //private function OreLavorateByCommessa($idCommessa){ // return '' . $idCommessa . ''; //} }