<?php
include($_SERVER['DOCUMENT_ROOT'] .'/script/HeaderInc.php');
$VarPagesTxt = '';
if ((true === isset($_SESSION['SessionAuth']['SvtAdmin']['reg']) && 1 == $_SESSION['SessionAuth']['SvtAdmin']['reg']) ||
    (true === isset($_SESSION['SessionAuth']['SvtOperatorAdv']['reg']) && 1 == $_SESSION['SessionAuth']['SvtOperatorAdv']['reg'])
   ){
//  $ObjIstinfMod = new IstinfMod($MS_SP);
//  $ArrLastIstInf = $ObjIstinfMod->GetFromDb('SqlAll', 'GetRow', "a.NII LIKE ('". $MS_SP->Sp_LangMessage['script']['ScrIuTnpa'] ."%')", 'a.DATII DESC');
//  $VarKeyword = md5($ObjCheckLicenseMod->GetKeywordCrypt(). $ArrLastIstInf['nii']);
//  echo "VarKeyword: ". $VarKeyword ."<br />";
//  $ObjUpdateMod = UpdateMod::getUpdater("Sys");
//  phpinfo();

//  $ObjUpdateMod = UpdateMod::getUpdater("Sys");
//  
//  $ObjUpdateMod->update(new SystemMod($MS_SP));
//
  $smarty->assign('VarMenuMain', $VarMenu);
  $smarty->assign('VarMenuMain2', $VarMenu2);
  $smarty->assign('VarMenuModule', $VarMenuModule);
  
  $ObjSystemMod = new SystemMod($MS_SP);
  $ArrSystem = $ObjSystemMod->GetFromDb('SqlAll', 'GetAssoc');
  $smarty->assign('ArrSystem', $ArrSystem);
  $VarPagesTxt .= $smarty->fetch('Restore/Form.tpl');
}
else{
  $smarty->assign('VarError', $MS_SP->Sp_LangMessage['error']['ErrNoAuth']);
  $VarPagesTxt .= $smarty->fetch('AccessDenied.tpl');
}

$smarty->assign('VarPagesTxt', @$VarPagesTxt);
if (true === isset($MS_SP->SP_CurrPage['template_file']) && '' != $MS_SP->SP_CurrPage['template_file']){
	$smarty->display($MS_SP->SP_CurrPage['template_file']);
}
else {
	$smarty->display('Page.tpl');
}
include($_SERVER['DOCUMENT_ROOT'] .'/script/FooterInc.php');
?>