<?
$sub_menu = "350500";
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>
최신의 빌더는 오누리 사이트에 배포합니다.<br><br>
<a href="http://onuri.co.kr/bbs/board.php?bo_table=05_10" target="_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 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");
?>