예제 #1
0
<?php

require_once "config.php";
require_once "model/connection.php";
require_once "model/databases.php";
require_once "model/tables.php";
require_once "model/stats.php";
require_once "model/addtable.php";
require_once "model/adddata.php";
require_once "model/addcolone.php";
require_once "fonctions.php";
$connection = getConnection($host, $user, $pwd);
$databases = getDatabases($connection);
include "vue/shared/header.php";
include "vue/menu.php";
include "vue/breadcrumb.php";
if (isset($_GET["action"])) {
    $action = $_GET["action"];
    if ($action == "new-bdd") {
        include "vue/form.php";
    } else {
        if ($action == "db-options") {
            if (isset($_GET["db-name"])) {
                $dbname = $_GET["db-name"];
                include "vue/options.php";
            }
        } else {
            if ($action == "add-db") {
                include "vue/createdbconfirm.php";
            } else {
                if ($action == "tablecontents") {
     echo "Deleting CVS Database..." . PHP_EOL;
     $email = getEMail();
     $password = getPassword();
     $dbName = getDbName();
     $response = deleteDatabase($email, $password, $dbName);
     if (isOK($response)) {
         printResult($response, "DELETING CVS DB FAILED", " Database {$dbName} has been deleted." . PHP_EOL . " ---- DELETING CVS DB SUCCESSFULLY COMPLETED ----");
     } else {
         echo $response->getMessage();
     }
     break;
 case "getDatabases":
     echo "Getting CVS Databases..." . PHP_EOL;
     $email = getEMail();
     $password = getPassword();
     $response = getDatabases($email, $password);
     if (isOK($response)) {
         printDatabasesResult($response, "GETTING CVS DBs FAILED", " ---- GETTING CVS DBs SUCCESSFULLY COMPLETED ----");
     } else {
         echo $response->getMessage();
     }
     break;
 case "addApplication":
     echo "Connecting Application to CVS Database..." . PHP_EOL;
     $email = getEMail();
     $password = getPassword();
     $dbName = getDbName();
     $appId = getAppId();
     if (is_numeric($appId)) {
         $response = addChannel($email, $password, $dbName, $appId);
     } else {