Skip to content
Snippets Groups Projects
Commit 945a1425 authored by Addin Munawwar's avatar Addin Munawwar
Browse files

feat: add subscribe

parent 232fefd7
Branches dev
Tags v2
No related merge requests found
...@@ -38,7 +38,6 @@ ...@@ -38,7 +38,6 @@
$raw_data = file_get_contents("http://host.docker.internal:8040/api/curator-collection/$collectionId"); $raw_data = file_get_contents("http://host.docker.internal:8040/api/curator-collection/$collectionId");
$data = json_decode($raw_data, true); $data = json_decode($raw_data, true);
$books = $data['books']; $books = $data['books'];
echo json_encode($data);
require_once dirname(__DIR__) . '../../clients/SoapConsumer.php'; require_once dirname(__DIR__) . '../../clients/SoapConsumer.php';
$soap = new SoapConsumer(); $soap = new SoapConsumer();
...@@ -58,7 +57,7 @@ ...@@ -58,7 +57,7 @@
} }
$link = $subscribed ? '<a href="/premium/book/' . $book['book_id'] .'">Details</a>' : "Subscribe to view details"; $link = $subscribed ? '<a href="/premium/book/' . $book['book_id'] .'">Details</a>' : "Subscribe to view details";
foreach (($books) as $index => $book) { foreach (($books) as $index => $book) {
echo "<tr>"; echo "<tr>";
echo "<td>" . $index+1 . "</td>"; echo "<td>" . $index+1 . "</td>";
......
...@@ -37,12 +37,17 @@ ...@@ -37,12 +37,17 @@
// echo var_dump($data); // echo var_dump($data);
$collections = $data['found']; $collections = $data['found'];
$raw_data = file_get_contents("http://host.docker.internal:8040/api/curator-collection/$collection['collectionId']");
$data = json_decode($raw_data, true);
$books = $data['books'];
foreach ($collections as $collection) { foreach ($collections as $collection) {
echo "<tr>"; echo "<tr>";
echo "<td>" . $collection['collectionId'] . "</td>"; echo "<td>" . $collection['collectionId'] . "</td>";
echo "<td>" . $collection['createdBy'] . "</td>"; echo "<td>" . $collection['createdBy'] . "</td>";
echo '<td><a href="/premium/detail/' . $collection['collectionId'] .'">Details</a></td>'; echo '<td><a href="/premium/detail/' . $collection['collectionId'] .'">Details</a></td>';
echo '<td><a href="/premium/detail/' . $collection['collectionId'] .'">Subscribe</a></td>'; echo '<td><a href="/user/subs?curator=' . $books[0]["curator"] .'">Subscribe</a></td>';
echo "</tr>"; echo "</tr>";
} }
?> ?>
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment