Location: PHPKode > projects > Phpress > phpress/popup_up.php
<?
/*
    Copyright (C)2004-2007  Matthieu Perez - hide@address.com

    This file is part of PhPress.

    PhPress is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    PhPress is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with PhPress.  If not, see <http://www.gnu.org/licenses/>.
*/
// la partie supérieure du popup scan
session_start();

// rafraîchissement toutes les secondes
print '<META HTTP-EQUIV="refresh" CONTENT="1" >';

require 'program/common/constantes.php' ;
require LANG_PATH . $lang ."/msg.php";
//require 'program/html/default.css';
require 'program/html/lightblue.css';
// on vérifie le contenu du dossier où arrivent les fichiers scannés
//if 
$dh = opendir(IMG_SCAN_PATH);
//{
 while(false !== ($filename = readdir($dh))) 
     {
      //$filename = readdir($dh);
      $files[] = $filename;
    //
      # Sort and reset the arrays
      sort( $files ); reset( $files );
      //print "1-> $files[2]<br>2-> $files[3]";
    }
// closedir($dh);
// }

// s'il y a plusieurs fichiers, la situation est ambigue et on arrète tout
/*
if($files[3])
{
print '<font color="red">' . MSG_SCAN_2FILES . "</font> => $files[3] !<br>";
}*/
// sinon, s'il y a un fichier, on affiche son volume et son nom
//else 
if($files[2])// and !$files[3])
{
$scan_img=($files[2]);
$img_size=filesize(IMG_SCAN_PATH . $scan_img);
$Mo_img_size=number_format($img_size/1048576, 1, ',', ' ');

print '<table width="100%"><tbody bgcolor="red" valign="top"><tr><td>
<div align="center">' . MSG_SCAN_RUNNING . '
</div></td></tr></tbody></table><br>' .
 TXT_FILE .' :<br><blue><a href="' . IMG_SCAN_PATH.$scan_img.'" Content-type: image/tif target="display" >'.$scan_img.'</a><blue>
<br>=>'.
"<font color=\"blue\">$img_size</font> octets (<font color=\"blue\">$Mo_img_size</font> Mo)<br>";
}

// s'il n'y a aucun fichier on affiche le message d'attente
else if(!$files[2])
{
print '<table width="100%"><tbody bgcolor="yellow" valign="top"><tr><td>
 <div align="center">' . MSG_SCAN_READY . "</div>
 </div></td></tr></tbody></table><br> <br><br><br>";
}

// on affiche; dans tous les cas, l'espace libre du volume où se trouve phpress
$free_space=disk_free_space( $DOCUMENT_ROOT);
$Mo_free_space=number_format($free_space/1048576, 2, ',', ' ');
print '<br><br><div align="center">' . MSG_FREE_SPACE . " : <font color=\"blue\">$Mo_free_space</font> Mo</div>";

// on efface le cache des fonctions appelées plus haut
clearstatcache();
?>
Return current item: Phpress