<?php

//설치 및 환경설정 저장.
include_once './_common.php';
include_once './index.php';
if (!$_POST) {
    exit;
}
$serialize = serialize($_POST);
$sql = "insert into ask_plugin_config set pc_id = '{$pc_id}',pc_name = '{$pc_name}',pc_use = '{$pc_use}',  pc_config = '{$serialize}' on duplicate key update pc_name = '{$pc_name}',pc_use = '{$pc_use}', pc_config = '{$serialize}'";
sql_query($sql);
if ($refresh) {
    //부모창 없을때 무한실행 방지 작업 추가하기
    echo "<script>if(typeof(parent) !='undefined'){parent.document.location.reload()}window.close();</script>";
    exit;
} else {
    goto_url(G5_PLUGIN_URL . '/asktheme/plugin/' . $plugin['id'] . '/setup.php?w=u');
    exit;
}