query('SELECT * FROM system.todo LEFT JOIN system.user ON system.todo.author = system.user.ID ORDER BY state, time DESC;'); } else { $res = $con->query('SELECT * FROM system_todo LEFT JOIN system_user ON system_todo.author = system_user.ID ORDER BY state, time DESC;'); } $result = '
'. ''.''.''.''.''.''.''.''.''.''; while($row = $res->next()){ $result .= ''. ''.''. ''. ''. ''. ''. ''. ''.''; } $result .= '
'.'Time ago'.''.'Time'.''.'Reporttype'.''.'Message'.''.'Author'.''.'Volunteers'.''.'State'.''.'Action'.'
'.self::time_elapsed_string(strtotime($row['time'])).''.$row['time'].''.self::reporttype($row['type']).''.$row['msg_1'].''.$row['username'].''.'I_S and many more'.''.self::state($row['state']).''. self::statebtn($row['state']). ''. ''. ''.'
'; return $result; } private static function time_elapsed_string($ptime) { $etime = time() - $ptime; if ($etime < 1) { return '0 seconds'; } $a = array( 12 * 30 * 24 * 60 * 60 => 'year', 30 * 24 * 60 * 60 => 'month', 24 * 60 * 60 => 'day', 60 * 60 => 'hour', 60 => 'minute', 1 => 'second' ); foreach ($a as $secs => $str) { $d = $etime / $secs; if ($d >= 1) { $r = round($d); return $r . ' ' . $str . ($r > 1 ? 's' : '') . ' ago'; } } } private static function state($state){ if($state == 1){ return 'Closed';} return 'Open';} private static function statebtn($state){ if($state == 1){ return '';} return '';} private static function reporttype($type){ switch($type){ case 0: return 'Feature Request'; case 1: return 'Error Report'; case 2: return 'Unasigned Category'; default: return 'Note'; } } private static function trclassbytype($type){ switch($type){ case 0: return 'info'; case 1: return 'error'; case 2: return 'warning'; case 3: return 'success'; default: return ''; } } public static function html_li_menu(){return '
  • ToDo
  • ';} public static function right_public(){return false;} public static function right_right(){return \SYSTEM\SECURITY\Security::check(\SYSTEM\SECURITY\RIGHTS::SYS_SAI);} public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_flag_css(){} public static function sai_mod__SYSTEM_SAI_saimod_sys_todo_flag_js(){} }