<?php
include($_SERVER['DOCUMENT_ROOT'] .'/script/HeaderInc.php');

if ((true === isset($_SESSION['SessionAuth']['SvtAdmin']['reg']) && 1 == $_SESSION['SessionAuth']['SvtAdmin']['reg']) ||
    (true === isset($_SESSION['SessionAuth']['SvtOperatorAdv']['reg']) && 1 == $_SESSION['SessionAuth']['SvtOperatorAdv']['reg']) ||
    (true === isset($_SESSION['SessionAuth']['SvtOperator']['reg']) && 1 == $_SESSION['SessionAuth']['SvtOperator']['reg'])
   ){
  if(true === isset($_GET['po_id']) && true === is_numeric($_GET['po_id'])){
    $ObjPoMod = new PoMod($MS_SP);
    $ArrPo = $ObjPoMod->GetFromDb('SqlAll', 'GetRow', "a.po_id = '". $_GET['po_id'] ."'");
    $smarty->assign('ArrPo', $ArrPo);
    //SiteLibs::GetVarDump($ArrSvt);

    $VarPagesTxt .= $smarty->fetch('Po/PoInformation.tpl');
  }
  else{
    $smarty->assign('VarError', $MS_SP->Sp_LangMessage['error']['ErrSettingWrong']);
    $VarPagesTxt .= $smarty->fetch('error.tpl');
  }

//if(true === is_file($MS_SP->SP_CurrFileNameText)){
//  $VarPagesTxt .= $smarty->fetch($MS_SP->SP_CurrFileNameText);
//}
}
else{
  $smarty->assign('VarError', $MS_SP->Sp_LangMessage['error']['ErrAuthAccessDenied']);
  $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');
?>