From f8bea901a4846f3afa98755c29e3d62eb7d3c23e Mon Sep 17 00:00:00 2001
From: Rava Maulana <ravamaulana14@gmail.com>
Date: Wed, 15 Nov 2023 04:58:54 +0700
Subject: [PATCH] feat: added crud premium

---
 .../dashboard/components/input_form.php       | 10 ++-
 .../components/tambah_episode_button.php      |  2 +-
 src/app/components/dashboard/layout.php       | 83 ++++++++-----------
 .../components/dashboard/pages/episode.php    | 29 ++++++-
 src/app/components/dashboard/pages/main.php   | 11 +--
 .../controllers/dashboard/delete_episode.php  | 32 +++++++
 .../controllers/dashboard/delete_podcast.php  | 32 +++++++
 .../controllers/dashboard/get_add_episode.php |  3 +-
 .../controllers/dashboard/get_add_podcast.php |  6 +-
 .../dashboard/get_edit_episode.php            | 30 ++++++-
 .../dashboard/get_edit_podcast.php            | 43 ++++++++--
 src/app/controllers/dashboard/get_episode.php | 24 +++++-
 src/app/controllers/dashboard/get_layout.php  | 19 ++++-
 src/app/controllers/dashboard/get_main.php    | 24 +++++-
 .../dashboard/get_user_podcast.php            | 18 +++-
 .../dashboard/post_add_episode.php            | 46 ++++++++++
 .../dashboard/post_add_podcast.php            | 45 ++++++++++
 .../dashboard/post_edit_episode.php           | 55 +++++++++++-
 .../dashboard/post_edit_podcast.php           | 55 +++++++++++-
 src/public/javascript/dashboard/inputForm.js  | 24 +++++-
 src/public/javascript/dashboard/layout.mjs    | 30 +++++--
 .../dashboard/components/input-form.css       | 17 ++++
 22 files changed, 545 insertions(+), 93 deletions(-)

diff --git a/src/app/components/dashboard/components/input_form.php b/src/app/components/dashboard/components/input_form.php
index bcf88ad..4021561 100644
--- a/src/app/components/dashboard/components/input_form.php
+++ b/src/app/components/dashboard/components/input_form.php
@@ -47,10 +47,18 @@
 
     <p class="sh3"><?= $this->data["INPUT_FORM_COVER_TEXT"] ?? "" ?></p>
     <div>
-      <img id="cover-image" width="200" height="200" src="<?= STORAGE_URL . ($this->data["url_thumbnail"] ?? "/images/placeholder.jpeg") ?> " alt="cover image">
+      <img id="cover-image" width="200" height="200" src="<?= isset($this->data["url_thumbnail"]) ? (
+                                                            (isset($_GET["premium"]) && $_GET["premium"] == "true") ? "http://localhost:3000/images/" . $this->data["url_thumbnail"] : STORAGE_URL . $this->data["url_thumbnail"]
+                                                          ) : (STORAGE_URL . "/images/placeholder.jpeg") ?>" alt="cover image">
       <button id="change-cover-btn">Change Cover</button>
       <input name="image-input" type="file" id="image-input" accept="image/*" class="hidden">
     </div>
+
+    <?php if ($this->data["INPUT_FORM_SHOW_PREMIUM_BUTTON"] ?? false) : ?>
+      <button id="is-premium-btn">Not Premium</button>
+    <?php endif; ?>
+
+    <input id="is-premium-input" type="text" class="hidden" disabled value="<?= $this->data["INPUT_FORM_IS_PREMIUM"] ?? "false" ?>" />
   </div>
 
   <div id="overlay-form" class="overlay hidden"></div>
diff --git a/src/app/components/dashboard/components/tambah_episode_button.php b/src/app/components/dashboard/components/tambah_episode_button.php
index 048ebc8..2082f85 100644
--- a/src/app/components/dashboard/components/tambah_episode_button.php
+++ b/src/app/components/dashboard/components/tambah_episode_button.php
@@ -1,4 +1,4 @@
-<a href="/public/dashboard/add-episode?id_podcast=<?= $this->data["id_podcast"] ?? "" ?>">
+<a href="/public/dashboard/add-episode?id_podcast=<?= $this->data["id_podcast"] ?? "" ?>&premium=<?= $_GET["premium"] ?>">
   <button class="tambah-episode">
     <img src="<?= BASE_URL ?>/images/dashboard/upload_icon.svg" alt="" />
 
diff --git a/src/app/components/dashboard/layout.php b/src/app/components/dashboard/layout.php
index b642c54..38a3fe7 100644
--- a/src/app/components/dashboard/layout.php
+++ b/src/app/components/dashboard/layout.php
@@ -1,59 +1,44 @@
-<!-- <!DOCTYPE html>
-<html lang="en">
+<?php include(dirname(__DIR__) . "/common/toast.php") ?>
 
-<head>
-  <meta charset="UTF-8">
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
+<div id="overlay-layout" class="overlay hidden"></div>
 
-  <link rel="stylesheet" type="text/css" href="<?= BASE_URL ?>/styles/globals.css">
-  <link rel="stylesheet" type="text/css" href="<?= BASE_URL ?>/styles/dashboard/layout.css">
-  <link rel="stylesheet" type="text/css" href="<?= BASE_URL ?>/styles/dashboard/pages/main.css">
-  <link rel="stylesheet" type="text/css" href="<?= BASE_URL ?>/styles/dashboard/pages/episode.css">
-  <link rel="stylesheet" type="text/css" href="<?= BASE_URL ?>/styles/dashboard/components/button.css">
-
-  <script type="module" src="<?= BASE_URL ?>/javascript/dashboard/layout.js" defer></script>
-  <script type="module" src="<?= BASE_URL ?>/javascript/toast.mjs" defer></script>
-  <title>Main Dashboard</title>
-</head>
-
-<body> -->
-  <?php include(dirname(__DIR__) . "/common/toast.php") ?>
-
-  <div id="overlay-layout" class="overlay hidden"></div>
-
-  <main>
-    <div class="dashboard-nav">
-      <div>
-        <p id="dashboard-link" class="sh4">Dashboard</p>
-        <p id="episode-link" class="sh4">Episode</p>
-      </div>
+<main>
+  <div class="dashboard-nav">
+    <div>
+      <p id="dashboard-link" class="sh4">Dashboard</p>
+      <p id="episode-link" class="sh4">Episode</p>
+    </div>
 
-      <div class="choose-container">
-        <button id="choose-podcast-btn" class="">
-          <p class="b3">Choose Podcast</p>
-        </button>
+    <div class="choose-container">
+      <button id="choose-podcast-btn" class="">
+        <p class="b3">Choose Podcast</p>
+      </button>
 
-        <ul id="podcast-choices" class="hidden">
-          <?php foreach ($this->data["podcasts"] as $podcast) : ?>
-            <li>
-              <a href="/public/dashboard-main?id_podcast=<?= $podcast->id_podcast ?>">
-                <p class="b3"><?= $podcast->title ?></p>
-              </a>
-            </li>
-          <?php endforeach; ?>
+      <ul id="podcast-choices" class="hidden">
+        <?php foreach ($this->data["premium_podcasts"] as $podcast) : ?>
           <li>
-            <a href="/public/dashboard/add-podcast">
-              <p class="b3">Add Podcast</p>
+            <a href="/public/dashboard-main?id_podcast=<?= $podcast["id_podcast"] ?>&premium=true">
+              <p class="b3"><?= $podcast["title"] ?></p>
             </a>
           </li>
-        </ul>
-      </div>
+        <?php endforeach; ?>
+        <?php foreach ($this->data["podcasts"] as $podcast) : ?>
+          <li>
+            <a href="/public/dashboard-main?id_podcast=<?= $podcast->id_podcast ?>&premium=false">
+              <p class="b3"><?= $podcast->title ?></p>
+            </a>
+          </li>
+        <?php endforeach; ?>
+        <li>
+          <a href="/public/dashboard/add-podcast">
+            <p class="b3">Add Podcast</p>
+          </a>
+        </li>
+      </ul>
     </div>
+  </div>
 
-    <div class="dashboard-nav-line"></div>
-
-    <section id="dashboard-section"></section>
-  </main>
-<!-- </body>
+  <div class="dashboard-nav-line"></div>
 
-</html> -->
\ No newline at end of file
+  <section id="dashboard-section"></section>
+</main>
\ No newline at end of file
diff --git a/src/app/components/dashboard/pages/episode.php b/src/app/components/dashboard/pages/episode.php
index b054d7e..97d1b71 100644
--- a/src/app/components/dashboard/pages/episode.php
+++ b/src/app/components/dashboard/pages/episode.php
@@ -4,16 +4,41 @@
   </div>
 
   <ul>
-    <?php foreach ($this->data["episodes"] as $idx => $episode) : ?>
+    <?php foreach ($this->data["premium_episodes"] as $idx => $episode) : ?>
       <li>
         <div>
           <p class="episode-number"><?= $idx + 1 + (($this->data["page"] - 1) * 4) ?></p>
+          <img width="75" height="75" src="http://localhost:3000/images/<?= $episode["url_thumbnail"] ?>" alt="">
+          <p class="b2"><?= $episode["title"] ?></p>
+        </div>
+
+        <div>
+          <a href="<?= BASE_URL ?>/dashboard/edit-episode?id_podcast=<?= $this->data["id_podcast"] ?? "" ?>&id_episode=<?= $episode["id_episode"] ?>&premium=true">
+            <div>
+              <img width="16" height="16" src="<?= BASE_URL ?>/images/dashboard/edit_icon.svg" alt="">
+              <p>Edit</p>
+            </div>
+          </a>
+
+          <button data-id="<?= $episode["id_episode"] ?>" class="delete-episode-btn">
+            <div>
+              <img width="16" height="18" src="<?= BASE_URL ?>/images/dashboard/trash_icon.svg" alt="">
+              <p>Delete</p>
+            </div>
+          </button>
+        </div>
+      </li>
+    <?php endforeach; ?>
+    <?php foreach ($this->data["episodes"] as $idx => $episode) : ?>
+      <li>
+        <div>
+          <p class="episode-number"><?= $idx + 1 + count($this->data["premium_episodes"]) + (($this->data["page"] - 1) * 4) ?></p>
           <img width="75" height="75" src="<?= STORAGE_URL . $episode->url_thumbnail ?>" alt="">
           <p class="b2"><?= $episode->title ?></p>
         </div>
 
         <div>
-          <a href="<?= BASE_URL ?>/dashboard/edit-episode?id_podcast=<?= $this->data["id_podcast"] ?? "" ?>&id_episode=<?= $episode->id_episode ?>">
+          <a href="<?= BASE_URL ?>/dashboard/edit-episode?id_podcast=<?= $this->data["id_podcast"] ?? "" ?>&id_episode=<?= $episode->id_episode ?>&premium=false">
             <div>
               <img width="16" height="16" src="<?= BASE_URL ?>/images/dashboard/edit_icon.svg" alt="">
               <p>Edit</p>
diff --git a/src/app/components/dashboard/pages/main.php b/src/app/components/dashboard/pages/main.php
index b99486a..2f3db0b 100644
--- a/src/app/components/dashboard/pages/main.php
+++ b/src/app/components/dashboard/pages/main.php
@@ -3,22 +3,23 @@
     <!-- Podcast Cards -->
     <div class="podcast-card">
       <div class="card-header-container">
-        <img width="200" height="200" class="podcast-thumbnail-img" src="<?= STORAGE_URL . ($this->data["podcast"]->url_thumbnail ?? "") ?>" alt="">
+        <!-- <?= print_r($this->data["podcast"]) ?> -->
+        <img width="200" height="200" class="podcast-thumbnail-img" src="<?= (isset($_GET["premium"]) && $_GET["premium"] == "true" ? "http://localhost:3000/images/" : STORAGE_URL) . ($this->data["podcast"]->url_thumbnail ?? $this->data["podcast"]["url_thumbnail"]) ?>" alt="">
 
         <div class="podcast-description">
           <div class="podcast-category">
-            <p><?= $this->data["podcast"]->category ?? "" ?></p>
+            <p><?= $this->data["podcast"]->category ?? $this->data["podcast"]["category"] ?></p>
           </div>
 
-          <h3><?= $this->data["podcast"]->title ?? "" ?></h3>
-          <p class="b5"><?= $this->data["podcast"]->description ?? "" ?></p>
+          <h3><?= $this->data["podcast"]->title ?? $this->data["podcast"]["title"] ?></h3>
+          <p class="b5"><?= $this->data["podcast"]->description ?? $this->data["podcast"]["description"] ?></p>
         </div>
       </div>
 
       <div class="button-container">
         <?php include(dirname(__DIR__) . "/components/tambah_episode_button.php") ?>
 
-        <a href="/public/dashboard/edit-podcast?id_podcast=<?= $this->data["id_podcast"] ?? "" ?>">
+        <a href="/public/dashboard/edit-podcast?id_podcast=<?= $this->data["id_podcast"] ?? $this->data["podcast"]["id_podcast"] ?>&premium=<?= $_GET["premium"] ?? "false" ?>">
           <button class="edit-button">
             <img src="<?= BASE_URL ?>/images/dashboard/edit_icon.svg" alt="" />
 
diff --git a/src/app/controllers/dashboard/delete_episode.php b/src/app/controllers/dashboard/delete_episode.php
index d4710e1..6c0541f 100644
--- a/src/app/controllers/dashboard/delete_episode.php
+++ b/src/app/controllers/dashboard/delete_episode.php
@@ -22,6 +22,38 @@ class DeleteEpisodeController
       return;
     }
 
+    // Check is premium
+    if ($_GET["premium"] == "true") {
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/episode/" . $_GET["id_episode"]);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      $resMessage = json_decode($output, TRUE)["message"];
+
+      if ($resMessage != "success") {
+        http_response_code(400);
+        header("Content-Type: application/json");
+        echo json_encode(["message" => "bad request"]);
+
+        return;
+      }
+
+      http_response_code(200);
+      header("Content-Type: application/json");
+      echo json_encode(["message" => "success"]);
+
+      return;
+    }
+
     $episodeModel = new EpisodeModel();
     $oldEpisode = $episodeModel->getById($_GET["id_episode"]);
     $episodeModel->deleteEpisode($_GET["id_episode"]);
diff --git a/src/app/controllers/dashboard/delete_podcast.php b/src/app/controllers/dashboard/delete_podcast.php
index f7f4bfd..6e0aa09 100644
--- a/src/app/controllers/dashboard/delete_podcast.php
+++ b/src/app/controllers/dashboard/delete_podcast.php
@@ -22,6 +22,38 @@ class DeletePodcastController
       return;
     }
 
+    // Check is premium
+    if ($_GET["premium"] == "true") {
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast/" . $_GET["id_podcast"]);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      $resMessage = json_decode($output, TRUE)["message"];
+
+      if ($resMessage != "success") {
+        http_response_code(400);
+        header("Content-Type: application/json");
+        echo json_encode(["message" => "bad request"]);
+
+        return;
+      }
+
+      http_response_code(200);
+      header("Content-Type: application/json");
+      echo json_encode(["message" => "success"]);
+
+      return;
+    }
+
     $podcastModel = new podcastModel();
     $oldPodcast = $podcastModel->getById($_GET["id_podcast"]);
     $podcastModel->deletePodcast($_GET["id_podcast"]);
diff --git a/src/app/controllers/dashboard/get_add_episode.php b/src/app/controllers/dashboard/get_add_episode.php
index c4e449d..61e8d12 100644
--- a/src/app/controllers/dashboard/get_add_episode.php
+++ b/src/app/controllers/dashboard/get_add_episode.php
@@ -37,10 +37,9 @@ class GetAddEpisodeController
     $data = [
       "INPUT_FORM_TITLE" => "Create New Episode",
       "INPUT_FORM_SHOW_AUDIO_INPUT" => true,
-      // "INPUT_FORM_SHOW_CATEGORY_INPUT" => true,
       "INPUT_FORM_COVER_TEXT" => "Episode Cover",
       "INPUT_FORM_SUBMIT_TEXT" => "Save Episode",
-      // "INPUT_FORM_DELETE_TEXT" => "Hapus Podcast",
+      "INPUT_FORM_IS_PREMIUM" => $_GET["premium"],
       "INPUT_FORM_TITLE_TEXT" => "Episode title",
       "INPUT_FORM_DESCRIPTION_TEXT" => "Episode description",
       "INPUT_FORM_TYPE" => "add-episode",
diff --git a/src/app/controllers/dashboard/get_add_podcast.php b/src/app/controllers/dashboard/get_add_podcast.php
index c8d348b..f3c73d9 100644
--- a/src/app/controllers/dashboard/get_add_podcast.php
+++ b/src/app/controllers/dashboard/get_add_podcast.php
@@ -28,15 +28,15 @@ class GetAddPodcastController
 
     $data = [
       "INPUT_FORM_TITLE" => "Create New Podcast",
-      // "INPUT_FORM_SHOW_AUDIO_INPUT" => true,
       "INPUT_FORM_SHOW_CATEGORY_INPUT" => true,
       "INPUT_FORM_COVER_TEXT" => "Podcast Cover",
       "INPUT_FORM_SUBMIT_TEXT" => "Save Podcast",
-      // "INPUT_FORM_DELETE_TEXT" => "Hapus Podcast",
       "INPUT_FORM_TITLE_TEXT" => "Podcast title",
       "INPUT_FORM_DESCRIPTION_TEXT" => "Podcast description",
       "INPUT_FORM_TYPE" => "add-podcast",
-      "categories" => ["comedy", "sports", "technology"],
+      "INPUT_FORM_SHOW_PREMIUM_BUTTON" => true,
+      "INPUT_FORM_IS_PREMIUM" => "false",
+      "categories" => ["comedy", "horror", "technology"],
       "id_user" => $userId,
     ];
 
diff --git a/src/app/controllers/dashboard/get_edit_episode.php b/src/app/controllers/dashboard/get_edit_episode.php
index 744a34a..398a6a7 100644
--- a/src/app/controllers/dashboard/get_edit_episode.php
+++ b/src/app/controllers/dashboard/get_edit_episode.php
@@ -38,9 +38,32 @@ class GetEditEpisodeController
 
     $idEpisode = "";
     $episode = null;
+    $resMessage = null;
+
     if (!isset($_GET["id_episode"])) {
       (new NotFoundController())->call();
       return;
+    } else if ($_GET["premium"] == "true") {
+      $idEpisode = $_GET["id_episode"];
+
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/episode/" . $idEpisode);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      $resMessage = json_decode($output, TRUE)["episode"];
+      if (!$resMessage["id_podcast"] || $resMessage["id_podcast"] != $idPodcast) {
+        (new NotFoundController())->call();
+        return;
+      }
     } else {
       $idEpisode = $_GET["id_episode"];
 
@@ -55,10 +78,11 @@ class GetEditEpisodeController
       "INPUT_FORM_TITLE" => "Edit Episode",
       "INPUT_FORM_COVER_TEXT" => "Episode Cover",
       "INPUT_FORM_SUBMIT_TEXT" => "Save Episode",
-      "INPUT_FORM_TITLE_TEXT" => $episode->title ?? "",
-      "INPUT_FORM_DESCRIPTION_TEXT" => $episode->description ?? "",
+      "INPUT_FORM_TITLE_TEXT" => $_GET["premium"] == "true" ? $resMessage["title"] : $episode->title,
+      "INPUT_FORM_DESCRIPTION_TEXT" => $_GET["premium"] == "true" ? $resMessage["description"] : $episode->description,
       "INPUT_FORM_TYPE" => "edit-episode",
-      "url_thumbnail" => $episode->url_thumbnail ?? "",
+      "INPUT_FORM_IS_PREMIUM" => $_GET["premium"],
+      "url_thumbnail" => $_GET["premium"] == "true" ? $resMessage["url_thumbnail"] : $episode->url_thumbnail,
       "id_user" => $userId,
       "id_podcast" => $idPodcast,
     ];
diff --git a/src/app/controllers/dashboard/get_edit_podcast.php b/src/app/controllers/dashboard/get_edit_podcast.php
index 662a3d3..37e23bd 100644
--- a/src/app/controllers/dashboard/get_edit_podcast.php
+++ b/src/app/controllers/dashboard/get_edit_podcast.php
@@ -24,33 +24,58 @@ class GetEditPodcastController
 
     require_once __DIR__ . "/../../views/dashboard/dash_form.php";
 
+    $podcastModel = new PodcastModel();
 
     $userId = $_SESSION["user_id"];
 
     $idPodcast = "";
+    $podcast = null;
+    $resMessage = null;
+
     if (!isset($_GET["id_podcast"])) {
       (new NotFoundController())->call();
       return;
+    } else if ($_GET["premium"] == "true") {
+      $idPodcast = $_GET["id_podcast"];
+
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast/" . $idPodcast);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      $resMessage = json_decode($output, TRUE)["podcast"];
+      if (!$resMessage["id_user"] || $resMessage["id_user"] != $_SESSION["user_id"]) {
+        (new NotFoundController())->call();
+        return;
+      }
     } else {
       $idPodcast = $_GET["id_podcast"];
-    }
 
-    $podcastModel = new PodcastModel();
-    $podcast = $podcastModel->getById($idPodcast);
-    if (!$podcast || $podcast->id_podcast != $idPodcast) {
-      (new NotFoundController())->call();
-      return;
+      $podcast = $podcastModel->getById($idPodcast);
+      if (!$podcast || $podcast->id_user != $_SESSION["user_id"]) {
+        (new NotFoundController())->call();
+        return;
+      }
     }
 
     $data = [
       "INPUT_FORM_TITLE" => "Edit Podcast",
       "INPUT_FORM_COVER_TEXT" => "Episode Cover",
       "INPUT_FORM_SUBMIT_TEXT" => "Save Podcast",
-      "INPUT_FORM_TITLE_TEXT" => $podcast->title ?? "",
+      "INPUT_FORM_TITLE_TEXT" => $_GET["premium"] == "true" ? $resMessage["title"] : $podcast->title,
       "INPUT_FORM_DELETE_TEXT" => "Hapus Podcast",
-      "INPUT_FORM_DESCRIPTION_TEXT" => $podcast->description ?? "",
+      "INPUT_FORM_DESCRIPTION_TEXT" => $_GET["premium"] == "true" ? $resMessage["description"] : $podcast->description,
       "INPUT_FORM_TYPE" => "edit-podcast",
-      "url_thumbnail" => $podcast->url_thumbnail ?? "",
+      "INPUT_FORM_IS_PREMIUM" => $_GET["premium"],
+      "url_thumbnail" => $_GET["premium"] == "true" ? $resMessage["url_thumbnail"] : $podcast->url_thumbnail,
       "id_user" => $userId,
       "id_podcast" => $idPodcast,
     ];
diff --git a/src/app/controllers/dashboard/get_episode.php b/src/app/controllers/dashboard/get_episode.php
index 3afdfeb..e4be4ba 100644
--- a/src/app/controllers/dashboard/get_episode.php
+++ b/src/app/controllers/dashboard/get_episode.php
@@ -24,6 +24,27 @@ class GetDashboardEpisodeController
     if (!isset($_GET["id_podcast"])) {
       (new NotFoundController())->call();
       return;
+    } else if ($_GET["premium"] == "true") {
+      $idPodcast = $_GET["id_podcast"];
+
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast/" . $idPodcast);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      $resMessage = json_decode($output, TRUE)["podcast"];
+      if (!$resMessage["id_podcast"] || $resMessage["id_user"] != $_SESSION["user_id"]) {
+        (new NotFoundController())->call();
+        return;
+      }
     } else {
       $idPodcast = $_GET["id_podcast"];
 
@@ -56,12 +77,13 @@ class GetDashboardEpisodeController
     }
 
     $data = [
+      "premium_episodes" => $resMessage["PremiumEpisodes"] ?? [],
       "episodes" => $episodes,
       "page_count" => $pageCount,
       "url_thumbnail" => $episodes[0]->url_thumbnail ?? "",
       "id_user" => $userId,
       "id_podcast" => $idPodcast,
-      "page" => $page
+      "page" => $page,
     ];
 
     $view = new DashboardEpisodeView($data);
diff --git a/src/app/controllers/dashboard/get_layout.php b/src/app/controllers/dashboard/get_layout.php
index c964a46..c6d1203 100644
--- a/src/app/controllers/dashboard/get_layout.php
+++ b/src/app/controllers/dashboard/get_layout.php
@@ -24,11 +24,28 @@ class GetDashboardLayoutController
 
     require_once __DIR__ . "/../../views/dashboard/layout.php";
 
+    // Get all premium podcasts
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast/by-user/" . $_SESSION["user_id"]);
+    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
+    curl_setopt($ch, CURLOPT_HTTPHEADER, [
+      "apikey: " . $_ENV["REST_PHP_KEY"],
+    ]);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+    $output = curl_exec($ch);
+    curl_close($ch);
+
+    $resMessage = json_decode($output, TRUE)["podcasts"];
+
     $podcastModel = new PodcastModel();
     $podcasts = $podcastModel->getUserPodcasts($_SESSION["user_id"]) ?? [];
 
     $data = [
-      "podcasts" => $podcasts
+      "podcasts" => $podcasts,
+      "premium_podcasts" => $resMessage
     ];
 
     $view = new DashboardLayoutView($data);
diff --git a/src/app/controllers/dashboard/get_main.php b/src/app/controllers/dashboard/get_main.php
index 9541c96..a79ac4d 100644
--- a/src/app/controllers/dashboard/get_main.php
+++ b/src/app/controllers/dashboard/get_main.php
@@ -21,9 +21,31 @@ class GetDashboardMainController
     $userId = $_SESSION["user_id"];
 
     $podcast = null;
+    $resMessage = null;
     if (!isset($_GET["id_podcast"])) {
       (new NotFoundController())->call();
       return;
+    } else if ($_GET["premium"] == "true") {
+      $idPodcast = $_GET["id_podcast"];
+
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast/" . $idPodcast);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      $resMessage = json_decode($output, TRUE)["podcast"];
+      if (!$resMessage["id_podcast"] || $resMessage["id_user"] != $_SESSION["user_id"]) {
+        (new NotFoundController())->call();
+        return;
+      }
     } else {
       $idPodcast = $_GET["id_podcast"];
       $podcast = $podcastModel->getById($idPodcast);
@@ -40,7 +62,7 @@ class GetDashboardMainController
     }
 
     $data = [
-      "podcast" => $podcast,
+      "podcast" => $podcast ?? $resMessage,
       "episodes" => $episodes,
       "url_thumbnail" => $episodes[0]->url_thumbnail ?? "",
       "id_user" => $userId,
diff --git a/src/app/controllers/dashboard/get_user_podcast.php b/src/app/controllers/dashboard/get_user_podcast.php
index 468f593..c2e15f1 100644
--- a/src/app/controllers/dashboard/get_user_podcast.php
+++ b/src/app/controllers/dashboard/get_user_podcast.php
@@ -13,12 +13,28 @@ class GetUserPodcastController
       return;
     }
 
+    // Get all premium podcasts
+    $ch = curl_init();
+    curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast/by-user/" . $_SESSION["user_id"]);
+    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
+    curl_setopt($ch, CURLOPT_HTTPHEADER, [
+      "apikey: " . $_ENV["REST_PHP_KEY"],
+    ]);
+    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+    $output = curl_exec($ch);
+    curl_close($ch);
+
+    $resMessage = json_decode($output, TRUE)["podcasts"];
+
     $podcastModel = new PodcastModel();
     $podcasts = $podcastModel->getUserPodcasts($_SESSION["user_id"]) ?? [];
 
     http_response_code(200);
     header("Content-Type: application/json");
-    echo json_encode(["podcasts" => $podcasts]);
+    echo json_encode(["podcasts" => $podcasts, "premium_podcasts" => $resMessage]);
 
     return;
   }
diff --git a/src/app/controllers/dashboard/post_add_episode.php b/src/app/controllers/dashboard/post_add_episode.php
index f9f81ac..99aaf16 100644
--- a/src/app/controllers/dashboard/post_add_episode.php
+++ b/src/app/controllers/dashboard/post_add_episode.php
@@ -68,6 +68,52 @@ class PostAddEpisodeController
     $imageFileName = "/images/" . md5(uniqid(mt_rand(), true)) . IMAGE_MAP[$imageMimeType];
     move_uploaded_file($_FILES["imageFile"]["tmp_name"], __DIR__ . "/../../storage" . $imageFileName);
 
+    // Check is premium
+    if ($_POST["isPremium"] == "true") {
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/episode");
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt(
+        $ch,
+        CURLOPT_POSTFIELDS,
+        [
+          "title" => $_POST["title"],
+          "description" => $_POST["description"],
+          "idPodcast" => $_POST["idPodcast"],
+          "imageFile" => curl_file_create(__DIR__ . "/../../storage" . $imageFileName),
+          "audioFile" => curl_file_create(__DIR__ . "/../../storage" . $audioFileName),
+        ]
+      );
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      unlink(__DIR__ . "/../../storage" . $imageFileName);
+      unlink(__DIR__ . "/../../storage" . $audioFileName);
+
+      $resMessage = json_decode($output, TRUE)["message"];
+
+      if ($resMessage != "success") {
+        http_response_code(400);
+        header("Content-Type: application/json");
+        echo json_encode(["message" => "bad request"]);
+
+        return;
+      }
+
+      http_response_code(201);
+      header("Content-Type: application/json");
+      echo json_encode(["message" => "success"]);
+
+      return;
+    }
+
     $episodeModel = new EpisodeModel();
     $episodeModel->saveEpisode($_POST["idPodcast"], $_POST["title"], $_POST["description"], $imageFileName, $audioFileName);
 
diff --git a/src/app/controllers/dashboard/post_add_podcast.php b/src/app/controllers/dashboard/post_add_podcast.php
index 32745ef..2d02b1b 100644
--- a/src/app/controllers/dashboard/post_add_podcast.php
+++ b/src/app/controllers/dashboard/post_add_podcast.php
@@ -45,6 +45,51 @@ class PostAddPodcastController
     $imageFileName = "/images/" . md5(uniqid(mt_rand(), true)) . IMAGE_MAP[$imageMimeType];
     move_uploaded_file($_FILES["imageFile"]["tmp_name"], __DIR__ . "/../../storage" . $imageFileName);
 
+    // Check is premium
+    if ($_POST["isPremium"] == "true") {
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast");
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      curl_setopt(
+        $ch,
+        CURLOPT_POSTFIELDS,
+        [
+          "title" => $_POST["title"],
+          "description" => $_POST["description"],
+          "idUser" => $_SESSION["user_id"],
+          "imageFile" => curl_file_create(__DIR__ . "/../../storage" . $imageFileName),
+          "category" => $_POST["category"]
+        ]
+      );
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      unlink(__DIR__ . "/../../storage" . $imageFileName);
+
+      $resMessage = json_decode($output, TRUE)["message"];
+
+      if ($resMessage != "success") {
+        http_response_code(400);
+        header("Content-Type: application/json");
+        echo json_encode(["message" => "bad request"]);
+
+        return;
+      }
+
+      http_response_code(201);
+      header("Content-Type: application/json");
+      echo json_encode(["message" => "success"]);
+      
+      return;
+    }
+
     $podcastModel = new PodcastModel();
     $podcastModel->savePodcast($_SESSION["user_id"], $_POST["title"], $_POST["description"], $_POST["category"], $imageFileName);
 
diff --git a/src/app/controllers/dashboard/post_edit_episode.php b/src/app/controllers/dashboard/post_edit_episode.php
index 2581d97..6bea488 100644
--- a/src/app/controllers/dashboard/post_edit_episode.php
+++ b/src/app/controllers/dashboard/post_edit_episode.php
@@ -43,16 +43,67 @@ class PostEditEpisodeController
     $episodeModel = new EpisodeModel();
     $oldEpisode = $episodeModel->getById($_POST["idEpisode"]);
 
-    $imageFileName = $oldEpisode->url_thumbnail;
+    $imageFileName = $oldEpisode->url_thumbnail ?? "";
     // Store image file in server storage (if provided)
     if (isset($_POST["updateCover"]) && $_POST["updateCover"]) {
-      unlink(__DIR__ . "/../../storage" . $oldEpisode->url_thumbnail);
+      if ($oldEpisode) {
+        unlink(__DIR__ . "/../../storage" . $oldEpisode->url_thumbnail);
+      }
 
       $imageMimeType = mime_content_type($_FILES["imageFile"]["tmp_name"]);
       $imageFileName = "/images/" . md5(uniqid(mt_rand(), true)) . IMAGE_MAP[$imageMimeType];
       move_uploaded_file($_FILES["imageFile"]["tmp_name"], __DIR__ . "/../../storage" . $imageFileName);
     }
 
+    // Check is premium
+    if ($_POST["isPremium"] == "true") {
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/episode/" . $_POST["idEpisode"]);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      $data = [
+        "title" => $_POST["title"],
+        "description" => $_POST["description"],
+        "updateCover" => $_POST["updateCover"] ?? "false",
+      ];
+      if (isset($_POST["updateCover"]) && $_POST["updateCover"]) {
+        $data["imageFile"] = curl_file_create(__DIR__ . "/../../storage" . $imageFileName);
+      }
+      curl_setopt(
+        $ch,
+        CURLOPT_POSTFIELDS,
+        $data
+      );
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      if (isset($_POST["updateCover"]) && $_POST["updateCover"]) {
+        unlink(__DIR__ . "/../../storage" . $imageFileName);
+      }
+
+      $resMessage = json_decode($output, TRUE)["message"];
+
+      if ($resMessage != "success") {
+        http_response_code(400);
+        header("Content-Type: application/json");
+        echo json_encode(["message" => "bad request"]);
+
+        return;
+      }
+
+      http_response_code(201);
+      header("Content-Type: application/json");
+      echo json_encode(["message" => "success"]);
+
+      return;
+    }
+
     $episodeModel->updateEpisode($_POST["idEpisode"], $_POST["title"], $_POST["description"], $imageFileName);
 
     http_response_code(201);
diff --git a/src/app/controllers/dashboard/post_edit_podcast.php b/src/app/controllers/dashboard/post_edit_podcast.php
index f84fc4f..6b35149 100644
--- a/src/app/controllers/dashboard/post_edit_podcast.php
+++ b/src/app/controllers/dashboard/post_edit_podcast.php
@@ -43,16 +43,67 @@ class PostEditPodcastController
     $podcastModel = new PodcastModel();
     $oldPodcast = $podcastModel->getById($_POST["idPodcast"]);
 
-    $imageFileName = $oldPodcast->url_thumbnail;
+    $imageFileName = $oldPodcast->url_thumbnail ?? "";
     // Store image file in server storage (if provided)
     if (isset($_POST["updateCover"]) && $_POST["updateCover"]) {
-      unlink(__DIR__ . "/../../storage" . $oldPodcast->url_thumbnail);
+      if ($oldPodcast) {
+        unlink(__DIR__ . "/../../storage" . $oldPodcast->url_thumbnail);
+      }
 
       $imageMimeType = mime_content_type($_FILES["imageFile"]["tmp_name"]);
       $imageFileName = "/images/" . md5(uniqid(mt_rand(), true)) . IMAGE_MAP[$imageMimeType];
       move_uploaded_file($_FILES["imageFile"]["tmp_name"], __DIR__ . "/../../storage" . $imageFileName);
     }
 
+    // Check is premium
+    if ($_POST["isPremium"] == "true") {
+      $ch = curl_init();
+      curl_setopt($ch, CURLOPT_URL, "http://tubes-rest-service:3000/podcast/" . $_POST["idPodcast"]);
+      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
+      curl_setopt($ch, CURLOPT_HTTPHEADER, [
+        "apikey: " . $_ENV["REST_PHP_KEY"],
+      ]);
+      $data = [
+        "title" => $_POST["title"],
+        "description" => $_POST["description"],
+        "updateCover" => $_POST["updateCover"] ?? "false",
+      ];
+      if (isset($_POST["updateCover"]) && $_POST["updateCover"]) {
+        $data["imageFile"] = curl_file_create(__DIR__ . "/../../storage" . $imageFileName);
+      }
+      curl_setopt(
+        $ch,
+        CURLOPT_POSTFIELDS,
+        $data
+      );
+      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
+      curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
+
+      $output = curl_exec($ch);
+      curl_close($ch);
+
+      if (isset($_POST["updateCover"]) && $_POST["updateCover"]) {
+        unlink(__DIR__ . "/../../storage" . $imageFileName);
+      }
+
+      $resMessage = json_decode($output, TRUE)["message"];
+
+      if ($resMessage != "success") {
+        http_response_code(400);
+        header("Content-Type: application/json");
+        echo json_encode(["message" => "bad request"]);
+
+        return;
+      }
+
+      http_response_code(201);
+      header("Content-Type: application/json");
+      echo json_encode(["message" => "success"]);
+
+      return;
+    }
+
     $podcastModel->updatePodcast($_POST["idPodcast"], $_POST["title"], $_POST["description"], $imageFileName);
 
     http_response_code(201);
diff --git a/src/public/javascript/dashboard/inputForm.js b/src/public/javascript/dashboard/inputForm.js
index 0fa4c2b..31226f0 100644
--- a/src/public/javascript/dashboard/inputForm.js
+++ b/src/public/javascript/dashboard/inputForm.js
@@ -16,12 +16,14 @@ const changeCoverButtonEl = document.getElementById("change-cover-btn");
 const saveButtonEl = document.getElementById("save-btn");
 const categoryButtonEl = document.getElementById("category-input-btn");
 const deleteButtonEl = document.getElementById("delete-btn");
+const isPremiumButtonEl = document.getElementById("is-premium-btn");
 
 const audioInputEl = document.getElementById("audio-input");
 const judulInputEl = document.getElementById("judul-input");
 const descriptionInputEl = document.getElementById("description-input");
 const imageInputEl = document.getElementById("image-input");
 const categoryInputEl = document.getElementById("category-input");
+const isPremiumInputEl = document.getElementById("is-premium-input");
 
 const fileNameEl = document.getElementById("file-name");
 const fileNameContainerEl = document.querySelector(".file-name-container");
@@ -154,7 +156,10 @@ deleteButtonEl &&
     }
 
     const xhr1 = new XMLHttpRequest();
-    xhr1.open("DELETE", `/public/dashboard/podcast?id_podcast=${idPodcast}`);
+    xhr1.open(
+      "DELETE",
+      `/public/dashboard/podcast?id_podcast=${idPodcast}&premium=${isPremiumInputEl.value}`
+    );
     xhr1.send(null);
 
     xhr1.onreadystatechange = function () {
@@ -167,6 +172,18 @@ deleteButtonEl &&
     };
   });
 
+isPremiumButtonEl &&
+  isPremiumButtonEl.addEventListener("click", (e) => {
+    e.preventDefault();
+
+    isPremiumInputEl.value =
+      isPremiumInputEl.value === "false" ? "true" : "false";
+    isPremiumButtonEl.innerText =
+      isPremiumInputEl.value === "false" ? "Not Premium" : "Premium";
+
+    isPremiumButtonEl.classList.toggle("premium-selected");
+  });
+
 // Handle submit form
 saveButtonEl.addEventListener("click", (e) => {
   e.preventDefault();
@@ -179,6 +196,7 @@ saveButtonEl.addEventListener("click", (e) => {
   const title = judulInputEl.value;
   const description = descriptionInputEl.value;
   const category = categoryInputEl?.value;
+  const isPremium = isPremiumInputEl.value;
 
   // Limit file size to only 10 MB
   if (audioFile?.size > 10 * 1024 * 1024) {
@@ -238,6 +256,7 @@ saveButtonEl.addEventListener("click", (e) => {
       formData.append("title", title);
       formData.append("description", description);
       formData.append("idPodcast", idPodcast);
+      formData.append("isPremium", isPremium);
 
       xhr.send(formData);
       break;
@@ -279,6 +298,7 @@ saveButtonEl.addEventListener("click", (e) => {
         "description",
         description || descriptionInputEl.placeholder
       );
+      formData.append("isPremium", isPremium);
 
       xhr.send(formData);
       break;
@@ -318,6 +338,7 @@ saveButtonEl.addEventListener("click", (e) => {
       formData.append("title", title);
       formData.append("description", description);
       formData.append("category", category);
+      formData.append("isPremium", isPremium);
 
       xhr.send(formData);
       break;
@@ -358,6 +379,7 @@ saveButtonEl.addEventListener("click", (e) => {
         "description",
         description || descriptionInputEl.placeholder
       );
+      formData.append("isPremium", isPremium);
 
       xhr.send(formData);
       break;
diff --git a/src/public/javascript/dashboard/layout.mjs b/src/public/javascript/dashboard/layout.mjs
index bd6b475..6d8fbc6 100644
--- a/src/public/javascript/dashboard/layout.mjs
+++ b/src/public/javascript/dashboard/layout.mjs
@@ -17,6 +17,7 @@ export function handleDashboard() {
   let idPodcast = new URLSearchParams(window.location.search).get("id_podcast");
   let page = new URLSearchParams(window.location.search).get("page");
   let podcasts = [];
+  let isPremium = new URLSearchParams(window.location.search).get("premium");
 
   // Initial request to fetch user podcasts
   const xhr = new XMLHttpRequest();
@@ -27,7 +28,15 @@ export function handleDashboard() {
     if (xhr.readyState === 4 && xhr.status === 200) {
       const resJson = JSON.parse(xhr.response);
 
-      podcasts = resJson?.podcasts;
+      podcasts =
+        resJson?.podcasts.length > 0
+          ? resJson?.podcasts
+          : resJson?.premium_podcasts;
+
+      if (!isPremium) {
+        isPremium = resJson?.podcasts.length > 0 ? "false" : "true";
+      }
+
       // Redirect if the user doesnt have any podcast
       if (podcasts.length === 0) {
         window.location.replace("/public/dashboard/add-podcast");
@@ -54,7 +63,7 @@ export function handleDashboard() {
         "GET",
         `/public/dashboard/internal/${lastURL}?id_podcast=${idPodcast}${
           lastURL === "dashboard-episode" ? `&page=${page || 1}` : ""
-        }`
+        }&premium=${isPremium}`
       );
       xhr2.send(null);
 
@@ -84,7 +93,7 @@ export function handleDashboard() {
         "",
         `/public/${lastURL}?id_podcast=${idPodcast}${
           lastURL === "dashboard-episode" ? `&page=${page || 1}` : ""
-        }`
+        }&premium=${isPremium}`
       );
     }
   };
@@ -111,7 +120,7 @@ export function handleDashboard() {
     history.pushState(
       {},
       "",
-      `http://localhost:8080/public/dashboard-episode?id_podcast=${idPodcast}&page=1`
+      `http://localhost:8080/public/dashboard-episode?id_podcast=${idPodcast}&page=1&premium=${isPremium}`
     );
 
     dashboardLink.classList.toggle("nav-active");
@@ -120,7 +129,7 @@ export function handleDashboard() {
     const xhr = new XMLHttpRequest();
     xhr.open(
       "GET",
-      `/public/dashboard/internal/dashboard-episode?id_podcast=${idPodcast}&page=1`
+      `/public/dashboard/internal/dashboard-episode?id_podcast=${idPodcast}&page=1&premium=${isPremium}`
     );
     xhr.send(null);
 
@@ -147,14 +156,17 @@ export function handleDashboard() {
     history.pushState(
       {},
       "",
-      `http://localhost:8080/public/dashboard-main?id_podcast=${idPodcast}`
+      `http://localhost:8080/public/dashboard-main?id_podcast=${idPodcast}&premium=${isPremium}`
     );
 
     dashboardLink.classList.toggle("nav-active");
     episodeLink.classList.toggle("nav-active");
 
     const xhr1 = new XMLHttpRequest();
-    xhr1.open("GET", `/public/dashboard/internal/dashboard-main?id_podcast=${idPodcast}`);
+    xhr1.open(
+      "GET",
+      `/public/dashboard/internal/dashboard-main?id_podcast=${idPodcast}&premium=${isPremium}`
+    );
     xhr1.send(null);
 
     xhr1.onreadystatechange = function () {
@@ -175,7 +187,7 @@ export function handleDashboard() {
     }
 
     const xhr1 = new XMLHttpRequest();
-    xhr1.open("DELETE", `/public/dashboard/episode?id_episode=${idEpisode}`);
+    xhr1.open("DELETE", `/public/dashboard/episode?id_episode=${idEpisode}&premium=${isPremium}`);
     xhr1.send(null);
 
     xhr1.onreadystatechange = function () {
@@ -185,7 +197,7 @@ export function handleDashboard() {
         const xhr2 = new XMLHttpRequest();
         xhr2.open(
           "GET",
-          `/public/dashboard/internal/dashboard-episode?id_podcast=${idPodcast}&page=1`
+          `/public/dashboard/internal/dashboard-episode?id_podcast=${idPodcast}&page=1&premium=${isPremium}`
         );
         xhr2.send(null);
 
diff --git a/src/public/styles/dashboard/components/input-form.css b/src/public/styles/dashboard/components/input-form.css
index 6570ee8..ab2049b 100644
--- a/src/public/styles/dashboard/components/input-form.css
+++ b/src/public/styles/dashboard/components/input-form.css
@@ -207,6 +207,23 @@ option {
   background-color: var(--ORANGE);
 }
 
+#is-premium-btn {
+  text-align: center;
+  border-radius: 16px;
+  border: 2px var(--PINK-1) solid;
+  padding: 12px 24px 10px;
+  font-size: 14px;
+  font-weight: 700;
+  text-transform: uppercase;
+  margin-top: 32px;
+}
+
+.premium-selected {
+  background-color: #398044;
+  border: none !important;
+  padding: 12px 28px 10px !important;
+}
+
 @media (max-width: 768px) {
   #input-form {
     width: 100%;
-- 
GitLab