<?php
//include_once "template.php";
include_once("../../class/clsConnection.php");
include_once(
"../../class/clsDB.php");
include_once 
"../global.php";
include_once 
"../class/clsannounceDocType.php";
include_once 
"funct.php";
$oC = new clsConnection($GLOBALS['DBHOST'], $GLOBALS['DBNAME_EOFFICE'], $GLOBALS['DBUSER_EOFFICE'], $GLOBALS['DBPASS_EOFFICE']);

$oAn=new announceDocType($oC);
$oAn1=new announceDocType($oC);
$oAn2=new announceDocType($oC);


if(
$method=="addDocType"){
    
$oAn->AddNew();
    
$oAn->AnID=$oAn->GetNextCode();
    
$oAn->AnName=$newDocType;
    
$oAn->Save();
    echo 
"<meta http-equiv='refresh' content='0; URL=addAnnounceDoc.php'>";
}else if(
$method=="editDoctype"){
    
$oAn->SearchByKey($iddoc);
    
$oAn->GetRecord();
    
$oAn->Edit();
    
$oAn->AnID=$oAn->AnID;
    
$oAn->AnName=$editDoctype;
    
$oAn->Save();
    echo 
"<meta http-equiv='refresh' content='0; URL=addAnnounceDoc.php'>";
}else if(
$method=="del"){
    
$oAn->SearchByKey($iddoc);
    
$oAn->GetRecord();
    
$oAn->Delete();
    echo 
"<meta http-equiv='refresh' content='0; URL=addAnnounceDoc.php'>";
}

?>