Subversion Repositories ALCASAR

Rev

Rev 2853 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log

<!DOCTYPE HTML>
<html><!-- Written by Rexy -->
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Logo Customizing</title>
        <link rel="stylesheet" href="/css/acc.css" type="text/css">
</head>
<body>
<?php
# Choice of language
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])){
  $Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
  $Language = strtolower(substr(chop($Langue[0]),0,2)); }
if($Language == 'fr') {
  $l_title = "Personnalisation du logo";
  $l_current_logo = "Logo actuel";
  $l_logo_select ="Sélectionnez un nouveau logo";
  $l_logo_help1 = "votre logo doit être un fichier au format 'PNG'";
  $l_logo_help2 = "la taille de ce fichier doit être inférieure à 100KO";
  $l_logo_help3 = "rafraîchissez les pages de votre navigateur pour voir le résultat";
} else if ($Language === 'es') {
  $l_title = "Personalización del logo";
  $l_current_logo = "Logo actual";
  $l_logo_select ="Seleccione un nuevo logo";
  $l_logo_help1 = "su logo debe ser un archivo 'PNG'.";
  $l_logo_help2 = "el tamaño de este archivo debe ser inferior a 100KO";
  $l_logo_help3 = "refresque las páginas de su navegador para ver el resultado";
} else {
  $l_title = "Customizing the logo";
  $l_current_logo = "Current logo";
  $l_logo_select ="Select a new logo";
  $l_logo_help1 = "your logo must be in 'PNG' format";
  $l_logo_help2 = "the file size must be less than 100KB";
  $l_logo_help3 = "refresh your browser in order to see the result";
}

if(isset($_FILES['logo']))
{
unset($result);
$taille_max = 100000;
$destination = '/var/www/html/images/organisme.png';
$extension = strstr($_FILES['logo']['name'], '.'); 
if ($extension != '.png')
        {
        $result = $l_logo_help1;
        }
elseif (file_exists($_FILES['logo']['tmp_name']) and filesize($_FILES['logo']['tmp_name']) > $taille_max)
        {
        $result = $l_logo_help2;
        }
if (!isset($result))
        {
        move_uploaded_file($_FILES['logo']['tmp_name'], $destination);
        }
}
?>
<div class="panel">
        <div class="panel-header"><?= $l_title ?></div>
        <div class="panel-row">
        <table width="100%" border=0 cellspacing=0 cellpadding=1>
                <tr><td>
                <table width="100%" border=0 cellspacing=0 cellpadding=2>
                        <tr><td valign="middle" align="left">
                        <center><H3><? echo "$l_current_logo";?> : <img src="/images/organisme.png" width="90"></H3></center><BR>
<? echo "$l_logo_select";?> :
                        <form action="logo.php" method=POST ENCTYPE="multipart/form-data">
                                <input type="file" name="logo">
                                <input type="hidden" name="MAX_FILE_SIZE" value="100000">
                                <input type="submit" value="Envoyer">
                        </form>
<?php
if (isset($result)){
        echo '<H3>'; echo $result; echo '</H3><BR>';
} ?>
                        <? echo "- $l_logo_help1<br>";?>
                        <? echo "- $l_logo_help2<br>";?>
                        <? echo "- $l_logo_help3";?>
                        </td></tr>
                </table>
                </td></tr>
        </table>
        </div>
</div>
</body>
</html>