Subversion Repositories Sigmater

Rev

Blame | Last modification | View Log | Download | RSS feed

<?

// controllo della fornitura in ingresso

function select_file ($dir,$selFileName){

        $file_sog       =       "";
        $file_tit       =       "";
        $file_fab       =       "";
        $file_ter       =       "";
        $nomeFileSelezionato            =       '';
        $estensioneFileSelezionato      =       '';
        $nomeFileCartella                       =       '';
        $estensioneFileCartella         =       '';
        $handle=opendir($dir);
        list($nomeFileSelezionato,$estensioneFileSelezionato)   =       explode('.',$selFileName);

        while(false!==($filename=readdir($handle)))
        {

                if ($filename!='.' AND $filename!='..')
                {
                        list($nomeFileCartella,$estensioneFileCartella) =       explode('.',$filename);

                        if($nomeFileCartella    ==      $nomeFileSelezionato)
                        {
                                //echo "2)[$nomeFileCartella    ==      $nomeFileSelezionato]<br>";
                                switch ($estensioneFileCartella){
                                        case 'SOG':
                                        $file_sog=$filename;
                                        break;
                                        case 'TIT':
                                        $file_tit=$filename;
                                        break;
                                        case 'FAB':
                                        $file_fab=$filename;
                                        break;
                                        case 'TER':
                                        $file_ter=$filename;
                                        break;
                                        case 'PRM':
                                        $file_prm=$filename;
                                        break;
                                }
                        }
                }

        }
        $in_file[]=$file_sog;
        $in_file[]=$file_tit;
        $in_file[]=$file_fab;
        $in_file[]=$file_ter;
        $in_file[]=$file_prm;


        return $in_file;
}

function controllo_file ($dir,$fileName){


        //26/05/2004 11.40
        list($file_sog  ,$file_tit,$file_fab,$file_ter,$file_prm)=      select_file($dir,$fileName);

        if (!(($file_sog && $file_tit && $file_fab && $file_prm) Or ($file_sog && $file_tit && $file_ter && $file_prm))) {return false;}

        return true;

}

?>