$uri_param_query_post = isset($_GET["query_post"]) ? $_GET["query_post"] : null;
$colnames_post = isset($_POST["colname"]) ? $_POST["colname"] : null;
$tablenames_post = isset($_POST["tablename"]) ? $_POST["tablename"] : null;
$act = isset($_GET["act"]) ? $_GET["act"] : null;
if (!empty($act) && $act == "submit") {
    echo ";;;;;;;;;;;;;;;;;;;";
    print_r($colnames_post);
    print_r($tablenames_post);
    // put 'tbl1', 'row1', 'cf1:column1', 'v1'
    $cmd = "create '{$tablenames_post}', 'mysql'\n";
    foreach ($colnames_post as $col) {
        $cmd .= "put '{$tablenames_post}', 'row1', 'mysql:{$col}', ''";
    }
    //file_put_contents("tmp/create-table.txt", $cmd);
    //exec("hbase shell < tmp/create-table.txt");
    MMB::createTable($tablenames_post, "mysql");
    $cols = implode(",", $colnames_post);
    $sql = "INSERT INTO {$tablenames_post} ({$cols}) VALUES ({$cols})";
    mysql_query($sql);
}
?>
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>HBaseMyAdmin</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">

    <!-- Le styles -->