<?php
include($_SERVER['DOCUMENT_ROOT'] .'/script/HeaderInc.php');
if(true === isset($_GET['UrlId']) && true === is_numeric($_GET['UrlId'])){
  $ObjSvtMod = new SvtMod($MS_SP);
  $ArrSvt = $ObjSvtMod->GetFromDb('SqlAll', 'GetRow', "a.svt_id = '". $_GET['UrlId'] ."'");
  $smarty->assign('ArrSvt', $ArrSvt);

  $ObjUsersMod = new UsersMod($MS_SP);
  $ArrUsers = $ObjUsersMod->GetFromDb('SqlAll', 'GetAll', "u.users_status = 1 AND u.structureorganization_id = '". $ArrSvt['structureorganization_id'] ."'", 'u.users_fio');
  $smarty->assign('ArrUsers', $ArrUsers);

  $VarPagesTxt .= $smarty->fetch('Demands/DemandsId.tpl');
}
else{
  $smarty->assign('VarError', $MS_SP->Sp_LangMessage['error']['ErrSettingWrong']);
  $VarPagesTxt = $smarty->fetch('error.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');
?>