<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);

session_start();
					if (file_exists ('../../sg_cm/root.php') && (time() - filemtime('../../sg_cm/root.php') > 86400)) {
					session_destroy();}
					
$fn="../../sg_cm/conf/conf/conf.php";
   $file=file($fn);
   if($file[2]!=session_id())
     {
     	echo "<meta http-equiv=refresh content='0; url=../../sg_cm/admin/index.php'>";
        exit();
     } 
touch('../../sg_cm/root.php');	 
if(isset($_GET['quit']))
 {

    $f=fopen($fn,"w");
    fwrite($f,$file[0].$file[1]."111");
    fclose($f);
     echo "<meta http-equiv=refresh content='0; url=http://$_SERVER[SERVER_NAME]'>";
     exit();

  }

 if(isset($_POST["zagl"]) && @$_POST["zagl"]!="" && $_POST["writezagl"]=="Записать" ) 
   {$ZAGL=$_POST["zagl"];
					if (get_magic_quotes_gpc()) {$ZAGL = stripslashes($ZAGL); }
$base = file_get_contents('../upload/gs_foto/db/zagl');
if ($base!==false && $base!=''){ 
$base = preg_replace('!zagl=\'[^\']*?\';!', 'zagl=\''.$ZAGL.'\';', $base);
file_put_contents('../upload/gs_foto/db/zagl',$base);
}
}
$fget="../upload/gs_foto/db/zagl";
if(is_file($fget))
{include($fget);}
else {$zagl="Новости"; file_put_contents("../upload/gs_foto/db/zagl","<?php \$zagl='Новости';
\$indx='news';?>");}
$Zagl=$zagl;$IndX='';?>
<!DOCTYPE html>
<html>
	<head>
	<meta charset="utf-8" />
	<title></title>
			<link rel="stylesheet" type="text/css" href="../../sg_cm/sg_cm/style/reset.css" media="screen,print" />
		<link rel="stylesheet" type="text/css" href="../../sg_cm/sg_cm/style/print.css" media="print" />
		<link rel="stylesheet" type="text/css" href="../../sg_cm/sg_cm/style/style.css" media="screen,print" />
		<link rel="stylesheet" type="text/css" href="../../sg_cm/sg_cm/style/template.css" media="screen" />
		<link rel="stylesheet" type="text/css" href="../../sg_cm/sg_cm/style/menu.css" media="screen" />
		<!--[if lte IE 7]><link rel="stylesheet" type="text/css" href="../../sg_cm/sg_cm/style/ie.css" media="screen" /><![endif]-->
		<link rel="stylesheet" type="text/css" href="../../sg_cm/sg_cm/style/cap2.css" media="screen" />
		<script type="text/javascript" src="../../sg_cm/sg_cm/res/jquery.js?57"></script>
		<script type="text/javascript" src="../../sg_cm/sg_cm/res/x5engine.js?57"></script>
		<link rel="stylesheet" type="text/css" href="../../sg_cm/css/jquery.lightbox-0.5.css" media="screen" /> 
<script type="text/javascript" src="../../sg_cm/js/jquery.lightbox-0.5_for_admin.min.js"></script>
<script type="text/javascript">
$(function() {
	$('.gallery a, .sg_gallery a, a.gallery, a.sg_gallery, a[rel*=sg_gallery]').lightBox(); // Select all links in object with sg_gallery class
});
</script>
	</head>
<body>

  <br/>
<script type='text/javascript'>

 function del(par,text)
{
answer=window.confirm('Вы хотите удалить '+text+'?');
if (answer)window.location.replace(par);

}

function win(par)
{

var obj=par;
 mainwin=window.open('rgb.html','',
'Width=550, height=500,left=100,top=100,status=yes,toolbar=no,menubar=no,scrollbars=yes,resizable=yes');

}
  
function doMenu2(item) { obj=document.getElementById(item); col=document.getElementById("x" + item); if (obj.style.display=="none") { obj.style.display="inline"; col.innerHTML=""; } else { obj.style.display="none"; col.innerHTML="";} }
function select_all(obj) 
{ var text_val=eval(obj); 
text_val.select(); }
;

</script>
<?php
$selectmy=array('','','','','','','','');
      $expl=explode("/",$_SERVER['PHP_SELF']);
      switch($expl[count($expl)-1])
             {
               case "admin.php":$selectmy[1]='selected'; $pagetitlemy='::&nbsp;Добавить фотоальбом&nbsp;::';
               break;
               case "admin1.php":$selectmy[3]='selected';$pagetitlemy='::&nbsp;Категории&nbsp;::';
               break;
               case "admin2.php":$selectmy[2]='selected';$pagetitlemy='::&nbsp;Все фотоальбомы&nbsp;::';
               break;
               case "red.php":$selectmy[4]='selected';if (isset($_GET['id']))
			   $pagetitlemy='::&nbsp;Редактирование фотоальбома&nbsp;<span style="color:black;"><b>'.$_GET['id'].'</b> </span>::';
		   else  $pagetitlemy='::&nbsp;Редактирование фотоальбома&nbsp;::';
               break;
             }


?>

  <p></p><p></p>
