Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 52.15.173.197
<?php
//Season type constants
define('SEASON_TYPE_PRE', 0);
define('SEASON_TYPE_REG', 1);
define('SEASON_TYPE_PYF', 2);
define('SEASON_TYPE_MCP', 3);
define('SEASON_TYPE_OTR', 4);
//Register constants
define('STATUS_INACTIVE', 0);
define('STATUS_ACTIVE', 1);
define('STATUS_ARCHIVED', 2);
define('STATUS_DELETED', 3);
//SCOPE
define('SCOPE_PUBLIC', 0);
define('SCOPE_PRIVATE', 1);
define('SCOPE_RESTRICTED', 2);
define('SCOPE_PERSONNAL', 3);
//Historic constants
define('HISTO_LEAGUE', 0);
define('HISTO_TEAM', 1);
define('HISTO_IDENT', 2);
define('HISTO_TRANSFER', 3);
define('HISTO_WAIVER', 4);
define('HISTO_LIBERATION', 5);
//Location constants
define('LOC_RESIDENCE', 0);
define('LOC_BOARDING', 1);
define('LOC_BIRTH', 2);
define('LOC_OTHER', 3);
//Phone constants
define('PHN_PHONE', 0);
define('PHN_CELL', 1);
define('PHN_FAX', 2);
define('PHN_OTHER', 3);
//Url constants
define('URL_EMAIL', 0);
define('URL_WEBSITE', 1);
define('URL_OTHER', 2);
//Physics constants
define('PHYS_SHOT_LEFT', 0);
define('PHYS_SHOT_RIGHT', 1);
define('PHYS_SHOT_UNKNOWN', 2);
//Stats constants
define('STAT_SEASON', 0);
define('STAT_SERIE', 1);
define('STAT_TOURNAMENT', 2);
define('STAT_MEMCUP', 3);
define('STAT_PRESEASON', 4);
define('STAT_OTHER', 5);
//Trade constants
define('TRADE_MODE_PLAYER', 0);
define('TRADE_MODE_CHOICE', 1);
define('TRADE_MODE_OTHER', 2);
define('TRADE_MODE_NO_COMPENSATION', 4);
//STRUCT_LIGUE CONSTANTS
define('STRUCT_LIGUE_LEAGUE_NODE', 1);
define('STRUCT_LIGUE_CONF_NODE', 2);
define('STRUCT_LIGUE_DIV_NODE', 4);
define('STRUCT_LIGUE_TEAM_NODE', 16);
//FILTER CONSTANTS
define('FILTER_MODE_IGNORE', 0);
define('FILTER_MODE_REMOVE', 1);
define('FILTER_MODE_TAKE', 2);
//COLLISION CONSTANTS
define('COLLIDE_MODE_NONE', 0);
define('COLLIDES_MODE_BEFORE', 1);
define('COLLIDES_MODE_UNFINISHED', 2);
define('COLLIDES_MODE_INSIDE', 4);
define('COLLIDES_MODE_BETWEEN', 8);
define('COLLIDES_MODE_AFTER', 16);
//functions used in displaying dates and times
function longtoshortdate($date){
return substr(ereg_replace('[^0-9]', '', $date), 0, 8);
}
function longtoshorttime($time){
return substr(ereg_replace('[^0-9]', '', $time), 0, 4);
}
function shorttolongdate($date){
$date = longtoshortdate($date);
$date_arr['year'] = substr($date, 0, 4);
$date_arr['month'] = substr($date, 4, 2);
$date_arr['day'] = substr($date, 6, 2);
return implode('-', $date_arr);
}
function shorttolongtime($time){
$time = str_pad(longtoshorttime($time), 4, '0', STR_PAD_LEFT);
$time_arr['hours'] = substr($time, 0, 2);
$time_arr['minutes'] = substr($time, 2, 2);
return implode(':', $time_arr).':00';
}
function time_valid($time){
$time_arr = explode(':', $time);
foreach($time_arr as $key => $data){
$time_arr[$key] = (int)$data;
}
if(!is_numeric($time_arr[0]) || $time_arr[0] < 0 || $time_arr[0] > 23){
return false;
}elseif(!is_numeric($time_arr[1]) || $time_arr[1] < 0 || $time_arr[1] > 59){
return false;
}elseif(!is_numeric($time_arr[2]) || $time_arr[2] < 0 || $time_arr[2] > 59){
return false;
}
return true;
}
?>
|