format('y-m-d')); $rangeEndMicrotime = gmmktime(0, 0, 0, $m1 , $d1, $y1); $nowMicrotime = gmmktime(0, 0, 0); if($rangeEndMicrotime < $nowMicrotime ) return false; if($rangeEndMicrotime === $nowMicrotime ) //caso seja o mesmo dia verifica a hora do evento. { $sTime = new DateTime( '@'.(int)($startTime / 1000) , new DateTimeZone('UTC') ); $eventHour = (date_format( $sTime , 'H') * 3600) + (date_format( $sTime , 'i') * 60) + date_format( $sTime , 's'); $nowHour = (gmdate('H') * 3600) + (gmdate('i') * 60) + gmdate('s'); if( $eventHour < $nowHour ) return false; } return true; } /** * Resgata o organizador do evento * * @license http://www.gnu.org/copyleft/gpl.html GPL * @author Consórcio Expresso Livre - 4Linux (www.4linux.com.br) e Prognus Software Livre (www.prognus.com.br) * @sponsor Caixa Econômica Federal * @author Cristiano Corrêa Schmidt * @access public */ protected static function getOrganizer( &$schedulable ) { $f = Controller::find(array('concept' => 'participant') , false , array('deepness' => '1' , 'filter' => array('AND' , array('=', 'schedulable' , $schedulable ) , array('=', 'isOrganizer' , '1')))); return ( isset( $f[0] ) ) ? $f[0] : false; } public static function lg($print, $name = ''){ ob_start(); print "\n"; print $name . ": "; print_r( $print ); $output = ob_get_clean(); file_put_contents( "/tmp/prototype.log", $output , FILE_APPEND ); } } ?>