<?if(!check_bitrix_sessid()) return;?>
<?
$errors = false;

UnRegisterModule("directoriya.modulcreator");
DeleteDirFiles($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/directoriya.modulcreator/install/admin/", $_SERVER["DOCUMENT_ROOT"]."/bitrix/admin/");
\Bitrix\Main\IO\Directory::deleteDirectory($_SERVER["DOCUMENT_ROOT"]."/bitrix/images/directoriya.modulcreator");
\Bitrix\Main\IO\Directory::deleteDirectory($_SERVER["DOCUMENT_ROOT"]."/bitrix/panel/directoriya.modulcreator");
$errors = $DB->RunSQLBatch($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/directoriya.modulcreator/install/db/mysql/uninstall_b_directoriya_modulcreator.sql");
if ($errors === false){
	echo CAdminMessage::ShowNote(GetMessage("MOD_UNINST_OK"));
}else{
	for($i=0; $i<count($errors); $i++){
		$alErrors .= $errors[$i]."<br>";
	}
	echo CAdminMessage::ShowMessage(Array("TYPE"=>"ERROR", "MESSAGE" =>GetMessage("MOD_UNINST_ERR"), "DETAILS"=>$alErrors, "HTML"=>true));
}
?>
<form action="<?echo $APPLICATION->GetCurPage()?>">
<p>
	<input type="hidden" name="lang" value="<?echo LANG?>" />
	<input type="submit" name="" value="<?echo GetMessage("MOD_BACK");?>" />
</p>
</form>