Subversion Repositories Sigmater

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6 Andrea 1
<?
2
 
3
// controllo della fornitura in ingresso
4
 
5
function select_file ($dir,$selFileName){
6
 
7
	$file_sog	=	"";
8
	$file_tit	=	"";
9
	$file_fab	=	"";
10
	$file_ter	=	"";
11
	$nomeFileSelezionato		=	'';
12
	$estensioneFileSelezionato	=	'';
13
	$nomeFileCartella			=	'';
14
	$estensioneFileCartella		=	'';
15
	$handle=opendir($dir);
16
	list($nomeFileSelezionato,$estensioneFileSelezionato)	=	explode('.',$selFileName);
17
 
18
	while(false!==($filename=readdir($handle)))
19
	{
20
 
21
		if ($filename!='.' AND $filename!='..')
22
		{
23
			list($nomeFileCartella,$estensioneFileCartella)	=	explode('.',$filename);
24
 
25
			if($nomeFileCartella	==	$nomeFileSelezionato)
26
			{
27
				//echo "2)[$nomeFileCartella	==	$nomeFileSelezionato]<br>";
28
				switch ($estensioneFileCartella){
29
					case 'SOG':
30
					$file_sog=$filename;
31
					break;
32
					case 'TIT':
33
					$file_tit=$filename;
34
					break;
35
					case 'FAB':
36
					$file_fab=$filename;
37
					break;
38
					case 'TER':
39
					$file_ter=$filename;
40
					break;
41
					case 'PRM':
42
					$file_prm=$filename;
43
					break;
44
				}
45
			}
46
		}
47
 
48
	}
49
	$in_file[]=$file_sog;
50
	$in_file[]=$file_tit;
51
	$in_file[]=$file_fab;
52
	$in_file[]=$file_ter;
53
	$in_file[]=$file_prm;
54
 
55
 
56
	return $in_file;
57
}
58
 
59
function controllo_file ($dir,$fileName){
60
 
61
 
62
	//26/05/2004 11.40
63
	list($file_sog	,$file_tit,$file_fab,$file_ter,$file_prm)=	select_file($dir,$fileName);
64
 
65
	if (!(($file_sog && $file_tit && $file_fab && $file_prm) Or ($file_sog && $file_tit && $file_ter && $file_prm))) {return false;}
66
 
67
	return true;
68
 
69
}
70
 
71
?>