Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<?php
// To select correct option by default
function get_selected_option($option, $right)
{
if ($option == $right)
{
return "selected";
}
}
// Test if checkbox selected
function get_mailing_checkbox($checked)
{
if ($checked == 1)
{
return "checked";
}
}
function get_right_name($right)
{
if ($right == 1)
return "Basic";
else if ($right == 2)
return "Guest";
else if ($right == 3)
return "";
else if ($right == 4)
return "EpiReg";
else if ($right == 5)
return "Reporter";
else if ($right == 6)
return "Priv Guest";
else if ($right == 7)
return "EPTV";
else if ($right == 8)
return "Root EPTV";
}
function get_date(){ // rcupre la date
$date = "";
if (strlen($date_court) < 2) {
$date = $date_court;
}
$date .= date("Y/m/d");
return ($date);
}
function get_filesize($path)
{
$size = round(filesize($path)/1000000);
return ($size);
}
function get_time(){ // rcupre l'heure
$time = date("h:i");
return($time);
}
//Try PHP header redirect, then Java redirect, then try http redirect.:
function redirect($url) {
if (!headers_sent()) {
//If headers not sent yet... then do php redirect
header('Location: '.$url);
exit;
}
else {
//If headers are sent... do java redirect... if java disabled, do html redirect.
echo '<script type="text/javascript">';
echo 'window.location.href="'.$url.'";';
echo '</script>';
echo '<noscript>';
echo '<meta http-equiv="refresh" content="0;url='.$url.'" />';
echo '</noscript>';
exit;
}
}