diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..e6437db --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.8' +services: + RadioMasterWeb: + image: radiomasterphp + build: ./web + volumes: + - ./web:/var/www/html/ + ports: + - 8000:80 + +# RadioMasterDb: +# \ No newline at end of file diff --git a/web/.htaccess b/web/.htaccess new file mode 100644 index 0000000..f2b5913 --- /dev/null +++ b/web/.htaccess @@ -0,0 +1,4 @@ +RewriteEngine on +RewriteBase / +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule ^(.*)$ /index.php [L,QSA] \ No newline at end of file diff --git a/web/CONTROLERS/dashboard.php b/web/CONTROLERS/dashboard.php deleted file mode 100644 index 79b1da9..0000000 --- a/web/CONTROLERS/dashboard.php +++ /dev/null @@ -1,8 +0,0 @@ -$container = new \wsos\structs\container(); - -$templates = $container->get("templateLoader"); -$context = $container->get("context"); - -$templates->load("info.html"); -$templates->render($context); -$templates->show(); \ No newline at end of file diff --git a/web/CONTROLLERS/dashboard.php b/web/CONTROLLERS/dashboard.php new file mode 100644 index 0000000..a6fdb94 --- /dev/null +++ b/web/CONTROLLERS/dashboard.php @@ -0,0 +1,33 @@ +get("templateLoader"); + $context = $container->get("context"); + $auth = $container->get("auth"); + + // to show this page user must be logined + $auth->requireLogin(); + + $context["successCount"] = 75; + $context["planedCount"] = 15; + $context["lastPlaned"] = 2; + $context["failCount"] = 5; + $context["observationsCount"] = 5; + + // create planed template observations + $planed = new \DAL\observation(); + $planed->status->set("planed"); + + $observationsTable = new \wsos\database\core\table(\DAL\observation::class); + $planedTable = $observationsTable->query("status=?", [$planed->status->value]); + + $observationsLocators = new \wsos\structs\vector(); + foreach($planedTable->values as $obs) { + $observationsLocators->append($obs->locator->get()); + } + + $context["planedLocators"] = json_encode($observationsLocators->values); + + $templates->load("dashboard.html"); + $templates->render($context); + $templates->show(); \ No newline at end of file diff --git a/web/CONTROLLERS/login.php b/web/CONTROLLERS/login.php new file mode 100644 index 0000000..36d509a --- /dev/null +++ b/web/CONTROLLERS/login.php @@ -0,0 +1,31 @@ +get("templateLoader"); + $context = $container->get("context"); + $auth = $container->get("auth"); + + //add basic info to context + $context["pagename"] = "login"; + $context["fail"] = false; + $context["failInfo"] = []; + + //pass login + if (isset($_POST["username"]) && isset($_POST["password"])) { + + if ($auth->login($_POST["username"], $_POST["password"])) { + header("Location: /"); + die("logined"); + } + + $context["fail"] = true; + $context["failInfo"] = [ + "title" => "Login failed!", + "description" => "Login failed because the user does not exist or the correct password was not used. Please try again." + ]; + } + + $templates->load("login.html"); + $templates->render($context); + $templates->show(); +?> \ No newline at end of file diff --git a/web/CONTROLLERS/observations.php b/web/CONTROLLERS/observations.php new file mode 100644 index 0000000..d6b216f --- /dev/null +++ b/web/CONTROLLERS/observations.php @@ -0,0 +1,15 @@ +get("templateLoader"); + $context = $container->get("context"); + $auth = $container->get("auth"); + + // to show this page user must be logined + $auth->requireLogin(); + + $context["observations"] = new \wsos\database\core\table(\DAL\observation::class); + + $templates->load("observations.html"); + $templates->render($context); + $templates->show(); \ No newline at end of file diff --git a/web/DAL/receiver.php b/web/DAL/receiver.php index 13bd9e9..07b0d64 100644 --- a/web/DAL/receiver.php +++ b/web/DAL/receiver.php @@ -17,7 +17,7 @@ $gain = 0 ) { parent::__construct($id); - $this->object = new \wsos\database\types\reference($station, \DAL\station::class); + $this->station = new \wsos\database\types\reference($station, \DAL\station::class); $this->antenna = new \wsos\database\types\reference($antenna, \DAL\antenna::class); $this->centerFrequency = new \wsos\database\types\integer($centerFrequency); diff --git a/web/DAL/station.php b/web/DAL/station.php index c1aeb57..77026fd 100644 --- a/web/DAL/station.php +++ b/web/DAL/station.php @@ -6,7 +6,7 @@ public \wsos\database\types\text $description; public \wsos\database\types\json $locator; - function __construct($id = null, $name = "", $description = "", $locator = ["tle" => null, "gps" => null, "url" => null]) { + function __construct($id = null, $name = "", $description = "", $locator = []) { parent::__construct($id); $this->name = new \wsos\database\types\text($name); $this->description = new \wsos\database\types\text($description); diff --git a/web/DAL/target.php b/web/DAL/target.php index 4f84ed4..232cf2e 100644 --- a/web/DAL/target.php +++ b/web/DAL/target.php @@ -7,10 +7,10 @@ public \wsos\database\types\text $description; public \wsos\database\types\json $locator; // TLE, GPS or URL locator if avaible - function __construct($id = null, $name = "", $type = null, $description = "", $locator = ["tle" => null, "gps" => null, "url" => null]) { + function __construct($id = null, $name = "", $type = null, $description = "", $locator = []) { parent::__construct($id); $this->name = new \wsos\database\types\text($name); - $this->type = new \wsos\database\types\reference($type, ); + $this->type = new \wsos\database\types\reference($type, \DAL\targetType::class); $this->description = new \wsos\database\types\text($description); $this->locator = new \wsos\database\types\json($locator); diff --git a/web/DAL/targetsType.php b/web/DAL/targetType.php similarity index 100% rename from web/DAL/targetsType.php rename to web/DAL/targetType.php diff --git a/web/DAL/transmitter.php b/web/DAL/transmitter.php index eded62a..459a67a 100644 --- a/web/DAL/transmitter.php +++ b/web/DAL/transmitter.php @@ -13,7 +13,7 @@ function __construct( $id = null, - $object = null, + $target = null, $antenna = null, $modulation = null, $dataType = null, @@ -23,11 +23,11 @@ $processPipe = null ) { parent::__construct($id); - $this->object = new \wsos\database\types\reference($object, \DAL\object::class); + $this->target = new \wsos\database\types\reference($target, \DAL\target::class); $this->antenna = new \wsos\database\types\reference($antenna, \DAL\antenna::class); $this->modulation = new \wsos\database\types\reference($modulation, \DAL\modulation::class); $this->dataType = new \wsos\database\types\reference($dataType, \DAL\dataType::class); - $this->object = new \wsos\database\types\reference($processPipe, \DAL\processPipe::class); + $this->processPipe = new \wsos\database\types\reference($processPipe, \DAL\processPipe::class); $this->centerFrequency = new \wsos\database\types\integer($centerFrequency); $this->bandwidth = new \wsos\database\types\integer($bandwidth); diff --git a/web/Dockerfile b/web/Dockerfile new file mode 100644 index 0000000..0d701a2 --- /dev/null +++ b/web/Dockerfile @@ -0,0 +1,3 @@ +FROM php:7-apache + +RUN a2enmod rewrite \ No newline at end of file diff --git a/web/VIEWS/blocks/alert-danger.html b/web/VIEWS/blocks/alert-danger.html new file mode 100644 index 0000000..3e4ee41 --- /dev/null +++ b/web/VIEWS/blocks/alert-danger.html @@ -0,0 +1,12 @@ +
Using Storage 6854.45 MB of 8 GB
+Network | +Visitors | +|
---|---|---|
3,550 | +
+
+
+
+ |
+ |
1,798 | +
+
+
+
+ |
+ |
1,245 | +
+
+
+
+ |
+ |
TikTok | +986 | +
+
+
+
+ |
+
854 | +
+
+
+
+ |
+ |
VK | +650 | +
+
+
+
+ |
+
420 | +
+
+
+
+ |
+
+ | No. + + | +Invoice Subject | +Client | +VAT No. | +Created | +Status | +Price | ++ |
---|---|---|---|---|---|---|---|---|
+ | 001401 | +Design Works | ++ + Carlson Limited + | ++ 87956621 + | ++ 15 Dec 2017 + | ++ Paid + | +$887 | ++ + + + + | +
+ | 001402 | +UX Wireframes | ++ + Adobe + | ++ 87956421 + | ++ 12 Apr 2017 + | ++ Pending + | +$1200 | ++ + + + + | +
+ | 001403 | +New Dashboard | ++ + Bluewolf + | ++ 87952621 + | ++ 23 Oct 2017 + | ++ Pending + | +$534 | ++ + + + + | +
+ | 001404 | +Landing Page | ++ + Salesforce + | ++ 87953421 + | ++ 2 Sep 2017 + | ++ Due in 2 Weeks + | +$1500 | ++ + + + + | +
+ | 001405 | +Marketing Templates | ++ + Printic + | ++ 87956621 + | ++ 29 Jan 2018 + | ++ Paid Today + | +$648 | ++ + + + + | +
+ | 001406 | +Sales Presentation | ++ + Tabdaq + | ++ 87956621 + | ++ 4 Feb 2018 + | ++ Due in 3 Weeks + | +$300 | ++ + + + + | +
+ | 001407 | +Logo & Print | ++ + Apple + | ++ 87956621 + | ++ 22 Mar 2018 + | ++ Paid Today + | +$2500 | ++ + + + + | +
+ | 001408 | +Icons | ++ + Tookapic + | ++ 87956621 + | ++ 13 May 2018 + | ++ Paid Today + | +$940 | ++ + + + + | +
Station | +Target | +Modulation | +Type | +Frequency | +Status | +Start | +End | +
---|