<?php require $_SERVER["DOCUMENT_ROOT"] . '/vendor/autoload.php'; use SMS\App\Modules\Setup\Controller\SetupController as Setup; session_start(); if (isset($_GET)) { $setup = new Setup(); foreach ($_SESSION as $key => $value) { foreach ($value as $valu) { $setup->createRelationship($valu, $key, $key, $key); } } }
<?php require $_SERVER["DOCUMENT_ROOT"] . '/vendor/autoload.php'; use SMS\App\Modules\Setup\Controller\SetupController as Setup; // $controller = new SetupController(); // $controller->createTable("Students Of Chs", "Student's table"); // $controller->createField("Students of chs", "First Name", "varchar(10)", "Student's First Name"); // $controller->createField("Students of chs", "Last Name", "varchar(10)", "Student's Last Name"); // $controller->createField("Students of chs", "Middle Name", "varchar(10)", "Student's Middle Name"); // $controller->createField("Students of chs", "Date Of Birth", "datetime", "Student's Date Of Birth"); // $controller->createTable("Parent", "Parent Table"); $setup = new Setup(); //echo $setup->deleteDatabase(); print_r($setup->getTableFields("Staffs"));
<?php require $_SERVER["DOCUMENT_ROOT"] . '/vendor/autoload.php'; use SMS\App\Modules\Setup\Controller\SetupController as Setup; SESSION_START(); if (isset($_POST)) { $table = $_POST["table"]; $name = $_POST["name"]; $type = $_POST["type"]; $setup = new Setup(); try { switch ($type) { case "text": $type = "varchar(50)"; case "name": $type = "varchar(20)"; case "number": $type = "Integer"; case "date": $type = "date"; default: $type = "varchar(30)"; } if ($_POST["id"] != "nil") { $setup->createField($table, $name, $type, ""); } else { $setup->createTable($name, ""); $setup->createField($name, $name, $type, ""); // $setup->createField($table, $name."Id", "INTEGER", ""); // $setup->createRelationship($table, $name, $name."Id", $name); $_SESSION[$name][] = $table;
<?php require $_SERVER["DOCUMENT_ROOT"] . '/vendor/autoload.php'; use SMS\App\Modules\Setup\Controller\SetupController as Setup; if (isset($_GET)) { $setup = new Setup(); echo json_encode($setup->deleteDatabase()); }
<?php require $_SERVER["DOCUMENT_ROOT"] . '/vendor/autoload.php'; use SMS\App\Modules\Setup\Controller\SetupController as Setup; if (isset($_GET)) { $table = $_GET["table"]; $setup = new Setup(); echo json_encode($setup->getTableFields($table)); }