diff --git a/.gitignore b/.gitignore index 915068b..cd1b3c8 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,5 @@ node_modules/ package-lock\.json src/assets/images/contents/ + +dist/ diff --git a/angular.json b/angular.json index 48a4209..be23e47 100644 --- a/angular.json +++ b/angular.json @@ -25,7 +25,8 @@ "aot": true, "assets": [ "src/assets/images/favicon.png", - "src/assets" + "src/assets", + "src/apis" ], "styles": [ "src/assets/scss/main.scss" diff --git a/src/apis/conn.conn b/src/apis/conn.conn new file mode 100755 index 0000000..877d806 --- /dev/null +++ b/src/apis/conn.conn @@ -0,0 +1,16 @@ + diff --git a/src/apis/index.php b/src/apis/index.php new file mode 100644 index 0000000..8adaa9a --- /dev/null +++ b/src/apis/index.php @@ -0,0 +1,93 @@ +items = array(); + +$filter = array("portfolio", "installations", "entertainment", "performances", "workshops"); + +switch($_GET['query']) { + case "portfolio": + case "installations": + case "entertainment": + case "performances": + case "workshops": + if($_GET['query'] == 'portfolio') {$filter = '';} else {$filter = "WHERE type='".$_GET['query']."'";} + $qe = mysqli_query($conn,"SELECT * FROM `works` $filter ORDER BY id DESC"); + if(mysqli_num_rows($qe) > 0) { + $content = null; + $content->items = array(); + while($re = mysqli_fetch_array($qe)) { + $item = null; + $item->id = $re['id']; + $item->title = $re['title']; + $item->type = $re['type']; + $item->tags = $re['tags']; + $item->image = $re['image']; + array_push($content->items, $item); + } + } + break; + case "exhibitions": + $qe = mysqli_query($conn,"SELECT * FROM `exhibitions` ORDER BY date_from DESC"); + if(mysqli_num_rows($qe) > 0) { + $content = null; + $content->items = array(); + while($re = mysqli_fetch_array($qe)) { + $item = null; + $item->id = $re['id']; + $item->title = $re['title']; + $item->date_from = $re['date_from']; + $item->date_to = $re['date_to']; + $item->tags = $re['tags']; + $item->image = $re['image']; + array_push($content->items, $item); + } + } + break; + case "detail": + $qe = mysqli_query($conn,"SELECT * FROM `".$_GET['type']."` WHERE id=".$_GET['id']); + if(mysqli_num_rows($qe)>0) { + $content = null; + $re = mysqli_fetch_array($qe); + $item = null; + $item->id = $re['id']; + $item->title = $re['title']; + $item->content = $re['content']; + $item->tags = $re['tags']; + $item->image = $re['image']; + if($_GET['type'] == 'exhibitions') { + $item->date_from = $re['date_from']; + $item->date_to = $re['date_to']; + $item->works = array(); + $qx = mysqli_query($conn,"SELECT id,title FROM `works` WHERE id IN (".$re['works'].")"); + while($re = mysqli_fetch_array($qx)) { + $ex = null; + $ex->id = $re['id']; + $ex->title = $re['title']; + array_push($item->works, $ex); + } + } else if($_GET['type'] == 'works') { + $item->type = $re['type']; + $item->exhibitions = array(); + $qx = mysqli_query($conn,"SELECT id,title FROM `exhibitions` WHERE id IN (".$re['exhibitions'].")"); + while($re = mysqli_fetch_array($qx)) { + $ex = null; + $ex->id = $re['id']; + $ex->title = $re['title']; + array_push($item->exhibitions, $ex); + } + } + $content->item = $item; + } + break; +} + + +header('Access-Control-Allow-Origin: *'); +header('Content-Type: application/json'); +echo json_encode($content); + +?> diff --git a/src/app/app-layout/app-layout.component.ts b/src/app/app-layout/app-layout.component.ts index 7174112..0b874c6 100644 --- a/src/app/app-layout/app-layout.component.ts +++ b/src/app/app-layout/app-layout.component.ts @@ -8,7 +8,7 @@ import type { Container } from 'tsparticles' }) export class AppLayoutComponent implements OnInit { - public particlesEnabled: boolean = true + public particlesEnabled: boolean = false public id: string = 'tsparticles' public particlesOptions: any = { diff --git a/src/app/app-routing.module.ts b/src/app/app-routing.module.ts index 1b2066f..83b3dbc 100644 --- a/src/app/app-routing.module.ts +++ b/src/app/app-routing.module.ts @@ -21,7 +21,11 @@ const routes: Routes = [ { path: 'workshops', component: PortfolioComponent }, { path: 'detail', component: DetailComponent, children: [ - { path: '**', component: DetailComponent } + { path: '**', component: DetailComponent, + children: [ + { path: '**', component: DetailComponent } + ] + } ] } diff --git a/src/app/detail/detail.component.html b/src/app/detail/detail.component.html index 408cb39..f5aa256 100644 --- a/src/app/detail/detail.component.html +++ b/src/app/detail/detail.component.html @@ -3,7 +3,19 @@