<?PHP 
$handle=opendir($rootEx."/".$pFileX."/".$SYSMex);
if($handle)
$mailsSum=0;
while($file=readdir($handle))
{$mailsSum++;}
$mailsSum=$mailsSum - 3;
include("./../configure/".$pFileD."-project.inc.php");

// SAVEINFO
$handle=fopen($saveFile, "a+");
fwrite($handle,$mailsSum."\n");
fclose($handle);
$oldumask = umask(0);
chmod($saveFile, 0644);
umask($oldumask);

echo "
<div>

<a href='$slink?projectlink=$pFileX&mailclient=$pFileD'>
<span class='font18'><i class='fa fa-download font18 padd-right5 resB'></i>
</a>
<span class='font18 resB'>".$mailsSum." ".$messagedata1."</span>
<span class='wbx'></span>
<span class='font13'>(".$project1."; ".$pFileX.")</span>
</div>
";

$saveDataMails=$mailsSum." ".$messagedata1." (".$project1.")";
$handle=fopen($saveMailFile, "a+");
fwrite($handle,$saveDataMails);
fclose($handle);
$oldumask = umask(0);
chmod($saveMailFile, 0644);
umask($oldumask);

$handle=fopen($saveFile4, "a+");
fwrite($handle,$saveDataMails."\n");
fclose($handle);
$oldumask = umask(0);
chmod($saveFile2, 0644);
umask($oldumask);
?>
