-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
131 lines (109 loc) · 3.7 KB
/
index.php
File metadata and controls
131 lines (109 loc) · 3.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php
session_start();
require '../global/functions/apicalls.php';
require '../global/functions/irm.php';
require '../global/functions/telegram.php';
$config = require "../config.php";
require_once '../global/functions/header.php';
require_once '../global/functions/footer.php';
$menu = renderMenu();
$options['nav'] = $menu;
$options['title'] = "IRM | Record Library";
$header = getHeader($options);
echo $header;
$footer = renderFooter();
?>
<div class="topspacer"></div>
<main role="main">
<div class="container">
<?php
$tg_user = getTelegramUserData();
if ($tg_user !== false) {
$_SESSION['tgID'] = $tg_user['id'];
$irm_users = json_decode(getCall($config->api_url . "users?transform=1&filter=telegramID,eq," . $tg_user['id']), true);
foreach($irm_users['users'] as $user){
$irm_user['id'] = $user['userID'];
}
$_SESSION['irmID'] = $irm_user['id'];
saveSessionArray($tg_user);
$access = $_SESSION['access'];
if($access >=3){
$allIrmUsers = json_decode(getCall($config->api_url . "users?transform=1"),true);
?>
<h1>IRM-Record Library</h1>
<p class="desc">With this tool, you can manage your Record Library. Also you have access to your friends library</p>
<div class="card-deck">
<div class="card">
<div class="card-body">
<h5 class="card-title">My Library</h5>
<p class="card-text">Here you can manage your record library. This include view, edit and share your library with friends.</p>
<a href="library.php" class="btn btn-success">Open</a>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Wishlist</h5>
<p class="card-text">Manage your wishlist. You can share it with your friends.</p>
<!-- <a href="#" class="btn btn-success">Open</a> -->
<button type="button" class="btn btn-success" data-toggle="modal" data-target="#comingSoon">
Open
</button>
</div>
</div>
<div class="card">
<div class="card-body">
<h5 class="card-title">Friends library</h5>
<p class="card-text">View the library of your friends.</p>
<form class="form" method="POST" action="friend.php">
<div class="form-group ">
<label for="friend" class="sr-only">Select friend</label>
<select class="form-control" name="friend">
<?php
foreach($allIrmUsers['users'] as $irm_user){
echo '<option value="' . $irm_user['userID'] . '">' . $irm_user['firstname'] . ' ' . $irm_user['lastname'] . ' (' . $irm_user['tgusername'] . ')</option>';
}
?>
</select>
</div>
<div class="form-group">
<button type="submit" class="btn btn-success mb-2">View</button>
</div>
</form>
</div>
</div>
</div>
<div class="modal fade" id="comingSoon" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalLabel">Coming Soon</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
This feature is still in development.
</div>
<div class="modal-footer">
<button type="button" class="btn btn-success" data-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<?php
}
else {
echo '
<div class="alert alert-warning" role="alert">
<strong>Warning.</strong> You have no access to this page.
</div>
';
}
} else {
echo '
<div class="alert alert-danger" role="alert">
<strong>Error.</strong> You need to <a href="https://italianrockmafia.ch/login.php">login</a> first.
</div>
';
}
echo $footer;