<?php header('Content-Type: text/html; charset=windows-1251'); ?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<title>Editing the directory file</title>
<style>
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}
</style>
</head>
<?php
if (file_exists(getcwd ( )."/otd/2.txt"))
{
echo '<body leftMargin=0 id=bod topMargin=0  style="overflow:hidden;background:silver;">';
echo '<table id=monoz  border=0 style="width:100%;height:100%;
z-index:3;position:absolute;top:0px;left:0px;">
<tr ><td width=30%>&nbsp;</td><td width=30%  valign=center align=center>
<table border=0 width=400 style="background:white" >
<tr><td><IMG height=60 border=0 src="d~e~f/pas.jpg"></td>
<td  height=30px ><center><b style="color:red" >ATTENTION !'.
'</b></center><br>
<ol>
<li> THE ADMINISTRATOR closed the site to carry out work on its reorganization!
<li> The site will be available after completion of work!
<li> For information, contact your ADMINISTRATOR!
<li> Close site
<li> Check back later!</ol>
</td></tr>
</table>
</td><td width=30%>&nbsp;</td></tr></table></body></html>';
die;
}
?>
<body background="d~e~f/bkg4.gif" style="overflow:hidden">
<table id=h style="z-index:2;opacity:0.3;visibility:hidden;height:100%;width:100%;position:absolute;top:0;left:0;background:black;filter:alpha(opacity=30)"><tr><td>&nbsp;&nbsp;&nbsp;</td><tr></table> 
<?php
include "f.php"; 
$os="1"; 
if (isset ($_REQUEST['im'])) 
{$im=trim($_REQUEST['im']);}
else
{$im=trim($_GET['im']);}

if (isset ($_REQUEST['tip'])) 
{$tip=trim($_REQUEST['tip']);}
else
{$tip=trim($_GET['tip']);}
$im=rtr($im);
if (isset ($_REQUEST['file'])) 
{$file=trim($_REQUEST['file']);}
else
{$file=trim($_GET['file']);}


/////////////////////////////////////////////////////////////////
if (isset ($_REQUEST['stru'])) 
/////////////////////////////////////////////////////////////////
{
$stt=explode("\r\n", trim($_REQUEST['stru'])); //
$filename=getcwd ( )."/".str_replace("../","",$file);
$h = fopen($filename, 'w+') or exit;	//
if ($tip=='object')
{foreach ($stt as $li => $lin)
{// 
 // 
 $mas=explode('/', $lin); // 
 $da=true;
 if (count($mas)==1) // 
  {if ($mas[0]=="")
   {$da=false;}  // 
   else
   {$lin=$lin.'/enter the name//';}
   }
 if (count($mas)<4 and count($mas)>1)
 {$lin=$lin.str_repeat('/',4-count($mas));}
  if ($da) 
  {
  fwrite($h,c($lin,1)."\r\n");
  }
 }}
 if ($tip=='tip' or $tip=='mail' or $tip=='http' or $tip=='fttp' )
 {foreach ($stt as $li => $lin)
{// 
 {if (trim($lin)=="")
  {}  // 
  else
  {fwrite($h,trim($lin)."\r\n");
  }
 }
 }
 }
 fclose($h); 					// 
$os=""; // 
} 
$repo=""; // 
?>
<b style=color:red>WEBSITE:</b> <b style=color:#316290 id=sname2>
<?php
include "plan/name.txt";
?>
</b>
<form id=form action="redspr.php" method="post" enctype="multipart/form-data" >
<table id=tab border=0 width=100% HEIGHT=100% ><tbody>
<tr><td align=center height=20 colspan=2 width=100%>

<?php
echo '<font size=5>Editing '.$im.'</font>';
echo '<b id=imf>, file&nbsp;&nbsp;';
echo $file;
echo '</b>';
?>
</td></td>
<tr>
<td valign=top width=100% height=100% id=cen>
<textarea  style="width:90%;height:90%"  name=stru id=stru  wrap=off>
<?php 
if ($tip=='object')  
{
$fi=getcwd ( )."/".str_replace("../","",$file);
$h = file($fi) or exit;	//
foreach ($h as $li => $lin)
{
echo c(trim($lin),0)."\r\n";
}
}
else
{
include $file;
} 
?>
</textarea>
</td>
<td valign=center style=width:300>
<center style="background:silver"><b>Manual</b></center>
<DIV style="OVERFLOW: scroll; HEIGHT: 80%;background:#fffacd;width:300" align=left id=stru2>
<?php
if ($tip=='object')
{echo '
<center>
<a  href="help/4.htm#48" target=_blank>&nbsp;Help&nbsp;</a>
</center>

<li> <b> 1 line - heading, in the format: <br> Brief / Name / Password / Pages </b>,
<li> <b> 2nd line - admin line!
<br> <font color = red> Don`t delete these lines !!! </font> </b>
<li> To enter a new subject, insert a blank line anywhere from line 2.
<li> In the inserted line, enter the text: <br> <b> [short name of the subject] / [full name of the subject] // </b> <br>
<li> To change "Brief" or "Name" in the desired line, edit.
<li> Columns: "Password", "Pages" are not edited and are filled in automatically when forming access rights. ';}

if ($tip=='tip')
{echo '
<center>
<a  href="help/4.htm#49" target=_blank>&nbsp;Help&nbsp;</a>

<br></center>
<li> The first line is a comment do not delete it
<li> Remove or add file extensions.
<li> Each extension must be on a separate line and start with a character . .';
}

if ($tip=='http')
{echo '
<center>
<a  href="help/4.htm#412" target=_blank>&nbsp;Help&nbsp;</a>
<br></center>
<li> To enter a new address, insert a blank line anywhere
<li> In the inserted line, enter the following text: [site name] = [http address]
<b> eg: <br> search server = http: //ru.yahoo.com/ </b>';
}
if ($tip=='mail')
{echo '
<center>
<a  href="help/4.htm#411" target=_blank>&nbsp;Help&nbsp;</a>

<br></center>
<li> To enter a new address, insert a blank line anywhere
<li> In the inserted line, enter the following text: [link text] = [mail address] <br>
<b> for example: WEB master=globuss@jnline.ru </b>';
}
if ($tip=='fttp')
{echo '<center>
<a  href="help/4.htm#413" target=_blank>&nbsp;Help&nbsp;</a>

<br></center>
<li> To enter a new address, insert a blank line anywhere
<li> In the inserted line, enter the following text: [link text] = [fttp address] <br>
<b> for example: files of my site = fttp: //webcenter.ru/ </b>';
}
echo '<li> Change or remove the required lines.
<li> To sort strings: copy them into any program (eg Excel), sort them, and paste them into the field through the system buffer.
<li> Click Save to apply your changes.';

if ($tip=='http' or $tip=='mail' or $tip=='fttp')
{
echo '<hr><b><li>Attention !
<br>&nbsp;&nbsp;&nbsp;The form does not control the correctness of the address input and the presence of this address on the network!
<br>&nbsp;&nbsp;&nbsp;Deleting and/or changing the reference line does not lead to the deletion and/or change of the corresponding link on the page.';
}

echo '<li>The reference book can be maintained by any text editor. ';
?>
</div>
<center><input type="submit" value="Save" 
title="click me after you finish editing the file to save the changes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<button form="" style=width:30 onclick=ptab()>P</button>
</center>
<?php
if ($os=="")
{
echo '<center><b style="color:green;">Changes are saved !</b></center>';
}
?>
</td>
</tr></tbody></table>
<input type=hidden name="im" value="<?php echo $im; ?>">
<input type=hidden name="file" value="<?php echo $file; ?>">
<input type=hidden name="tip" value="<?php echo $tip; ?>">
</form>

<SCRIPT type="text/javascript">
window.onload=function ()
{obj9= document.getElementById("stru")
obj9.style.height=document.getElementById("h").offsetHeight-100
obj9.style.width=document.getElementById("h").offsetWidth-320
obj9= document.getElementById("stru2")
obj9.style.height=document.getElementById("h").offsetHeight-200
}

//********************************************************************
function ptab() // 
//********************************************************************
{newstr2="<b>Website: </b>"+document.getElementById("sname2").innerHTML
if (document.getElementById("imf").innerHTML.indexOf("otd.txt")>0)
{newstr2=newstr2+"<h2 style='text-align:center'>SUBJECTS</h2>"
w=document.getElementById("stru").value.replace(/\r/g,"")
mw=w.split("\n")
w2="<table border=1>"
for(var j = 0; j <mw.length ; j++)
{if (j==0)
{w2=w2+"<tr><th>"+mw[j].replace(/\//g,"</th><th>")+"</th></tr>"
}
else
{w2=w2+"<tr><td>"+mw[j].replace(/\//g,"</td><td>")+"</td></tr>"
}}
w2=w2+"</table>"
}
else
{
w2=document.getElementById("stru").value.replace(/\r/g,"")
w2="<hr><b>Content <?php echo $im;?>:</b><br>"+w2.replace(/\n/g,"<br>")
}
newstr2=newstr2+w2
dop=window.open("","","");
tnap="<HTML><HEAD><META http-equiv=Content-Type content='text/html; charset=windows-1251'></head>"
tnap=tnap+newstr2+"</html>"
dop.document.write(tnap)
}





</script>

 </body>
</html>