Subversion Repositories ALCASAR

Rev

Rev 323 | Rev 2853 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log

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