<?
$sub_menu = "999800";
include_once("./_common.php");

auth_check($auth[$sub_menu], "r");

if ($is_admin != "super")
    alert("최고관리자만 접근 가능합니다.");

$g4[title] = "빌드몬 삭제";
include_once ("$g4[admin_path]/admin.head.php");

if($exec=="uninstall"&&$uninstall=="ok") {

$mysql_host  = $_POST[mysql_host];
$mysql_user  = $_POST[mysql_user];
$mysql_pass  = $_POST[mysql_pass];
$mysql_db    = $_POST[mysql_db];

$dblink = @mysql_connect($mysql_host, $mysql_user, $mysql_pass);
if (!$dblink) {
    echo "<meta http-equiv='content-type' content='text/html; charset=$g4[charset]'>";
    echo "<script language='JavaScript'>alert('MySQL Host, User, Password 를 확인해 주십시오.');history.back();</script>"; 
    exit;
}

@$result = sql_query("show table status from $mysql_db like '$d_table%' ");
while($data=sql_fetch_array($result)) {
@sql_query("drop table $data[Name]");
}

@rm_rf("../../data");
//@rm_rf("../extend");
@unlink("../../dbconfig.php");
@rename("../../install.bak", "../../install");


alert("빌드몬을 삭제 하였습니다.", "../../install/");
exit();
}

?>

<table border=0 cellspacing=0 cellpadding=10 width=100% height=100%>
<form name=uninstall method=post onsubmit="return confirm('빌드몬을 삭제 합니다. 계속하시겠습니까?')">
<input type=hidden name=exec value="uninstall">
<input type=hidden name=uninstall value="ok">
<tr>
<td valign=top>
<?=subtitle("빌드몬 삭제")?>
<table border=0>
<tr>
<td>
빌드몬을 삭제하실경우 설치 및 운영 중 발생한 모든자료가 망실되오니 백업 후 이용하시기바랍니다.<br>
<a href="http://www.buildmon.com/" targe="_blank">빌드몬 공식사이트 바로가기</a>
</td>
</tr>
</table>
<br>
<table border=1 cellspacing=3 cellpadding=5 bordercolor=cccccc>
<tr>
<td align=center width=100><b>호스트</td>
<td bgcolor=f3f3f3><input type=input name=mysql_host required value="localhost" class=input size=20></td>
</tr>
<tr>
<td align=center><b>아이디</td>
<td bgcolor=f3f3f3><input type=input name=mysql_user required value="" class=input size=20></td>
</tr>
<tr>
<td align=center><b>비밀번호</td>
<td bgcolor=f3f3f3><input type=input name=mysql_pass required value="" class=input size=20></td>
</tr>
<tr>
<td align=center><b>DB 이름</td>
<td bgcolor=f3f3f3><input type=input name=mysql_db required value="" class=input size=20></td>
</tr>
<tr>
<td align=center><b>접두사</td>
<td bgcolor=f3f3f3><input type=input name=d_table required value="<?=$g4[table_prefix]?>" class=input size=20></td>
</tr>
<tr>
<td colspan=2 align=center><input type=submit value="    확        인    "></td>
</tr>
</table>
</td>
</tr>
</form>
</table>
<?
include_once("$g4[admin_path]/admin.tail.php");
?>
