Subversion Repositories ALCASAR

Rev

Rev 2926 | Details | Compare with Previous | Last modification | View Log

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