<?php
header('Content-Type: text/html; charset=windows-1251'); 
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<head>
<style>
<?php  include "plan/css.htm";  //  ?>
a {color:#254A6C;font-family:tahoma;font-size:12px;font-weight:normal;}
.redlink {color:#B92327;font-family:tahoma;font-size:11px;font-weight:normal;}
.bluelink {color:#254A6C;font-family:tahoma;font-size:11px;font-weight:normal;}
a:hover {color:white;font-family:tahoma;font-size:12px;font-weight:normal;background:black}
h2,p,font,blockquote,pre,marquee,table {CURSOR: default}
</style>
</head>
<title>111</title>
<body id=bodd width=100% height=100% style2="overflow:auto"  leftMargin=0 id=bod topMargin=0 >
<script type="text/javascript">
//var myyy = new Array()   // 
//var ist = new Array()    // 
</script>
<!--- filter keepers  --->
<b id=sfil style=display:none></b>
<b id=goto style=display:none></b>

<?php
include "f.php";   //  
// 
$_frhtm=getcwd ( ).'/sampl/tt.htm';
echo '<div id=tt style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:silver">';
include $_frhtm;
echo '</div>';
// 
//******************************************************************************************************************
 $_frhtm=getcwd ( ).'/sampl/gj.htm';
echo '<div id=gj style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';
// 
 $_frhtm=getcwd ( ).'/sampl/ti.htm';
echo '<div id=ti style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';

// 
 $_frhtm=getcwd ( ).'/sampl/tb.htm';		      //
echo '<div id=tb style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';

//  
 $_frhtm=getcwd ( ).'/sampl/tv.htm';		      // 
echo '<div id=tv style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';


//  
 $_frhtm=getcwd ( ).'/sampl/tg.htm';		      // 
echo '<div id=tg style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';

// 
 $_frhtm=getcwd ( ).'/sampl/tc.htm';		      // 
echo '<div id=tc style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';

 
//
$_frhtm=getcwd ( ).'/sampl/tl.php';		      // 
echo '<div id=tl style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
//include $_frhtm;
echo '</div>';
 
// 
$_frhtm=getcwd ( ).'/md.php';		      // 
echo '<div id=md style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';

// 
$_frhtm=getcwd ( ).'/sampl/tq.htm';		      // 
echo '<div id=tq style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
include $_frhtm;
echo '</div>';

//  
//**************************************************************************************************************
if (isset ($_REQUEST['site']))
{$site=$_REQUEST['site'];}
else
{$site=$_GET['site'];} 
$nam1=str_replace(".htm","",$site);
if ($nam1=="a-p-x-" or $nam1=="tmp" )
{echo '<div id=apx style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
echo  '<b style="color:blue">The archive or template itself does not have an archive and/or template.</b>';
echo '</div>';
}
else
{if (strpos($nam1,"/contents/")>0)
{$mnam1=explode("/contents/",$nam1);
$_frhtm1=getcwd ( ).'/pages/'.$mnam1[0].'/contents/01,01,01_apx/01,01,01_apx/apx-.htm';
}
else
{$_frhtm1=getcwd ( ).'/pages/'.$nam1.'/contents/01,01,01_apx/01,01,01_apx/apx.htm';
}
if (file_exists($_frhtm1))
{
echo '<div id=apx style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
$l = file($_frhtm1); 					 //
foreach ($l as $li => $val)    
{echo $val."<hr>";}
echo '</div>';
}
else
{echo '<div id=apx style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
echo '<b style="color:red">No ARCHIVE CREATED for this page! Close the form, click "Page Name" and the "Archive" button. </b>';
echo '</div>';
}}

// 
//********************************************************************************************************************
if ($nam1=="a-p-x-" or $nam1=="tmp" )
{
echo '<div id=tmp style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
echo  '<b style="color:blue">The archive or template itself does not have an archive and/or template.</b>';
echo '</div>';
}
else
{if (strpos($nam1,"/contents/")>0)
{$mnam1=explode("/contents/",$nam1);
$_frhtm1=getcwd ( ).'/pages/'.$mnam1[0].'/contents/01,01,01_tmp/01,01,01_tmp/tmp.htm';  //
}
else
{$_frhtm1=getcwd ( ).'/pages/'.$nam1.'/contents/01,01,01_tmp/01,01,01_tmp/tmp.htm';   //
}
if (file_exists($_frhtm1))
{echo '<div id=tmp style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
//include $_frhtm1;
$l = file($_frhtm1); 					 // 
foreach ($l as $li => $val)    
{echo $val."<hr>";}



echo '</div>';
}
else
{
echo '<div id=tmp style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
echo '<b style="color:red">For this page MY TEMPLATES ARE NOT CREATED! Close the form, click "Page Name" and the "Templates" button. </b>';
echo '</div>';
 }}

//  
echo '<div id=tLink style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
echo '<h3 style="background:brown;color:yellow">List of links:</h3>
<TABLE id=s title=0 border=0 width="100%">
<TBODY>
<TR>
<TD style="BACKGROUND: #dcdcdc" colSpan=2 align=middle>
<FONT size=4>Table of contents</FONT></TD></TR>
<TR>
<TD width="50%">
<LI style="LIST-STYLE-TYPE: circle; MARGIN-LEFT: 6mm">
<A href="#001">Table of links to uploaded site documents.</A>
<LI style="LIST-STYLE-TYPE: circle; MARGIN-LEFT: 6mm">
<A href="#002">Links to site pages</A>
<LI style="LIST-STYLE-TYPE: circle; MARGIN-LEFT: 6mm">
<A href="#003">Links to documents belonging only to the edited page</A>
<LI style="LIST-STYLE-TYPE: circle; MARGIN-LEFT: 6mm">
<A href="#004">Links to files and pages created by other editors</A></LI></TD>
<TD width="50%">
<LI style="LIST-STYLE-TYPE: circle; MARGIN-LEFT: 6mm">
<A href="#005">Email</A>
<LI style="LIST-STYLE-TYPE: circle; MARGIN-LEFT: 6mm">
<A href="#006">Links to external sites</A>
<LI style="LIST-STYLE-TYPE: circle; MARGIN-LEFT: 6mm">
<A href="#007">Links to external files</A>
</LI>
</TD></TR></TBODY></TABLE>
<center style="color:brown">All lists are sorted alphabetically</center>
<A name=001></A><center><b style="background:brown;color:white;width:100%">1 table of links to uploaded documents page</b></center>
<b id=s title="1" time="0" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is the location of the docs link table of the links.htm page<br></b>
<br>
<A name=001></A><center><b style="background:brown;color:white;width:100%">1-1 table of links to external pages of the site</b></center>
<b id=s title="1" time="0" >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This is the place of the table of links to external pages linkshtml.htm<br></b>
<br>
<A name=002></A><center><b style="background:brown;color:white;width:100%">2 - links to site pages</b>
</center><br>';

$ii=2;
$l = scandir(getcwd ( ).'/pages/',1);    //


function cmp($a, $b) 
{$a2=rtr($a);$b2=rtr($b);
if ($a2 == $b2) { return 0;}
return ($a2 < $b2) ? -1 : 1;}
usort($l, "cmp");


foreach ($l as $value)		             //
{if ($value != "." and $value != "..")  
 {if  (strpos($value,'.php')>0)          //
  {$val=$value;
 $vvv=str_replace('.php','',$val);
 $vvv=str_replace('.htm','',$vvv);
echo "<b style=color:brown>".$ii."</b>".
'<div id=s time="0" title="'.$ii++.'">&nbsp;&nbsp;&nbsp;
<u id=lin  lang=$    title="" class=menul href="#"  click="q1('."'".$val."',this)".'">
'.rtr($vvv).'</u></div>';   
     if ($ii==1000)
	 {break;}		 
	 }}}


//***************************************************************************
echo '<br><A name=003></A><center><b style="background:brown;color:white;width:100%">3 - links to documents belonging only to the edited page</b></center>';
if  (strpos($fol,"contents")>0) //
{
$ppoz=strpos($fol,'contents/');
$kati=getcwd ( ).'/pages/'.trim(substr($site,0,$ppoz+9));  //
}
else
{
$kati= getcwd ( ). '/pages/'.$fol.'/contents/';	//
}
function cmp2($a, $b) 
{list($dd,$nn)=explode('_',$a); 
list($dd2,$nn2)=explode('_',$b); 
list($d,$m,$y)=explode(',',$dd); 
list($d2,$m2,$y2)=explode(',',$dd2); 
$nn=str_repeat("0",  (10-strlen($nn))).$nn;
$nn2=str_repeat("0",  (10-strlen($nn2))).$nn2;
$k=$y.$m.$d.$nn;
$k2=$y2.$m2.$d2.$nn2;
if ($k2 == $k) { return 0;}
return ($k < $k2) ? -1 : 1;}
// 
$fex = file_get_contents ('otd/new.txt').".php";  		//
if (file_exists ($kati)) 	   	// 
{$files2 = scandir($kati, 1);	//
foreach ($files2 as $value) 		//
{if ($value != "." and $value != "..")  
{$files22[]=$value;}
}
usort($files22, "cmp2");
$i=1;
foreach ($files22 as $value) 		//
{if ($value != "." && $value != "..")  
 {if  (!strstr($value, '.'))   				//
  {
  if ($utf8) //
   {$val = iconv("utf-8","Windows-1251",$value); } else {$val=$value;} //
  if (substr($val,2,1)=="," and substr($val,5,1)==",")  	//
    {$d=substr($val,0,8); 			//
     $n=substr($val,9,12); 			//
     $ipp=$kati.$value;             //
     $filesp = scandir($ipp, 1);	//
     foreach ($filesp as $va) 		//
  { if ($va != "." && $va != "..")  
     {if ($utf8) // 
      {$v = iconv("utf-8","Windows-1251",$va); } else {$v =$va;} //
	  $t=substr($v,0);
    if  (strpos($t,".")>0  and strpos(" ".$t,"-card-file.php")==0 and   strpos(" ".$t,"p.txt")==0 and strpos(" ".$t,"tables.php")==0
 	and strpos(" ".$t,"1.txt")==0  and strpos(" ".$t,"do.txt")==0)
    // 
	 { 
     list($na,$ex)=explode('.',$t);  //
	 
	 if  (strpos($fex,$ex)>0) //
	 {

if ($na=="help")
{$na2="help";}
else
{$na2=rtr($na);}	 
	 
if  (strpos($fol,"contents")>0) // 
{list($nnn)=explode('/',$fol);  // 
 echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp;
 <u id=lin  lang=$   class=menul target=_blank title="" href="'.$nnn.'/contents/'.$d.'_'.$n.'/'.$t.
 '" >'.$d.' '.rtr($n).'/'.$na2.'.'.$ex.'</u></div>';
}
else
{echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp;
 <u id=lin  lang=$   class=menul target=_blank title="" href="'.$fol.'/contents/'.$d.'_'.$n.'/'.$t.
 '" >'.$d.' '.rtr($n).'/'.$na2.'.'.$ex.'</u></div>';
}
 }}
 }}
	 }
     }
     }
}
}

//*************************************************************************** !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
echo '<br><A name=004></A><center><b style="background:brown;color:white;width:100%">4 - links to files and pages created by other editors.</b></center>';
echo '<i style=color:brown>Loading, deleting, changing files (php, htm, html, txt, doc, rtf, xls) and folders in the outside folder is carried out by editors like frontpage or using other programs.</i><br>';

$kati= getcwd ( ). '/outside/';	// 
$fex = ".php,.htm,.html,.txt,.doc,.rtf,.xls";  		// 
if (file_exists ($kati)) 	   	//
{$files2 = scandir($kati, 1);	//
//sort($files2);
usort($files2, "cmp");

echo "<br>";
$i=1;
foreach ($files2 as $value) 		//
{
if ($value != "." && $value != "..")  
 {if  (!strstr($value, '.'))   				//
  {if ($utf8) // 
   {$val = iconv("utf-8","Windows-1251",$value); } else {$val=$value;} //
     $ipp=$kati.$value;   //
     $filesp = scandir($ipp, 1);	//
     foreach ($filesp as $va) 		//
    {if ($va != "." && $va != "..")  // 
     {if ($utf8) //
      {$v = iconv("utf-8","Windows-1251",$va); } else {$v =$va;} //
	  $t=substr($v,0);
      if  (strpos($t,".")>0) //
	  {list($na,$ex)=explode('.',$t);  //
	  if  (strpos($fex,$ex)>0) //
	   {
echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp; <u id=lin  lang=$   class=menul target=_blank title="" 
	 href="'.'../outside/'.$value."/".$t. '" >'.$value."/".$t.'</u></div>';
 }}
 else  //
   { 
   $ipp2=$kati.$value."/".$va."/";   // 
  $filesp2 = scandir($ipp2, 1);	//
  echo "<br>";
     foreach ($filesp2 as $va2) 		//
    {
	if ($va2 != "." && $va2 != "..")  // 
     {if ($utf8) // 
      {$v2 = iconv("utf-8","Windows-1251",$va2); } else {$v2 =$va2;} // 
	  $t2=substr($v2,0);
      if  (strpos($t2,".")>0) // 
	  {list($na1,$ex2)=explode('.',$t2);  //
	  if  (strpos($fex,$ex2)>0) //
	   {
	 echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp; <u id=lin  lang=$   class=menul target=_blank title="" 
	 href="'.'../outside/'.$value."/".$va."/".$t2. '" >'.$value."/".$va."/".$t2.'</u></div>';
 }}
 else  // 
  {
   $ipp3=$kati.$value."/".$va."/".$va2."/" ;   //
  $filesp3 = scandir($ipp3, 1);	//
  echo "<br>";
     foreach ($filesp3 as $va3) 		//
    {
	if ($va3 != "." && $va3 != "..")  // 
     {if ($utf8) //
      {$v3 = iconv("utf-8","Windows-1251",$va3); } else {$v3 =$va3;} //
	  $t3=substr($v3,0);
	  
      if  (strpos($t3,".")>0) //
	  {list($na1,$ex3)=explode('.',$t3);  //
	  if  (strpos($fex,$ex3)>0) // 
	   {
	echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp; <u id=lin  lang=$   class=menul target=_blank title="" 
	 href="'.'../outside/'.$value."/".$va."/".$va2."/".$t3. '" >'.$value."/".$va."/".$va2."/".$t3.'</u></div>';

 }}}
 else  // 
  {
  }
 }}}}}}}
 }
 else  // 
 {
 if ($utf8) // 
      {$v_ = iconv("utf-8","Windows-1251",$value); } else {$v_ =$value;} //
	  $t_=substr($v_,0);
echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp;
 <u id=lin  lang=$   target=_blank class=menul title="" href="'.'../outside/'.$t_.
 '" >'.$t_.'</u></div>';
 }}}}


 //*************************************************************************************************************************
echo '<br><A name=005></A><center><b style="background:brown;color:white;width:100%">5 - email.</b></center>
<i style=color:brown>To add a new address, click DIRECTORIES -> e-ail, enter a new address, click "save".</i><br>';
//**************************************************************************************************************************
$l = file(getcwd ( ). '/menu/mail.txt'); //
//sort($l);
usort($l, "cmp");
// 
foreach ($l as $li => $lin)
{
 if (substr($lin,0,1)!='*')  //
 {
  if (strpos($lin,"=")>0)
  {
$stt=explode("=", $lin); // 
echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp;
<u id=lin  lang=$   class=menul title="" href="mailto:'.$stt[1].'" >'.$stt[0].'</u></div>';
}}}

//*************************************************************************************************************************
echo '<br><A name=006></A><center><b style="background:brown;color:white;width:100%">6 - links to external sites.</b></center>
<i style=color:brown>To add a new address, click REFERENCES -> websites, enter a new site, click "save".</i><br> ';
//*************************************************************************************************************************
$l = file(getcwd ( ). '/menu/http.txt');
//sort($l);
usort($l, "cmp");
// 
foreach ($l as $li => $lin)
{
 if (substr($lin,0,1)!='*')  //
 {  if (strpos($lin,"=")>0)
 {$stt=explode("=", $lin); //
echo "<b style=color:brown>".$ii."</b>".'<div time="0" id=s title="'.$ii++.'">&nbsp;&nbsp;&nbsp;
<u id=lin  lang=$   class=menul target=_blank title="" href="'.$stt[1].'" >'.$stt[0].'</u></div>';
}}}
//*************************************************************************************************************************
echo '<br><A name=007></A><center><b style="background:brown;color:white;width:100%">7 - links to external files.</b></center>
<i style=color:brown>To add a new resource address, click DIRECTORIES -> files, enter a new resource, click "save".</i><br> ';
//*************************************************************************************************************************
$l = file(getcwd ( ). '/menu/fttp.txt');
//sort($l);
usort($l, "cmp");
// 
foreach ($l as $li => $lin)
{if (substr($lin,0,1)!='*')  //
 {if (strpos($lin,"=")>0)
{$stt=explode("=", $lin); //
echo "<b style=color:brown>".$ii."</b>".'<div id=s time="0" title="'.$ii++.'">&nbsp;&nbsp;&nbsp;
<u id=lin  lang=$   class=menul title="" href="'.$stt[1].'" >'.$stt[0].'</u></div>';
}}}

echo "<br><br><br></div>";

echo '<div id=slink style="display:none;OVERFLOW: scroll; HEIGHT: 50%;width:560;background:#fff8dc">';
echo  '<ol><b>There are no related links! To download links:</b>
<li> Place a link to the page you want to link to,
  to do this, click the "Links" button, click the link, place the link in a suitable place with the "+" button or the "->" button.
<li> Click the inserted link number.
<li> Click the "L" button.
<li> Click the "LL" button.
<li> Click "ALL" to insert all links or a single link.
<li> Click the "V" button.
<li> Insert the link in the desired place using the "+" or "->" button.
</ol>';
echo '</div>';

echo '<iframe id=sit border=1 src=zsite2.php?'.$_SERVER[QUERY_STRING].' height=100%  width=100% scrolling=no></iframe>';
?>
</body></html>
