<?php header('Content-Type: text/html; charset=windows-1251'); ?>
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Browse card file</title>
</head>
<body background="../../../../d~e~f/bkg.gif">
<TABLE width="100%" height=100% >
<TBODY>
<TR>
<TD style="BACKGROUND: silver" height=100% vAlign=center width="90%">
<?php
$ifi="page.htm";
$posl="";                         // 
$l = file($ifi);                  
$kkk=0;
foreach ($l as $li => $lin)  
{if (strpos($lin,"<A name=")>0 or  strpos($lin,"karp(")>0)
{$posl=$posl.",".$li;$kkk++;}}
if (isset($_REQUEST['pass']))   //  
{$pass=trim($_REQUEST['pass']);
 $pass=md5($pass,false);
}
else
{$pass="";}
$ok=false;
list($pas1, $pas2) = explode("/pages/",$_SERVER['REQUEST_URI']); 
list($pas1, $pas2) = explode(".",$pas2); 
$pas1=str_replace('%5E','^',$pas1);			//
if (strpos(getcwd ( ),"contents")>0)  // 
{
$fpas=getcwd ( )."/p.txt";
}
else
{
$fpas=getcwd ( )."/".$pas1."/p.txt";
}


if (file_exists($fpas))         //  
{$l = file($fpas); 			    // 
 foreach ($l as $li => $lin)    // 
 {$pass1=$lin;break;}
 if ($pass!=$pass1)
 {
echo '<br><br>';

echo '<form id=feg  method="POST" enctype="multipart/form-data" action="'.$_SERVER['REQUEST_URI'].'" >';
echo '<center style="width:100%"><b style="color:red">This page is password protected, enter the password for access.</b><br><br>';
echo '<input type="password" name="pass" size="25" value="">';
echo '<input type="submit" value="submit" name="pas" style="width:80px;background:transparent"> &nbsp;&nbsp;&nbsp;';
echo '<input type="hidden" value="<?php echo $fff; ?>" name="fff">';
 if ($pass!="")
{ echo "<br><br><center><b style='color:red'>Enter the correct password!</b></center> ";} 

echo '<input type="hidden" value="<?php echo $pw; ?>" name="pw"></form>';
die;
}
else
{$ok=true;}

}
else
{$ok=true;}

if ($ok)
{
echo'<IFRAME id=ifrpp height="100%" width="100%" scrolling=yes  border=1 src="page-card-file.php?p=page.htm&be=0&td="></IFRAME></TD></TR>';
echo '<TR><TD align=middle>';
}
?>
<b>card-file</b>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<IMG border=1 onclick=mov(1) alt="to top" src="../../../../d~e~f/pp1.gif" width=19 height=19>&nbsp;&nbsp;&nbsp; 
<IMG border=1 onclick=mov(3) alt="backward" src="../../../../d~e~f/pp2.gif" width=19 height=19>&nbsp;&nbsp;&nbsp; 
<IMG border=1 onclick=mov(2)  alt="forward" src="../../../../d~e~f/pp3.gif" width=19 height=19>&nbsp;&nbsp;&nbsp; 
<IMG border=1 onclick=mov(4) alt="to end" src="../../../../d~e~f/pp4.gif" width=19 height=19>&nbsp;&nbsp;&nbsp; 
<?php
echo "<b style='height:23' id=be>1</b><b style='height:23'>/</b><b id=en style='height:23'>".$kkk;
echo "<b id=ifi style='display:none'>".$ifi.'</b>';
?>
</TD></TR></TBODY></TABLE>
</body>
<script type="text/javascript">
var mg="<?php  echo substr($posl,1); ?>"
mmg=mg.split(",")
itek=0;
pz=document.all["ifrpp"].src
function mov(p)
{
if (p==1)  // 
{
document.all["ifrpp"].src=pz.replace("be=0","be="+mmg[0])
document.all["be"].innerHTML=1
itek=0;
}
else if (p==2)  //
{
itek=itek+1
if (itek>mmg.length-1)
{itek=0}
document.all["ifrpp"].src=pz.replace("be=0","be="+mmg[itek])
document.all["be"].innerHTML=itek+1
}
else if (p==3)  //
{
itek=itek-1
if (itek<0)
{itek=mmg.length-1}
document.all["ifrpp"].src=pz.replace("be=0","be="+mmg[itek])
document.all["be"].innerHTML=itek+1
}
else if (p==4)  //
{
document.all["ifrpp"].src=pz.replace("be=0","be="+mmg[mmg.length-1])
document.all["be"].innerHTML=mmg.length
itek=mmg.length-1;
}
}
function q1(t,p)
{
p.href=t+"?vis="+mg+"&scr=0"+"&td="+dp
p.click()
}
devdate=new Date();
var y="";
y=devdate.getFullYear()
var m="";
m=devdate.getMonth()+1
var c="";
c=devdate.getDate();
var d="";
d=devdate.getDay();
var dp=""
dp=y+"-"+m+"-"+c+"-"+d
dp1=y+"<br>"+m+"<br>"+c
window.onload=function ()
 {
 pz=document.all["ifrpp"].src
 pz=pz.replace("td=","td="+dp)
}
</script>
</html>
