Subversion Repositories ALCASAR

Rev

Rev 1805 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 1805 Rev 1831
Line 87... Line 87...
87
	if (!$now)
87
	if (!$now)
88
		$now = time();
88
		$now = time();
89
	return ($now - $timest);
89
	return ($now - $timest);
90
}
90
}
91
 
91
 
92
function date2time($date)
-
 
93
{
-
 
94
	list($day,$time)=explode(' ',$date);
-
 
95
	$day = explode('-',$day);
-
 
96
	$time = explode(':',$time);
-
 
97
	$timest = mktime($time[0] ?"":0,$time[1],$time[2],$day[1],$day[2],$day[0]);
-
 
98
	return $timest;
-
 
99
}
-
 
100
 
-
 
101
function bytes2str($bytes)
92
function bytes2str($bytes)
102
{
93
{
103
	$bytes=floor($bytes);
94
	$bytes=floor($bytes);
104
	if ($bytes > 536870912)
95
	if ($bytes > 536870912)
105
		$str = sprintf("%5.2f GBs", $bytes/1073741824);
96
		$str = sprintf("%5.2f GBs", $bytes/1073741824);
Line 115... Line 106...
115
{
106
{
116
	return $ret;
107
	return $ret;
117
}
108
}
118
function check_defaults($val,$op,$def)
109
function check_defaults($val,$op,$def)
119
{
110
{
120
	for($i=0;$i<$def['count'];$i++){
111
	for($i=0;isset($def['count']) && $i<$def['count'];$i++){
121
		if ($val == $def[$i] && ($op == '' || $op == $def['operator'][$i]))
112
		if ($val == $def[$i] && ($op == '' || $op == $def['operator'][$i]))
122
			return 1;
113
			return 1;
123
	}
114
	}
124
 
115
 
125
	return 0;
116
	return 0;