Subversion Repositories ALCASAR

Rev

Rev 2853 | Go to most recent revision | 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>
9
<?php
323 richard 10
# Choice of language
11
$Language = 'en';
12
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
13
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
14
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
2853 rexy 15
if($Language == 'fr') {
16
  $l_title = "Personnalisation du logo";
323 richard 17
  $l_current_logo = "Logo actuel";
2853 rexy 18
  $l_logo_select ="Sélectionnez un nouveau logo";
2926 rexy 19
  $l_logo_help1 = "votre logo doit être un fichier au format 'PNG'";
2853 rexy 20
  $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";
22
} else if ($Language === 'es') {
23
  $l_title = "Personalización del logo";
24
  $l_current_logo = "Logo actual";
25
  $l_logo_select ="Seleccione un nuevo logo";
2926 rexy 26
  $l_logo_help1 = "su logo debe ser un archivo 'PNG'.";
2853 rexy 27
  $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";
323 richard 29
} else {
2853 rexy 30
  $l_title = "Customizing the logo";
323 richard 31
  $l_current_logo = "Current logo";
32
  $l_logo_select ="Select a new logo";
2926 rexy 33
  $l_logo_help1 = "your logo must be in 'PNG' format";
323 richard 34
  $l_logo_help2 = "the file size must be less than 100KB";
35
  $l_logo_help3 = "refresh your browser in order to see the result";
36
}
37
 
318 richard 38
if(isset($_FILES['logo']))
39
{
40
unset($result);
41
$taille_max = 100000;
42
$destination = '/var/www/html/images/organisme.png';
43
$extension = strstr($_FILES['logo']['name'], '.'); 
44
if ($extension != '.png')
45
	{
2926 rexy 46
	$result = $l_logo_help1;
318 richard 47
	}
48
elseif (file_exists($_FILES['logo']['tmp_name']) and filesize($_FILES['logo']['tmp_name']) > $taille_max)
49
	{
2926 rexy 50
	$result = $l_logo_help2;
318 richard 51
	}
52
if (!isset($result))
53
	{
54
	move_uploaded_file($_FILES['logo']['tmp_name'], $destination);
55
	}
56
}
57
?>
2926 rexy 58
<div class="panel">
59
	<div class="panel-header"><?= $l_title ?></div>
60
	<div class="panel-row">
61
	<table width="100%" border=0 cellspacing=0 cellpadding=1>
62
		<tr><td>
63
		<table width="100%" border=0 cellspacing=0 cellpadding=2>
64
			<tr><td valign="middle" align="left">
65
			<center><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90"></H3></center><BR>
323 richard 66
<? echo "$l_logo_select";?> :
2926 rexy 67
			<form action="logo.php" method=POST ENCTYPE="multipart/form-data">
68
				<input type="file" name="logo">
69
				<input type="hidden" name="MAX_FILE_SIZE" value="100000">
70
				<input type="submit" value="Envoyer">
71
			</form>
318 richard 72
<?php
2926 rexy 73
if (isset($result)){
318 richard 74
	echo '<H3>'; echo $result; echo '</H3><BR>';
2926 rexy 75
} ?>
76
			<? echo "- $l_logo_help1<br>";?>
77
			<? echo "- $l_logo_help2<br>";?>
78
			<? echo "- $l_logo_help3";?>
79
			</td></tr>
80
		</table>
81
		</td></tr>
82
	</table>
83
	</div>
84
</div>
85
</body>
86
</html>