Subversion Repositories ALCASAR

Rev

Rev 318 | Rev 2817 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
318 richard 1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2
<HTML><!-- Written by Rexy -->
3
<HEAD>
323 richard 4
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
318 richard 5
<TITLE>Modif logo organisme</TITLE>
6
<link rel="stylesheet" href="/css/style.css" type="text/css">
7
<SCRIPT language="javascript" type="text/javascript">
8
function rafraichissement(cadre1, val1)
9
{
10
	eval(cadre1+".location='"+val1+"'");
11
}
12
</SCRIPT>	
13
</HEAD>
14
<body>
15
<?php
323 richard 16
# Choice of language
17
$Language = 'en';
18
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
19
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
20
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
21
if($Language == 'fr'){
22
  $l_title = "Personnalisation du logo d'organisme";
23
  $l_current_logo = "Logo actuel";
24
  $l_logo_select ="S&eacute;lectionnez un nouveau logo";
25
  $l_logo_help1 = "votre logo doit &ecirc;tre un fichier au format libre 'PNG'";
26
  $l_logo_help2 = "la taille de ce fichier doit &ecirc;tre inf&eacute;rieure &agrave; 100Ko";
27
  $l_logo_help3 = "rafra&icirc;chissez les pages de votre navigateur pour voir le r&eacute;sultat";
28
} else {
29
  $l_title = "Customizing the agency logo";
30
  $l_current_logo = "Current logo";
31
  $l_logo_select ="Select a new logo";
32
  $l_logo_help1 = "your logo must be in open 'PNG' format";
33
  $l_logo_help2 = "the file size must be less than 100KB";
34
  $l_logo_help3 = "refresh your browser in order to see the result";
35
}
36
 
318 richard 37
if(isset($_FILES['logo']))
38
{
39
unset($result);
40
$taille_max = 100000;
41
$destination = '/var/www/html/images/organisme.png';
42
$extension = strstr($_FILES['logo']['name'], '.'); 
43
if ($extension != '.png')
44
	{
45
	$result = 'Veuillez s&eacute;lectionner un fichier de type png !';
46
	}
47
elseif (file_exists($_FILES['logo']['tmp_name']) and filesize($_FILES['logo']['tmp_name']) > $taille_max)
48
	{
49
	$result = 'La taille du fichier doit &ecirc;tre inf&eacute;rieur &agrave; 100Ko !';
50
	}
51
if (!isset($result))
52
	{
53
	move_uploaded_file($_FILES['logo']['tmp_name'], $destination);
54
	}
55
}
56
?>
57
<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
323 richard 58
<tr><th><? echo "$l_title";?></th></tr>
318 richard 59
	<tr bgcolor="#FFCC66"><td><img src="/images/pix.gif" width="1" 
60
height="2"></td></tr>
61
</TABLE>
62
<TABLE width="100%" border=0 cellspacing=0 cellpadding=1>
63
	<tr bgcolor="#666666"><td>
64
	<TABLE width="100%" border=0 cellspacing=0 cellpadding=2>
65
		<tr><td valign="middle" align="left">
323 richard 66
		<CENTER><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90"></H3></center><BR>
67
<? echo "$l_logo_select";?> :
318 richard 68
		<FORM action="logo.php" method=POST ENCTYPE="multipart/form-data">
69
			<input type="file" name="logo">
70
			<input type="hidden" name="MAX_FILE_SIZE" value="100000">
71
			<input type="submit" value="Envoyer">
72
		</FORM>
73
<?php
74
if (isset($result))
75
{
76
	echo '<H3>'; echo $result; echo '</H3><BR>';
77
}
78
?>
323 richard 79
	<li><? echo "$l_logo_help1";?>
80
	<li><? echo "$l_logo_help2";?>
81
	<li><? echo "$l_logo_help3";?>
318 richard 82
		</TD></TR>
83
	</TABLE>
84
	</td></tr>
85
</TABLE>
86
</BODY>
87
</HTML>