diff --git a/index.php b/index.php index c1df4f1..84da6ef 100644 --- a/index.php +++ b/index.php @@ -4,6 +4,10 @@ require_once("template.php"); if (!file_exists("config.php")) { require_once("install.php"); +} elseif(isset($_GET['do'])){ // we can add other actions with $_GET['do'] later. + if($_GET['do'] == "subscriptions"){ + require_once("subscriptions.php"); + } } else{ diff --git a/subscriptions.php b/subscriptions.php new file mode 100644 index 0000000..cd319d7 --- /dev/null +++ b/subscriptions.php @@ -0,0 +1,30 @@ +query("SELECT services.id, services.name, subscribers.subscriberID, subscribers.telegramID + FROM services + LEFT JOIN services_subscriber ON services_subscriber.serviceIDFK = services.id + LEFT JOIN subscribers ON services_subscriber.subscriberIDFK = subscribers.subscriberID + WHERE subscribers.telegramID =" . $tg_user['id']); +//$query = $mysqli->query("SELECT id, name FROM services"); +if ($query->num_rows){ + $timestamp = time(); + echo '

' . _("Your subscriptions") . "

"; + echo '"; +} +} else{ + header('Location: index.php'); +} + +Template::render_footer(); \ No newline at end of file diff --git a/template.php b/template.php index 57a2178..73cf67d 100644 --- a/template.php +++ b/template.php @@ -70,6 +70,7 @@ class Template{ Subscriptions'; echo '
  • Logout
  • '; } else { echo '
  • ';