Subversion Repositories ALCASAR

Rev

Rev 2926 | Only display areas with differences | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2926 Rev 3028
1
<!DOCTYPE HTML>
1
<!DOCTYPE HTML>
2
<html><!-- Written by Rexy -->
2
<html><!-- Written by Rexy -->
3
<head>
3
<head>
4
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
4
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
5
	<title>Logo Customizing</title>
5
	<title>Logo Customizing</title>
6
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
6
	<link rel="stylesheet" href="/css/acc.css" type="text/css">
7
</head>
7
</head>
8
<body>
8
<body>
-
 
9
<div id="ldoverlay" class="overlay">
-
 
10
	<div class="lds-spinner" id="spinner"><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div><div></div></div>
-
 
11
</div>
9
<?php
12
<?php
10
# Choice of language
13
# Choice of language
11
$Language = 'en';
14
$Language = 'en';
12
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
15
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
16
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
17
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
15
if($Language == 'fr') {
18
if($Language == 'fr') {
16
  $l_title = "Personnalisation du logo";
19
  $l_title = "Personnalisation du logo";
17
  $l_current_logo = "Logo actuel";
20
  $l_current_logo = "Logo actuel";
18
  $l_logo_select ="Sélectionnez un nouveau logo";
21
  $l_logo_select ="Sélectionnez un nouveau logo";
19
  $l_logo_help1 = "votre logo doit être un fichier au format 'PNG'";
22
  $l_logo_help1 = "votre logo doit être un fichier au format 'PNG'";
20
  $l_logo_help2 = "la taille de ce fichier doit être inférieure à 100KO";
23
  $l_logo_help2 = "la taille de ce fichier doit être inférieure à 100KO";
21
  $l_logo_help3 = "rafraîchissez les pages de votre navigateur pour voir le résultat";
24
  $l_logo_help3 = "rafraîchissez les pages de votre navigateur pour voir le résultat";
22
} else if ($Language === 'es') {
25
} else if ($Language === 'es') {
23
  $l_title = "Personalización del logo";
26
  $l_title = "Personalización del logo";
24
  $l_current_logo = "Logo actual";
27
  $l_current_logo = "Logo actual";
25
  $l_logo_select ="Seleccione un nuevo logo";
28
  $l_logo_select ="Seleccione un nuevo logo";
26
  $l_logo_help1 = "su logo debe ser un archivo 'PNG'.";
29
  $l_logo_help1 = "su logo debe ser un archivo 'PNG'.";
27
  $l_logo_help2 = "el tamaño de este archivo debe ser inferior a 100KO";
30
  $l_logo_help2 = "el tamaño de este archivo debe ser inferior a 100KO";
28
  $l_logo_help3 = "refresque las páginas de su navegador para ver el resultado";
31
  $l_logo_help3 = "refresque las páginas de su navegador para ver el resultado";
29
} else {
32
} else {
30
  $l_title = "Customizing the logo";
33
  $l_title = "Customizing the logo";
31
  $l_current_logo = "Current logo";
34
  $l_current_logo = "Current logo";
32
  $l_logo_select ="Select a new logo";
35
  $l_logo_select ="Select a new logo";
33
  $l_logo_help1 = "your logo must be in 'PNG' format";
36
  $l_logo_help1 = "your logo must be in 'PNG' format";
34
  $l_logo_help2 = "the file size must be less than 100KB";
37
  $l_logo_help2 = "the file size must be less than 100KB";
35
  $l_logo_help3 = "refresh your browser in order to see the result";
38
  $l_logo_help3 = "refresh your browser in order to see the result";
36
}
39
}
37
 
40
 
38
if(isset($_FILES['logo']))
41
if(isset($_FILES['logo']))
39
{
42
{
40
unset($result);
43
unset($result);
41
$taille_max = 100000;
44
$taille_max = 100000;
42
$destination = '/var/www/html/images/organisme.png';
45
$destination = '/var/www/html/images/organisme.png';
43
$extension = strstr($_FILES['logo']['name'], '.'); 
46
$extension = strstr($_FILES['logo']['name'], '.'); 
44
if ($extension != '.png')
47
if ($extension != '.png')
45
	{
48
	{
46
	$result = $l_logo_help1;
49
	$result = $l_logo_help1;
47
	}
50
	}
48
elseif (file_exists($_FILES['logo']['tmp_name']) and filesize($_FILES['logo']['tmp_name']) > $taille_max)
51
elseif (file_exists($_FILES['logo']['tmp_name']) and filesize($_FILES['logo']['tmp_name']) > $taille_max)
49
	{
52
	{
50
	$result = $l_logo_help2;
53
	$result = $l_logo_help2;
51
	}
54
	}
52
if (!isset($result))
55
if (!isset($result))
53
	{
56
	{
54
	move_uploaded_file($_FILES['logo']['tmp_name'], $destination);
57
	move_uploaded_file($_FILES['logo']['tmp_name'], $destination);
55
	}
58
	}
56
}
59
}
57
?>
60
?>
58
<div class="panel">
61
<div class="panel">
59
	<div class="panel-header"><?= $l_title ?></div>
62
	<div class="panel-header"><?= $l_title ?></div>
60
	<div class="panel-row">
63
	<div class="panel-row">
61
	<table width="100%" border=0 cellspacing=0 cellpadding=1>
64
	<table width="100%" border=0 cellspacing=0 cellpadding=1>
62
		<tr><td>
65
		<tr><td>
63
		<table width="100%" border=0 cellspacing=0 cellpadding=2>
66
		<table width="100%" border=0 cellspacing=0 cellpadding=2>
64
			<tr><td valign="middle" align="left">
67
			<tr><td valign="middle" align="left">
65
			<center><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90"></H3></center><BR>
68
			<center><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90"></H3></center><BR>
66
<? echo "$l_logo_select";?> :
69
<? echo "$l_logo_select";?> :
67
			<form action="logo.php" method=POST ENCTYPE="multipart/form-data">
70
			<form action="logo.php" method=POST ENCTYPE="multipart/form-data">
68
				<input type="file" name="logo">
71
				<input type="file" name="logo">
69
				<input type="hidden" name="MAX_FILE_SIZE" value="100000">
72
				<input type="hidden" name="MAX_FILE_SIZE" value="100000">
70
				<input type="submit" value="Envoyer">
73
				<input type="submit" onClick="document.getElementById('ldoverlay').style.display='block';" value="Envoyer">
71
			</form>
74
			</form>
72
<?php
75
<?php
73
if (isset($result)){
76
if (isset($result)){
74
	echo '<H3>'; echo $result; echo '</H3><BR>';
77
	echo '<H3>'; echo $result; echo '</H3><BR>';
75
} ?>
78
} ?>
76
			<? echo "- $l_logo_help1<br>";?>
79
			<? echo "- $l_logo_help1<br>";?>
77
			<? echo "- $l_logo_help2<br>";?>
80
			<? echo "- $l_logo_help2<br>";?>
78
			<? echo "- $l_logo_help3";?>
81
			<? echo "- $l_logo_help3";?>
79
			</td></tr>
82
			</td></tr>
80
		</table>
83
		</table>
81
		</td></tr>
84
		</td></tr>
82
	</table>
85
	</table>
83
	</div>
86
	</div>
84
</div>
87
</div>
85
</body>
88
</body>
86
</html>
89
</html>
87
 
90