Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1c13ea8d8 | ||
|
|
e899fb7f07 |
169
admin.php
Normal file
169
admin.php
Normal file
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// If not logged in, redirect to login page
|
||||
if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== true) {
|
||||
header('Location: admin_login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
// Handle logout
|
||||
if (isset($_GET['action']) && $_GET['action'] === 'logout') {
|
||||
$_SESSION = [];
|
||||
session_destroy();
|
||||
header('Location: admin_login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once 'db/config.php';
|
||||
|
||||
$user_count = 0;
|
||||
$playlist_count = 0;
|
||||
$content_count = 0;
|
||||
|
||||
try {
|
||||
$db = db();
|
||||
$user_count = $db->query('SELECT count(*) FROM users')->fetchColumn();
|
||||
$playlist_count = $db->query('SELECT count(*) FROM user_playlists')->fetchColumn();
|
||||
} catch (PDOException $e) {
|
||||
// DB connection error is handled gracefully
|
||||
}
|
||||
|
||||
if (file_exists('premium_content.json')) {
|
||||
$premium_content = json_decode(file_get_contents('premium_content.json'), true);
|
||||
$content_count = is_array($premium_content) ? count($premium_content) : 0;
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin Panel - gomoviz.asia</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<style>
|
||||
.sidebar {
|
||||
width: 280px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
background-color: #1E1E1E;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.main-content {
|
||||
margin-left: 280px;
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar d-flex flex-column p-3">
|
||||
<h3 class="text-white text-center mb-4">Admin Panel</h3>
|
||||
<ul class="nav nav-pills flex-column mb-auto">
|
||||
<li class="nav-item">
|
||||
<a href="admin.php" class="nav-link active text-white"><i class="bi bi-speedometer2 me-2"></i>Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_users.php" class="nav-link text-white"><i class="bi bi-people-fill me-2"></i>Users</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_content.php" class="nav-link text-white"><i class="bi bi-tv-fill me-2"></i>Premium Content</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_upload.php" class="nav-link text-white"><i class="bi bi-upload me-2"></i>Upload Channels</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_settings.php" class="nav-link text-white"><i class="bi bi-gear-fill me-2"></i>App Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<div class="dropdown">
|
||||
<a href="?action=logout" class="d-flex align-items-center text-white text-decoration-none">
|
||||
<i class="bi bi-box-arrow-right me-2"></i>
|
||||
<strong>Sign out</strong>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main class="main-content">
|
||||
<h1 class="mb-4">Dashboard</h1>
|
||||
<p class="lead">Welcome to the Admin Panel. Here you can manage your application.</p>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xl-3 col-md-6 mb-4">
|
||||
<div class="card text-white h-100" style="background-color: #007bff;">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-uppercase mb-1">Total Users</div>
|
||||
<div class="h5 mb-0 font-weight-bold"><?php echo $user_count; ?></div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-people-fill fs-2 text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3 col-md-6 mb-4">
|
||||
<div class="card text-white h-100" style="background-color: #28a745;">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-uppercase mb-1">Total Playlists</div>
|
||||
<div class="h5 mb-0 font-weight-bold"><?php echo $playlist_count; ?></div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-list-task fs-2 text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3 col-md-6 mb-4">
|
||||
<div class="card text-white h-100" style="background-color: #ffc107;">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-uppercase mb-1">Premium Content</div>
|
||||
<div class="h5 mb-0 font-weight-bold"><?php echo $content_count; ?></div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-star-fill fs-2 text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-xl-3 col-md-6 mb-4">
|
||||
<div class="card text-white h-100" style="background-color: #dc3545;">
|
||||
<div class="card-body">
|
||||
<div class="row no-gutters align-items-center">
|
||||
<div class="col mr-2">
|
||||
<div class="text-xs font-weight-bold text-uppercase mb-1">Site Settings</div>
|
||||
<div class="h5 mb-0 font-weight-bold">Manage</div>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<i class="bi bi-gear-fill fs-2 text-gray-300"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<a href="admin_settings.php" class="card-footer text-white clearfix small z-1">
|
||||
<span class="float-left">View Details</span>
|
||||
<span class="float-right"><i class="bi bi-arrow-right-circle-fill"></i></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
135
admin_content.php
Normal file
135
admin_content.php
Normal file
@ -0,0 +1,135 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== true) {
|
||||
header('Location: admin_login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$content_file = 'premium_content.json';
|
||||
$content = json_decode(file_get_contents($content_file), true);
|
||||
|
||||
// Handle Add/Edit/Delete
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
// Delete
|
||||
if (isset($_POST['delete'])) {
|
||||
$id_to_delete = intval($_POST['id']);
|
||||
$content = array_filter($content, function($item) use ($id_to_delete) {
|
||||
return $item['id'] !== $id_to_delete;
|
||||
});
|
||||
}
|
||||
// Add or Edit
|
||||
else {
|
||||
$id = intval($_POST['id']);
|
||||
$new_item = [
|
||||
'id' => $id === 0 ? time() : $id, // new id for new items
|
||||
'title' => $_POST['title'],
|
||||
'category' => $_POST['category'],
|
||||
'poster_url' => $_POST['poster_url'],
|
||||
'stream_url' => $_POST['stream_url'],
|
||||
];
|
||||
|
||||
if ($id === 0) { // Add
|
||||
$content[] = $new_item;
|
||||
} else { // Edit
|
||||
foreach ($content as &$item) {
|
||||
if ($item['id'] === $id) {
|
||||
$item = $new_item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
file_put_contents($content_file, json_encode(array_values($content), JSON_PRETTY_PRINT));
|
||||
header('Location: admin_content.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$edit_item = null;
|
||||
if (isset($_GET['edit'])) {
|
||||
$id_to_edit = intval($_GET['edit']);
|
||||
foreach ($content as $item) {
|
||||
if ($item['id'] === $id_to_edit) {
|
||||
$edit_item = $item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Premium Content - Admin Panel</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<style>
|
||||
.sidebar { width: 280px; position: fixed; top: 0; left: 0; height: 100vh; background-color: #1E1E1E; padding-top: 20px; }
|
||||
.main-content { margin-left: 280px; padding: 20px; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar d-flex flex-column p-3">
|
||||
<h3 class="text-white text-center mb-4">Admin Panel</h3>
|
||||
<ul class="nav nav-pills flex-column mb-auto">
|
||||
<li class="nav-item"><a href="admin.php" class="nav-link text-white"><i class="bi bi-speedometer2 me-2"></i>Dashboard</a></li>
|
||||
<li><a href="admin_users.php" class="nav-link text-white"><i class="bi bi-people-fill me-2"></i>Users</a></li>
|
||||
<li><a href="admin_content.php" class="nav-link active text-white"><i class="bi bi-tv-fill me-2"></i>Premium Content</a></li>
|
||||
<li><a href="admin_settings.php" class="nav-link text-white"><i class="bi bi-gear-fill me-2"></i>App Settings</a></li>
|
||||
</ul>
|
||||
<hr>
|
||||
<a href="admin.php?action=logout" class="d-flex align-items-center text-white text-decoration-none"><i class="bi bi-box-arrow-right me-2"></i><strong>Sign out</strong></a>
|
||||
</div>
|
||||
|
||||
<main class="main-content">
|
||||
<h1 class="mb-4">Premium Content</h1>
|
||||
|
||||
<div class="card form-card mb-4">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title"><?php echo $edit_item ? 'Edit' : 'Add'; ?> Content</h5>
|
||||
<form method="POST" action="admin_content.php">
|
||||
<input type="hidden" name="id" value="<?php echo $edit_item['id'] ?? 0; ?>">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6"><label class="form-label">Title</label><input type="text" class="form-control" name="title" value="<?php echo htmlspecialchars($edit_item['title'] ?? ''); ?>" required></div>
|
||||
<div class="col-md-6"><label class="form-label">Category</label><input type="text" class="form-control" name="category" value="<?php echo htmlspecialchars($edit_item['category'] ?? ''); ?>" required></div>
|
||||
</div>
|
||||
<div class="mb-3"><label class="form-label">Poster URL</label><input type="url" class="form-control" name="poster_url" value="<?php echo htmlspecialchars($edit_item['poster_url'] ?? ''); ?>" required></div>
|
||||
<div class="mb-3"><label class="form-label">Stream URL</label><input type="url" class="form-control" name="stream_url" value="<?php echo htmlspecialchars($edit_item['stream_url'] ?? ''); ?>" required></div>
|
||||
<button type="submit" class="btn btn-primary"><?php echo $edit_item ? 'Save Changes' : 'Add Content'; ?></button>
|
||||
<?php if ($edit_item): ?><a href="admin_content.php" class="btn btn-secondary">Cancel Edit</a><?php endif; ?>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card form-card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Content Library</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-dark table-striped">
|
||||
<thead><tr><th>Title</th><th>Category</th><th>Actions</th></tr></thead>
|
||||
<tbody>
|
||||
<?php foreach ($content as $item): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($item['title']); ?></td>
|
||||
<td><?php echo htmlspecialchars($item['category']); ?></td>
|
||||
<td>
|
||||
<a href="?edit=<?php echo $item['id']; ?>" class="btn btn-sm btn-primary"><i class="bi bi-pencil-fill"></i></a>
|
||||
<form method="POST" action="admin_content.php" onsubmit="return confirm('Are you sure you want to delete this item?');" style="display: inline-block;">
|
||||
<input type="hidden" name="id" value="<?php echo $item['id']; ?>">
|
||||
<button type="submit" name="delete" class="btn btn-sm btn-danger"><i class="bi bi-trash-fill"></i></button>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
62
admin_login.php
Normal file
62
admin_login.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
// If already logged in, redirect to admin panel
|
||||
if (isset($_SESSION['admin_logged_in']) && $_SESSION['admin_logged_in'] === true) {
|
||||
header('Location: admin.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
// Hardcoded password for simplicity. In a real app, use a secure, hashed password.
|
||||
$admin_password = 'deep1'; // Same as the premium access code for now
|
||||
|
||||
$error = '';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
if (!empty($_POST['password']) && $_POST['password'] === $admin_password) {
|
||||
$_SESSION['admin_logged_in'] = true;
|
||||
header('Location: admin.php');
|
||||
exit;
|
||||
} else {
|
||||
$error = 'Invalid password. Please try again.';
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin Login - gomoviz.asia</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<style>
|
||||
body {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
height: 100vh;
|
||||
}
|
||||
.login-card {
|
||||
width: 100%;
|
||||
max-width: 400px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="card form-card login-card">
|
||||
<div class="card-body p-4 p-md-5">
|
||||
<h2 class="text-center mb-4">Admin Login</h2>
|
||||
<form method="POST" action="admin_login.php">
|
||||
<div class="mb-3">
|
||||
<label for="password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="password" name="password" required>
|
||||
</div>
|
||||
<?php if ($error): ?>
|
||||
<div class="alert alert-danger"><?php echo $error; ?></div>
|
||||
<?php endif; ?>
|
||||
<button type="submit" class="btn btn-primary w-100">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
155
admin_settings.php
Normal file
155
admin_settings.php
Normal file
@ -0,0 +1,155 @@
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== true) {
|
||||
header('Location: admin_login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$settings_file = 'settings.json';
|
||||
$settings = json_decode(file_get_contents($settings_file), true);
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
echo '<pre>POST data: ';
|
||||
print_r($_POST);
|
||||
echo '</pre>';
|
||||
|
||||
$settings['trial_duration_public'] = intval($_POST['trial_duration_public']);
|
||||
$settings['trial_duration_premium'] = intval($_POST['trial_duration_premium']);
|
||||
$settings['public_price_monthly'] = floatval($_POST['public_price_monthly']);
|
||||
$settings['premium_price_monthly'] = floatval($_POST['premium_price_monthly']);
|
||||
$settings['public_price_yearly'] = floatval($_POST['public_price_yearly']);
|
||||
$settings['premium_price_yearly'] = floatval($_POST['premium_price_yearly']);
|
||||
|
||||
echo '<pre>Settings to save: ';
|
||||
print_r($settings);
|
||||
echo '</pre>';
|
||||
|
||||
if (is_writable($settings_file)) {
|
||||
echo '<p>settings.json is writable.</p>';
|
||||
} else {
|
||||
echo '<p>settings.json is NOT writable.</p>';
|
||||
}
|
||||
|
||||
$result = file_put_contents($settings_file, json_encode($settings, JSON_PRETTY_PRINT));
|
||||
|
||||
if ($result === false) {
|
||||
echo '<p>Error saving settings!</p>';
|
||||
$error = error_get_last();
|
||||
if ($error) {
|
||||
echo '<pre>Error details: ';
|
||||
print_r($error);
|
||||
echo '</pre>';
|
||||
}
|
||||
} else {
|
||||
echo '<p>Settings saved successfully.</p>';
|
||||
header('Location: admin_settings.php?success=1');
|
||||
exit;
|
||||
}
|
||||
exit; // Stop execution to see debug output
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>App Settings - Admin Panel</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<style>
|
||||
.sidebar {
|
||||
width: 280px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
background-color: #1E1E1E;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.main-content {
|
||||
margin-left: 280px;
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar d-flex flex-column p-3">
|
||||
<h3 class="text-white text-center mb-4">Admin Panel</h3>
|
||||
<ul class="nav nav-pills flex-column mb-auto">
|
||||
<li class="nav-item">
|
||||
<a href="admin.php" class="nav-link text-white"><i class="bi bi-speedometer2 me-2"></i>Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_users.php" class="nav-link text-white"><i class="bi bi-people-fill me-2"></i>Users</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_content.php" class="nav-link text-white"><i class="bi bi-tv-fill me-2"></i>Premium Content</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_settings.php" class="nav-link active text-white"><i class="bi bi-gear-fill me-2"></i>App Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<div class="dropdown">
|
||||
<a href="admin.php?action=logout" class="d-flex align-items-center text-white text-decoration-none">
|
||||
<i class="bi bi-box-arrow-right me-2"></i>
|
||||
<strong>Sign out</strong>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main class="main-content">
|
||||
<h1 class="mb-4">App Settings</h1>
|
||||
|
||||
<?php if (isset($_GET['success'])): ?>
|
||||
<div class="alert alert-success">Settings saved successfully.</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card form-card">
|
||||
<div class="card-body">
|
||||
<form method="POST" action="admin_settings.php">
|
||||
<h4 class="mb-3">Trial Durations (in days)</h4>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="trial_duration_public" class="form-label">Public Trial</label>
|
||||
<input type="number" class="form-control" id="trial_duration_public" name="trial_duration_public" value="<?php echo $settings['trial_duration_public']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="trial_duration_premium" class="form-label">Premium Trial</label>
|
||||
<input type="number" class="form-control" id="trial_duration_premium" name="trial_duration_premium" value="<?php echo $settings['trial_duration_premium']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h4 class="mb-3">Subscription Pricing ($)</h4>
|
||||
<div class="row mb-3">
|
||||
<div class="col-md-6">
|
||||
<label for="public_price_monthly" class="form-label">Public - Monthly</label>
|
||||
<input type="text" class="form-control" id="public_price_monthly" name="public_price_monthly" value="<?php echo $settings['public_price_monthly']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="public_price_yearly" class="form-label">Public - Yearly</label>
|
||||
<input type="text" class="form-control" id="public_price_yearly" name="public_price_yearly" value="<?php echo $settings['public_price_yearly']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-4">
|
||||
<div class="col-md-6">
|
||||
<label for="premium_price_monthly" class="form-label">Premium - Monthly</label>
|
||||
<input type="text" class="form-control" id="premium_price_monthly" name="premium_price_monthly" value="<?php echo $settings['premium_price_monthly']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="premium_price_yearly" class="form-label">Premium - Yearly</label>
|
||||
<input type="text" class="form-control" id="premium_price_yearly" name="premium_price_yearly" value="<?php echo $settings['premium_price_yearly']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<button type="submit" class="btn btn-primary">Save Settings</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
169
admin_upload.php
Normal file
169
admin_upload.php
Normal file
@ -0,0 +1,169 @@
|
||||
<?php
|
||||
session_start();
|
||||
// Dummy authentication check - replace with your actual login check
|
||||
if (!isset($_SESSION['is_admin']) || !$_SESSION['is_admin']) {
|
||||
// header('Location: admin_login.php');
|
||||
// die('Access Denied. You must be logged in as an admin.');
|
||||
}
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
function parse_m3u_attributes($info_line) {
|
||||
$attributes = [];
|
||||
// Extract the part of the string that contains the attributes
|
||||
preg_match_all('/ (\w+-.+?)="(.+?)"/', $info_line, $matches, PREG_SET_ORDER);
|
||||
foreach ($matches as $match) {
|
||||
$attributes[$match[1]] = $match[2];
|
||||
}
|
||||
// Get the title from the last part of the line
|
||||
$parts = explode(',', $info_line);
|
||||
$title = trim(end($parts));
|
||||
if ($title) {
|
||||
$attributes['title'] = $title;
|
||||
}
|
||||
return $attributes;
|
||||
}
|
||||
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['channels_file'])) {
|
||||
$file = $_FILES['channels_file'];
|
||||
$overwrite = isset($_POST['overwrite']);
|
||||
|
||||
if ($file['error'] === UPLOAD_ERR_OK) {
|
||||
$filename = $file['tmp_name'];
|
||||
$content = file_get_contents($filename);
|
||||
$lines = explode(PHP_EOL, $content);
|
||||
$new_channels = [];
|
||||
$malformed_entries = 0;
|
||||
|
||||
if (strpos(trim($lines[0]), '#EXTM3U') !== 0) {
|
||||
$error = 'Invalid M3U file. The file must start with #EXTM3U.';
|
||||
} else {
|
||||
for ($i = 0; $i < count($lines); $i++) {
|
||||
$line = trim($lines[$i]);
|
||||
if (strpos($line, '#EXTINF') === 0) {
|
||||
$attributes = parse_m3u_attributes($line);
|
||||
$stream_url = isset($lines[$i + 1]) ? trim($lines[$i + 1]) : '';
|
||||
|
||||
if (!empty($stream_url) && !empty($attributes['title'])) {
|
||||
$new_channels[] = [
|
||||
'title' => $attributes['title'],
|
||||
'category' => $attributes['group-title'] ?? 'General',
|
||||
'poster_url' => $attributes['tvg-logo'] ?? '',
|
||||
'stream_url' => $stream_url,
|
||||
];
|
||||
$i++; // Skip the next line as it's the URL
|
||||
} else {
|
||||
$malformed_entries++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($new_channels)) {
|
||||
$content_file = 'premium_content.json';
|
||||
$existing_channels = [];
|
||||
if (!$overwrite && file_exists($content_file)) {
|
||||
$existing_content = json_decode(file_get_contents($content_file), true);
|
||||
if (is_array($existing_content)) {
|
||||
$existing_channels = $existing_content;
|
||||
}
|
||||
}
|
||||
|
||||
$last_id = 0;
|
||||
if (!empty($existing_channels)) {
|
||||
$last_item = end($existing_channels);
|
||||
$last_id = $last_item['id'] ?? 0;
|
||||
}
|
||||
|
||||
foreach($new_channels as &$channel) {
|
||||
$last_id++;
|
||||
$channel['id'] = $last_id;
|
||||
}
|
||||
|
||||
$all_channels = array_merge($existing_channels, $new_channels);
|
||||
|
||||
if (json_encode($all_channels, JSON_PRETTY_PRINT)) {
|
||||
file_put_contents($content_file, json_encode($all_channels, JSON_PRETTY_PRINT));
|
||||
$message = 'Successfully uploaded and processed ' . count($new_channels) . ' new channels.';
|
||||
if ($malformed_entries > 0) {
|
||||
$error = $malformed_entries . ' entries in your file were malformed and could not be imported.';
|
||||
}
|
||||
} else {
|
||||
$error = 'Failed to encode data to JSON. Check for special characters.';
|
||||
}
|
||||
|
||||
} else {
|
||||
$error = 'No valid channel data found in the uploaded M3U file.';
|
||||
if ($malformed_entries > 0) {
|
||||
$error .= ' All entries appear to be malformed.';
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$error = 'File upload failed with error code: ' . $file['error'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Admin - Upload M3U Playlist</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg bg-dark navbar-dark">
|
||||
<div class="container">
|
||||
<a class="navbar-brand" href="admin.php">Admin Panel</a>
|
||||
<div class="collapse navbar-collapse">
|
||||
<ul class="navbar-nav">
|
||||
<li class="nav-item"><a class="nav-link" href="admin_users.php">Users</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="admin_content.php">Content</a></li>
|
||||
<li class="nav-item"><a class="nav-link active" href="admin_upload.php">Upload</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="admin_settings.php">Settings</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container mt-5">
|
||||
<h1 class="mb-4">Upload Premium Channels</h1>
|
||||
|
||||
<?php if ($message): ?>
|
||||
<div class="alert alert-success"><?php echo $message; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($error): ?>
|
||||
<div class="alert alert-danger"><?php echo $error; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Upload an M3U Playlist File</h5>
|
||||
<p class="card-text">
|
||||
The file should be a valid M3U playlist (starting with <code>#EXTM3U</code>). The parser will attempt to extract channel information from <code>#EXTINF</code> lines.
|
||||
</p>
|
||||
<form action="admin_upload.php" method="post" enctype="multipart/form-data">
|
||||
<div class="mb-3">
|
||||
<label for="channels_file" class="form-label">M3U Playlist File (.m3u, .m3u8)</label>
|
||||
<input class="form-control" type="file" id="channels_file" name="channels_file" accept=".m3u,.m3u8,.txt" required>
|
||||
</div>
|
||||
<div class="mb-3 form-check">
|
||||
<input type="checkbox" class="form-check-input" id="overwrite" name="overwrite">
|
||||
<label class="form-check-label" for="overwrite">Overwrite existing channels</label>
|
||||
<small class="form-text text-muted d-block">If checked, all current premium channels will be replaced by the ones in this file. If unchecked, new channels will be added to the existing list.</small>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary">Upload</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mt-4">
|
||||
<a href="admin.php" class="btn btn-secondary">Back to Admin</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
117
admin_users.php
Normal file
117
admin_users.php
Normal file
@ -0,0 +1,117 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once 'db/config.php';
|
||||
|
||||
if (!isset($_SESSION['admin_logged_in']) || $_SESSION['admin_logged_in'] !== true) {
|
||||
header('Location: admin_login.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$users = [];
|
||||
try {
|
||||
$db = db();
|
||||
$stmt = $db->query('SELECT id, username, created_at FROM users ORDER BY created_at DESC');
|
||||
$users = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
} catch (PDOException $e) {
|
||||
$error = "Error fetching users: " . $e->getMessage();
|
||||
}
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>User Management - Admin</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<style>
|
||||
.sidebar {
|
||||
width: 280px;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
height: 100vh;
|
||||
background-color: #1E1E1E;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.main-content {
|
||||
margin-left: 280px;
|
||||
padding: 20px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="sidebar d-flex flex-column p-3">
|
||||
<h3 class="text-white text-center mb-4">Admin Panel</h3>
|
||||
<ul class="nav nav-pills flex-column mb-auto">
|
||||
<li class="nav-item">
|
||||
<a href="admin.php" class="nav-link text-white"><i class="bi bi-speedometer2 me-2"></i>Dashboard</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_users.php" class="nav-link active text-white"><i class="bi bi-people-fill me-2"></i>Users</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_content.php" class="nav-link text-white"><i class="bi bi-tv-fill me-2"></i>Premium Content</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="admin_settings.php" class="nav-link text-white"><i class="bi bi-gear-fill me-2"></i>App Settings</a>
|
||||
</li>
|
||||
</ul>
|
||||
<hr>
|
||||
<div class="dropdown">
|
||||
<a href="?action=logout" class="d-flex align-items-center text-white text-decoration-none">
|
||||
<i class="bi bi-box-arrow-right me-2"></i>
|
||||
<strong>Sign out</strong>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<main class="main-content">
|
||||
<h1 class="mb-4">User Management</h1>
|
||||
|
||||
<?php if (isset($error)): ?>
|
||||
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Registered Users</h5>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>Username</th>
|
||||
<th>Registration Date</th>
|
||||
<th>Actions</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (empty($users)): ?>
|
||||
<tr>
|
||||
<td colspan="4" class="text-center">No users found.</td>
|
||||
</tr>
|
||||
<?php else: ?>
|
||||
<?php foreach ($users as $user): ?>
|
||||
<tr>
|
||||
<td><?php echo htmlspecialchars($user['id']); ?></td>
|
||||
<td><?php echo htmlspecialchars($user['username']); ?></td>
|
||||
<td><?php echo htmlspecialchars($user['created_at']); ?></td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-primary disabled" title="Coming Soon"><i class="bi bi-pencil-fill"></i></button>
|
||||
<button class="btn btn-sm btn-danger disabled" title="Coming Soon"><i class="bi bi-trash-fill"></i></button>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
88
assets/css/custom.css
Normal file
88
assets/css/custom.css
Normal file
@ -0,0 +1,88 @@
|
||||
body {
|
||||
background-color: #121212;
|
||||
color: #E0E0E0;
|
||||
font-family: 'Poppins', sans-serif;
|
||||
}
|
||||
|
||||
.navbar-brand, .nav-link, .card-title, h1, h2, h3, h4, h5, h6 {
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
background-color: #1E1E1E;
|
||||
}
|
||||
|
||||
.bottom-nav {
|
||||
background-color: #1E1E1E;
|
||||
border-top: 1px solid #333;
|
||||
}
|
||||
|
||||
.bottom-nav .nav-link {
|
||||
color: #E0E0E0;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.bottom-nav .nav-link.active,
|
||||
.bottom-nav .nav-link:hover {
|
||||
color: #00AEEF;
|
||||
}
|
||||
|
||||
.search-bar, .form-control {
|
||||
background-color: #2F2F2F;
|
||||
border: 1px solid #444;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
.search-bar::placeholder, .form-control::placeholder {
|
||||
color: #888;
|
||||
}
|
||||
|
||||
.form-control:focus {
|
||||
background-color: #2F2F2F;
|
||||
border-color: #00AEEF;
|
||||
color: #FFFFFF;
|
||||
box-shadow: 0 0 0 0.25rem rgba(0, 174, 239, 0.25);
|
||||
}
|
||||
|
||||
.form-card {
|
||||
background-color: #1E1E1E;
|
||||
border: 1px solid #333;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.category-card {
|
||||
background-color: #1E1E1E;
|
||||
border: 1px solid #333;
|
||||
border-radius: 0.5rem;
|
||||
transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.category-card:hover {
|
||||
transform: translateY(-5px);
|
||||
box-shadow: 0 8px 25px rgba(0, 174, 239, 0.2);
|
||||
border-color: #00AEEF;
|
||||
}
|
||||
|
||||
.category-card .card-body {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.playlist-card {
|
||||
background-color: #1E1E1E;
|
||||
border: 1px solid #333;
|
||||
border-radius: 0.5rem;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background-color: #00AEEF;
|
||||
border-color: #00AEEF;
|
||||
transition: background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background-color: #008fbf;
|
||||
border-color: #008fbf;
|
||||
}
|
||||
|
||||
.accent-text {
|
||||
color: #00AEEF;
|
||||
}
|
||||
BIN
assets/img/icon-192.png
Normal file
BIN
assets/img/icon-192.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 293 B |
BIN
assets/img/icon-512.png
Normal file
BIN
assets/img/icon-512.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 319 B |
228
assets/js/main.js
Normal file
228
assets/js/main.js
Normal file
@ -0,0 +1,228 @@
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const searchInput = document.getElementById('mainSearch');
|
||||
if (searchInput) {
|
||||
searchInput.addEventListener('keypress', function(e) {
|
||||
if (e.key === 'Enter') {
|
||||
e.preventDefault();
|
||||
if (searchInput.value.trim().toLowerCase() === 'deep1') {
|
||||
window.location.href = 'premium.php';
|
||||
} else {
|
||||
alert('Searching for: ' + searchInput.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// --- AUTHENTICATION ---
|
||||
const authButtons = document.getElementById('auth-buttons');
|
||||
const userGreeting = document.getElementById('user-greeting');
|
||||
const loginForm = document.getElementById('login-form');
|
||||
const signupForm = document.getElementById('signup-form');
|
||||
const loginModal = new bootstrap.Modal(document.getElementById('loginModal'));
|
||||
const signupModal = new bootstrap.Modal(document.getElementById('signupModal'));
|
||||
const loginError = document.getElementById('login-error');
|
||||
const signupError = document.getElementById('signup-error');
|
||||
let isLoggedIn = false;
|
||||
|
||||
async function checkAuth() {
|
||||
try {
|
||||
const response = await fetch('auth.php', {
|
||||
method: 'POST',
|
||||
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
|
||||
body: 'action=check_auth'
|
||||
});
|
||||
const result = await response.json();
|
||||
isLoggedIn = result.loggedIn;
|
||||
if (isLoggedIn) {
|
||||
authButtons.classList.add('d-none');
|
||||
userGreeting.innerHTML = `Welcome, ${escapeHTML(result.email)} <button id="logout-button" class="btn btn-sm btn-outline-secondary ms-2">Logout</button>`;
|
||||
userGreeting.classList.remove('d-none');
|
||||
} else {
|
||||
authButtons.classList.remove('d-none');
|
||||
userGreeting.classList.add('d-none');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('Auth check failed', error);
|
||||
}
|
||||
await renderPlaylists();
|
||||
}
|
||||
|
||||
if(loginForm) {
|
||||
loginForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
loginError.textContent = '';
|
||||
const response = await fetch('auth.php', {
|
||||
method: 'POST',
|
||||
body: new URLSearchParams({action: 'login', email: document.getElementById('login-email').value, password: document.getElementById('login-password').value})
|
||||
});
|
||||
const result = await response.json();
|
||||
if (result.success) {
|
||||
loginModal.hide();
|
||||
await checkAuth();
|
||||
} else {
|
||||
loginError.textContent = result.message;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(signupForm) {
|
||||
signupForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
signupError.textContent = '';
|
||||
const response = await fetch('auth.php', {
|
||||
method: 'POST',
|
||||
body: new URLSearchParams({action: 'register', email: document.getElementById('signup-email').value, password: document.getElementById('signup-password').value})
|
||||
});
|
||||
const result = await response.json();
|
||||
if (result.success) {
|
||||
signupModal.hide();
|
||||
await checkAuth();
|
||||
} else {
|
||||
signupError.textContent = result.message;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
userGreeting.addEventListener('click', async (e) => {
|
||||
if (e.target.id === 'logout-button') {
|
||||
await fetch('auth.php', { method: 'POST', headers: {'Content-Type': 'application/x-www-form-urlencoded'}, body: 'action=logout' });
|
||||
isLoggedIn = false;
|
||||
checkAuth();
|
||||
}
|
||||
});
|
||||
|
||||
// --- END AUTHENTICATION ---
|
||||
|
||||
const navLinks = {
|
||||
home: document.getElementById('nav-home'),
|
||||
playlists: document.getElementById('nav-playlists'),
|
||||
settings: document.getElementById('nav-settings'),
|
||||
help: document.getElementById('nav-help'),
|
||||
};
|
||||
|
||||
const sections = {
|
||||
home: document.getElementById('home-section'),
|
||||
playlists: document.getElementById('playlists-section'),
|
||||
};
|
||||
|
||||
function navigateTo(sectionName) {
|
||||
Object.values(sections).forEach(section => {
|
||||
if (section) section.style.display = 'none';
|
||||
});
|
||||
if (sections[sectionName]) {
|
||||
sections[sectionName].style.display = 'block';
|
||||
}
|
||||
Object.values(navLinks).forEach(link => {
|
||||
if(link) link.classList.remove('active');
|
||||
});
|
||||
if (navLinks[sectionName]) {
|
||||
navLinks[sectionName].classList.add('active');
|
||||
}
|
||||
}
|
||||
|
||||
if(navLinks.home) navLinks.home.addEventListener('click', (e) => { e.preventDefault(); navigateTo('home'); });
|
||||
if(navLinks.playlists) navLinks.playlists.addEventListener('click', (e) => { e.preventDefault(); navigateTo('playlists'); });
|
||||
if(navLinks.settings) navLinks.settings.addEventListener('click', (e) => { e.preventDefault(); alert('Settings page is not yet implemented.'); });
|
||||
if(navLinks.help) navLinks.help.addEventListener('click', (e) => { e.preventDefault(); alert('Help page is not yet implemented.'); });
|
||||
|
||||
// --- PLAYLISTS ---
|
||||
const playlistForm = document.getElementById('add-playlist-form');
|
||||
const playlistsList = document.getElementById('playlists-list');
|
||||
|
||||
// Local Storage Functions
|
||||
const getLocalPlaylists = () => JSON.parse(localStorage.getItem('user_playlists')) || [];
|
||||
const saveLocalPlaylists = (playlists) => localStorage.setItem('user_playlists', JSON.stringify(playlists));
|
||||
|
||||
async function renderPlaylists() {
|
||||
playlistsList.innerHTML = '<p class="text-white-50">Loading...</p>';
|
||||
let playlists = [];
|
||||
if (isLoggedIn) {
|
||||
const response = await fetch('playlist_manager.php?action=get');
|
||||
playlists = await response.json();
|
||||
} else {
|
||||
playlists = getLocalPlaylists();
|
||||
}
|
||||
|
||||
playlistsList.innerHTML = '';
|
||||
if (playlists.length === 0) {
|
||||
playlistsList.innerHTML = '<p class="text-white-50">Your added playlists will appear here.</p>';
|
||||
if (!isLoggedIn) {
|
||||
playlistsList.innerHTML += '<p class="text-white-50">Sign up to save your playlists to your account.</p>';
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
playlists.forEach((playlist, index) => {
|
||||
const playlistEl = document.createElement('div');
|
||||
playlistEl.className = 'card playlist-card mb-3';
|
||||
const playlistId = isLoggedIn ? playlist.id : index;
|
||||
playlistEl.innerHTML = `
|
||||
<div class="card-body d-flex justify-content-between align-items-center">
|
||||
<div>
|
||||
<h5 class="card-title mb-1">${escapeHTML(playlist.name)}</h5>
|
||||
<p class="card-text text-white-50 text-truncate" style="max-width: 200px;">${escapeHTML(playlist.url)}</p>
|
||||
</div>
|
||||
<div>
|
||||
<button class="btn btn-sm btn-primary play-playlist" data-url="${escapeHTML(playlist.url)}"><i class="bi bi-play-fill"></i></button>
|
||||
<button class="btn btn-sm btn-outline-danger delete-playlist" data-id="${playlistId}"><i class="bi bi-trash-fill"></i></button>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
playlistsList.appendChild(playlistEl);
|
||||
});
|
||||
}
|
||||
|
||||
if (playlistForm) {
|
||||
playlistForm.addEventListener('submit', async function(e) {
|
||||
e.preventDefault();
|
||||
const name = document.getElementById('playlist-name').value;
|
||||
const url = document.getElementById('playlist-url').value;
|
||||
|
||||
if (isLoggedIn) {
|
||||
await fetch('playlist_manager.php', {
|
||||
method: 'POST',
|
||||
body: new URLSearchParams({action: 'add', name, url})
|
||||
});
|
||||
} else {
|
||||
const playlists = getLocalPlaylists();
|
||||
playlists.push({ name, url });
|
||||
saveLocalPlaylists(playlists);
|
||||
}
|
||||
|
||||
renderPlaylists();
|
||||
playlistForm.reset();
|
||||
});
|
||||
}
|
||||
|
||||
playlistsList.addEventListener('click', async function(e) {
|
||||
const playButton = e.target.closest('.play-playlist');
|
||||
const deleteButton = e.target.closest('.delete-playlist');
|
||||
|
||||
if (playButton) {
|
||||
window.location.href = `player.php?url=${encodeURIComponent(playButton.dataset.url)}`;
|
||||
}
|
||||
|
||||
if (deleteButton) {
|
||||
const id = deleteButton.dataset.id;
|
||||
if (isLoggedIn) {
|
||||
await fetch('playlist_manager.php', {
|
||||
method: 'POST',
|
||||
body: new URLSearchParams({action: 'delete', id})
|
||||
});
|
||||
} else {
|
||||
let playlists = getLocalPlaylists();
|
||||
playlists.splice(id, 1);
|
||||
saveLocalPlaylists(playlists);
|
||||
}
|
||||
renderPlaylists();
|
||||
}
|
||||
});
|
||||
|
||||
checkAuth();
|
||||
});
|
||||
|
||||
function escapeHTML(str) {
|
||||
var p = document.createElement("p");
|
||||
p.appendChild(document.createTextNode(str));
|
||||
return p.innerHTML;
|
||||
}
|
||||
91
auth.php
Normal file
91
auth.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
$action = $_POST['action'] ?? '';
|
||||
|
||||
if ($action === 'register') {
|
||||
$email = $_POST['email'] ?? '';
|
||||
$password = $_POST['password'] ?? '';
|
||||
|
||||
if (empty($email) || empty($password) || !filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
echo json_encode(['success' => false, 'message' => 'Invalid email or password.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT id FROM users WHERE email = ?");
|
||||
$stmt->execute([$email]);
|
||||
if ($stmt->fetch()) {
|
||||
echo json_encode(['success' => false, 'message' => 'User with this email already exists.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$password_hash = password_hash($password, PASSWORD_DEFAULT);
|
||||
|
||||
// Get trial duration from settings
|
||||
$settings = json_decode(file_get_contents('settings.json'), true);
|
||||
$trial_days = $settings['trial_duration_public'] ?? 2;
|
||||
$trial_ends_at = date('Y-m-d H:i:s', strtotime("+{$trial_days} days"));
|
||||
|
||||
$stmt = $pdo->prepare("INSERT INTO users (email, password, trial_ends_at) VALUES (?, ?, ?)");
|
||||
$stmt->execute([$email, $password_hash, $trial_ends_at]);
|
||||
$user_id = $pdo->lastInsertId();
|
||||
|
||||
$_SESSION['user_id'] = $user_id;
|
||||
$_SESSION['user_email'] = $email;
|
||||
echo json_encode(['success' => true]);
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Database error.']);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action === 'login') {
|
||||
$email = $_POST['email'] ?? '';
|
||||
$password = $_POST['password'] ?? '';
|
||||
|
||||
if (empty($email) || empty($password)) {
|
||||
echo json_encode(['success' => false, 'message' => 'Email and password are required.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
$stmt = $pdo->prepare("SELECT * FROM users WHERE email = ?");
|
||||
$stmt->execute([$email]);
|
||||
$user = $stmt->fetch();
|
||||
|
||||
if ($user && password_verify($password, $user['password'])) {
|
||||
$_SESSION['user_id'] = $user['id'];
|
||||
$_SESSION['user_email'] = $user['email'];
|
||||
echo json_encode(['success' => true]);
|
||||
} else {
|
||||
echo json_encode(['success' => false, 'message' => 'Invalid email or password.']);
|
||||
}
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(['success' => false, 'message' => 'Database error.']);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action === 'logout') {
|
||||
session_destroy();
|
||||
echo json_encode(['success' => true]);
|
||||
exit;
|
||||
}
|
||||
|
||||
if ($action === 'check_auth') {
|
||||
if (isset($_SESSION['user_id'])) {
|
||||
echo json_encode(['loggedIn' => true, 'email' => $_SESSION['user_email']]);
|
||||
} else {
|
||||
echo json_encode(['loggedIn' => false]);
|
||||
}
|
||||
exit;
|
||||
}
|
||||
|
||||
echo json_encode(['success' => false, 'message' => 'Invalid action.']);
|
||||
115
help.php
Normal file
115
help.php
Normal file
@ -0,0 +1,115 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/mail/MailService.php';
|
||||
|
||||
$message = '';
|
||||
$error = '';
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$name = trim($_POST['name']);
|
||||
$email = trim($_POST['email']);
|
||||
$form_message = trim($_POST['message']);
|
||||
|
||||
if (empty($name) || empty($email) || empty($form_message)) {
|
||||
$error = 'Please fill in all fields.';
|
||||
} elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {
|
||||
$error = 'Invalid email format.';
|
||||
} else {
|
||||
$to = getenv('MAIL_TO') ?: 'support@example.com'; // Fallback admin email
|
||||
$subject = "New Contact Form Message from {$name}";
|
||||
|
||||
$res = MailService::sendContactMessage($name, $email, $form_message, $to, $subject);
|
||||
|
||||
if (!empty($res['success'])) {
|
||||
$message = 'Your message has been sent successfully!';
|
||||
} else {
|
||||
$error = 'Failed to send message. Please try again later. Error: ' . ($res['error'] ?? 'Unknown Error');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$is_logged_in = isset($_SESSION['user_id']);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Help & Contact - gomoviz.asia</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
</head>
|
||||
<body>
|
||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" href="index.php"><i class="bi bi-film"></i> gomoviz.asia</a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation"><span class="navbar-toggler-icon"></span></button>
|
||||
<div class="collapse navbar-collapse" id="navbarNav">
|
||||
<ul class="navbar-nav ms-auto">
|
||||
<li class="nav-item"><a class="nav-link" href="index.php">Home</a></li>
|
||||
<li class="nav-item"><a class="nav-link active" href="help.php">Help</a></li>
|
||||
<?php if ($is_logged_in): ?>
|
||||
<li class="nav-item dropdown">
|
||||
<a class="nav-link dropdown-toggle" href="#" id="userDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false"><i class="bi bi-person-circle"></i> <span id="username-display"></span></a>
|
||||
<ul class="dropdown-menu dropdown-menu-dark" aria-labelledby="userDropdown">
|
||||
<li><a class="dropdown-item" href="#" id="logout-btn">Logout</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
<?php else: ?>
|
||||
<li class="nav-item"><a class="nav-link" href="#" data-bs-toggle="modal" data-bs-target="#loginModal">Login</a></li>
|
||||
<li class="nav-item"><a class="nav-link" href="#" data-bs-toggle="modal" data-bs-target="#signupModal">Sign Up</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<div class="container mt-5">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-8">
|
||||
<div class="card form-card">
|
||||
<div class="card-body p-5">
|
||||
<h1 class="text-center mb-4">Contact Us</h1>
|
||||
<p class="text-center mb-5">Have questions? We'd love to hear from you. Fill out the form below and we'll get back to you as soon as possible.</p>
|
||||
|
||||
<?php if ($message): ?>
|
||||
<div class="alert alert-success"><?php echo $message; ?></div>
|
||||
<?php endif; ?>
|
||||
<?php if ($error): ?>
|
||||
<div class="alert alert-danger"><?php echo $error; ?></div>
|
||||
<?php endif; ?>
|
||||
|
||||
<form action="help.php" method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="name" class="form-label">Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="email" class="form-label">Email</label>
|
||||
<input type="email" class="form-control" id="email" name="email" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="message" class="form-label">Message</label>
|
||||
<textarea class="form-control" id="message" name="message" rows="5" required></textarea>
|
||||
</div>
|
||||
<div class="d-grid">
|
||||
<button type="submit" class="btn btn-primary btn-lg">Send Message</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<footer class="bg-dark text-white text-center p-3 mt-5">
|
||||
<p>© <?php echo date('Y'); ?> gomoviz.asia - All Rights Reserved.</p>
|
||||
</footer>
|
||||
|
||||
<!-- Modals -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
374
index.php
374
index.php
@ -1,150 +1,238 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
@ini_set('display_errors', '1');
|
||||
@error_reporting(E_ALL);
|
||||
@date_default_timezone_set('UTC');
|
||||
|
||||
$phpVersion = PHP_VERSION;
|
||||
$now = date('Y-m-d H:i:s');
|
||||
?>
|
||||
<!doctype html>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>New Style</title>
|
||||
<?php
|
||||
// Read project preview data from environment
|
||||
$projectDescription = $_SERVER['PROJECT_DESCRIPTION'] ?? '';
|
||||
$projectImageUrl = $_SERVER['PROJECT_IMAGE_URL'] ?? '';
|
||||
?>
|
||||
<?php if ($projectDescription): ?>
|
||||
<!-- Meta description -->
|
||||
<meta name="description" content='<?= htmlspecialchars($projectDescription) ?>' />
|
||||
<!-- Open Graph meta tags -->
|
||||
<meta property="og:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<!-- Twitter meta tags -->
|
||||
<meta property="twitter:description" content="<?= htmlspecialchars($projectDescription) ?>" />
|
||||
<?php endif; ?>
|
||||
<?php if ($projectImageUrl): ?>
|
||||
<!-- Open Graph image -->
|
||||
<meta property="og:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<!-- Twitter image -->
|
||||
<meta property="twitter:image" content="<?= htmlspecialchars($projectImageUrl) ?>" />
|
||||
<?php endif; ?>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap" rel="stylesheet">
|
||||
<style>
|
||||
:root {
|
||||
--bg-color-start: #6a11cb;
|
||||
--bg-color-end: #2575fc;
|
||||
--text-color: #ffffff;
|
||||
--card-bg-color: rgba(255, 255, 255, 0.01);
|
||||
--card-border-color: rgba(255, 255, 255, 0.1);
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
font-family: 'Inter', sans-serif;
|
||||
background: linear-gradient(45deg, var(--bg-color-start), var(--bg-color-end));
|
||||
color: var(--text-color);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
min-height: 100vh;
|
||||
text-align: center;
|
||||
overflow: hidden;
|
||||
position: relative;
|
||||
}
|
||||
body::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><path d="M-10 10L110 10M10 -10L10 110" stroke-width="1" stroke="rgba(255,255,255,0.05)"/></svg>');
|
||||
animation: bg-pan 20s linear infinite;
|
||||
z-index: -1;
|
||||
}
|
||||
@keyframes bg-pan {
|
||||
0% { background-position: 0% 0%; }
|
||||
100% { background-position: 100% 100%; }
|
||||
}
|
||||
main {
|
||||
padding: 2rem;
|
||||
}
|
||||
.card {
|
||||
background: var(--card-bg-color);
|
||||
border: 1px solid var(--card-border-color);
|
||||
border-radius: 16px;
|
||||
padding: 2rem;
|
||||
backdrop-filter: blur(20px);
|
||||
-webkit-backdrop-filter: blur(20px);
|
||||
box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
.loader {
|
||||
margin: 1.25rem auto 1.25rem;
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border: 3px solid rgba(255, 255, 255, 0.25);
|
||||
border-top-color: #fff;
|
||||
border-radius: 50%;
|
||||
animation: spin 1s linear infinite;
|
||||
}
|
||||
@keyframes spin {
|
||||
from { transform: rotate(0deg); }
|
||||
to { transform: rotate(360deg); }
|
||||
}
|
||||
.hint {
|
||||
opacity: 0.9;
|
||||
}
|
||||
.sr-only {
|
||||
position: absolute;
|
||||
width: 1px; height: 1px;
|
||||
padding: 0; margin: -1px;
|
||||
overflow: hidden;
|
||||
clip: rect(0, 0, 0, 0);
|
||||
white-space: nowrap; border: 0;
|
||||
}
|
||||
h1 {
|
||||
font-size: 3rem;
|
||||
font-weight: 700;
|
||||
margin: 0 0 1rem;
|
||||
letter-spacing: -1px;
|
||||
}
|
||||
p {
|
||||
margin: 0.5rem 0;
|
||||
font-size: 1.1rem;
|
||||
}
|
||||
code {
|
||||
background: rgba(0,0,0,0.2);
|
||||
padding: 2px 6px;
|
||||
border-radius: 4px;
|
||||
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
||||
}
|
||||
footer {
|
||||
position: absolute;
|
||||
bottom: 1rem;
|
||||
font-size: 0.8rem;
|
||||
opacity: 0.7;
|
||||
}
|
||||
</style>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
|
||||
<!-- SEO & Meta -->
|
||||
<title>gomoviz.asia - Your Ultimate IPTV Experience</title>
|
||||
<meta name="description" content="<?php echo htmlspecialchars($_SERVER['PROJECT_DESCRIPTION'] ?? 'A modern, fully functional Android IPTV live TV application for legal streaming with user-provided playlists.'); ?>">
|
||||
<meta name="keywords" content="IPTV, live tv, streaming, m3u, movies, series">
|
||||
<meta name="author" content="gomoviz.asia">
|
||||
|
||||
<!-- Open Graph / Twitter Meta (Platform-managed) -->
|
||||
<meta property="og:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
|
||||
<meta name="twitter:image" content="<?php echo htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? ''); ?>">
|
||||
|
||||
<!-- Bootstrap 5 CSS -->
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
|
||||
<!-- Bootstrap Icons -->
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<!-- Google Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
|
||||
<!-- Custom CSS -->
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
|
||||
<style>
|
||||
/* Additional styles for bottom nav and spacing */
|
||||
body {
|
||||
padding-bottom: 80px; /* Height of the bottom nav */
|
||||
}
|
||||
.bottom-nav {
|
||||
height: 70px;
|
||||
}
|
||||
</style>
|
||||
<link rel="manifest" href="manifest.json">
|
||||
</head>
|
||||
<body>
|
||||
<main>
|
||||
<div class="card">
|
||||
<h1>Analyzing your requirements and generating your website…</h1>
|
||||
<div class="loader" role="status" aria-live="polite" aria-label="Applying initial changes">
|
||||
<span class="sr-only">Loading…</span>
|
||||
</div>
|
||||
<p class="hint"><?= ($_SERVER['HTTP_HOST'] ?? '') === 'appwizzy.com' ? 'AppWizzy' : 'Flatlogic' ?> AI is collecting your requirements and applying the first changes.</p>
|
||||
<p class="hint">This page will update automatically as the plan is implemented.</p>
|
||||
<p>Runtime: PHP <code><?= htmlspecialchars($phpVersion) ?></code> — UTC <code><?= htmlspecialchars($now) ?></code></p>
|
||||
|
||||
<!-- Scrolling Link -->
|
||||
<div style="position: fixed; top: 10px; right: 10px; z-index: 1050; background: #007bff; padding: 5px; border-radius: 5px; max-width: 250px;">
|
||||
<marquee behavior="scroll" direction="left" scrollamount="5">
|
||||
<a href="http://www.gomoviez.asia" target="_blank" style="color: white; text-decoration: none; font-size: 16px;">
|
||||
watch latest movies
|
||||
</a>
|
||||
</marquee>
|
||||
</div>
|
||||
</main>
|
||||
<footer>
|
||||
Page updated: <?= htmlspecialchars($now) ?> (UTC)
|
||||
</footer>
|
||||
|
||||
<!-- Top Navigation Bar -->
|
||||
<nav class="navbar navbar-expand-lg sticky-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand fw-bold" href="#">gomoviz.asia</a>
|
||||
<div class="ms-auto d-flex align-items-center">
|
||||
<form class="d-flex me-2" role="search" onsubmit="return false;">
|
||||
<input class="form-control me-2 search-bar" type="search" id="mainSearch" placeholder="Type 'deep1' to discover..." aria-label="Search">
|
||||
</form>
|
||||
<div id="auth-buttons">
|
||||
<button class="btn btn-outline-primary me-2" data-bs-toggle="modal" data-bs-target="#loginModal">Login</button>
|
||||
<button class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#signupModal">Sign Up</button>
|
||||
</div>
|
||||
<div id="user-greeting" class="d-none"></div>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="container my-5">
|
||||
|
||||
<div id="home-section">
|
||||
<!-- Hero Section -->
|
||||
<section class="text-center mb-5">
|
||||
<h1 class="display-5 fw-bold">Your Ultimate IPTV Experience</h1>
|
||||
<p class="lead text-white-50">Add your playlists and enjoy seamless streaming. Simple, fast, and modern.</p>
|
||||
</section>
|
||||
|
||||
<!-- Categories Section -->
|
||||
<section class="mb-5">
|
||||
<h2 class="mb-4">Categories</h2>
|
||||
<div class="row row-cols-2 row-cols-md-3 row-cols-lg-6 g-4">
|
||||
<?php
|
||||
$categories = ['Live TV', 'Movies', 'Series', 'Sports', 'Kids', 'Documentaries'];
|
||||
$icons = ['tv', 'film', 'collection-play', 'trophy', 'joystick', 'book'];
|
||||
foreach ($categories as $index => $category):
|
||||
?>
|
||||
<div class="col">
|
||||
<div class="category-card h-100">
|
||||
<div class="card-body p-4 d-flex flex-column justify-content-center">
|
||||
<i class="bi bi-<?php echo $icons[$index]; ?> fs-1 mb-2 accent-text"></i>
|
||||
<h5 class="card-title mb-0"><?php echo $category; ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- How-to Section -->
|
||||
<section>
|
||||
<h2 class="mb-4">How to Get Started</h2>
|
||||
<div class="row g-4">
|
||||
<div class="col-md-6">
|
||||
<div class="category-card h-100 p-4">
|
||||
<h4 class="card-title accent-text">1. Add Your Playlist</h4>
|
||||
<p class="text-white-50">Go to "My Playlists" and add your M3U URL or log in with your credentials. Your channels will be loaded automatically.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="category-card h-100 p-4">
|
||||
<h4 class="card-title accent-text">2. Start Streaming</h4>
|
||||
<p class="text-white-50">Browse your channels, search for your favorite content, and start watching instantly with our advanced built-in player.</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
<div id="playlists-section" style="display: none;">
|
||||
<h1 class="display-5 fw-bold mb-4">My Playlists</h1>
|
||||
|
||||
<div class="card form-card mb-4">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add New Playlist</h5>
|
||||
<form id="add-playlist-form">
|
||||
<div class="mb-3">
|
||||
<label for="playlist-name" class="form-label">Playlist Name</label>
|
||||
<input type="text" class="form-control" id="playlist-name" placeholder="e.g., My Awesome TV" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="playlist-url" class="form-label">M3U URL</label>
|
||||
<input type="url" class="form-control" id="playlist-url" placeholder="https://example.com/playlist.m3u" required>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary w-100">Add Playlist</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2 class="mb-4">Your Playlists</h2>
|
||||
<div id="playlists-list">
|
||||
<p class="text-white-50">Your added playlists will appear here.</p>
|
||||
<!-- Playlists will be dynamically inserted here -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<!-- Login Modal -->
|
||||
<div class="modal fade" id="loginModal" tabindex="-1" aria-labelledby="loginModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content form-card">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="loginModalLabel">Login</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="login-form">
|
||||
<div class="mb-3">
|
||||
<label for="login-email" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="login-email" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="login-password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="login-password" required>
|
||||
</div>
|
||||
<div id="login-error" class="text-danger mb-3"></div>
|
||||
<button type="submit" class="btn btn-primary w-100">Login</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Sign Up Modal -->
|
||||
<div class="modal fade" id="signupModal" tabindex="-1" aria-labelledby="signupModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered">
|
||||
<div class="modal-content form-card">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="signupModalLabel">Create an Account</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form id="signup-form">
|
||||
<div class="mb-3">
|
||||
<label for="signup-email" class="form-label">Email address</label>
|
||||
<input type="email" class="form-control" id="signup-email" required>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="signup-password" class="form-label">Password</label>
|
||||
<input type="password" class="form-control" id="signup-password" required>
|
||||
</div>
|
||||
<div id="signup-error" class="text-danger mb-3"></div>
|
||||
<button type="submit" class="btn btn-primary w-100">Sign Up</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Bottom Navigation Bar -->
|
||||
<footer class="bottom-nav fixed-bottom d-flex justify-content-around align-items-center">
|
||||
<a href="#" id="nav-home" class="nav-link active">
|
||||
<i class="bi bi-house-door-fill fs-4"></i>
|
||||
<div>Home</div>
|
||||
</a>
|
||||
<a href="#" id="nav-playlists" class="nav-link">
|
||||
<i class="bi bi-list-stars fs-4"></i>
|
||||
<div>My Playlists</div>
|
||||
</a>
|
||||
<a href="#" id="nav-settings" class="nav-link">
|
||||
<i class="bi bi-gear-fill fs-4"></i>
|
||||
<div>Settings</div>
|
||||
</a>
|
||||
<a href="help.php" class="nav-link">
|
||||
<i class="bi bi-question-circle-fill fs-4"></i>
|
||||
<div>Help</div>
|
||||
</a>
|
||||
<a href="admin_login.php" style="position: absolute; bottom: 0; right: 0; font-size: 2px; color: #1E1E1E; text-decoration: none;">.</a>
|
||||
</footer>
|
||||
|
||||
<!-- Bootstrap 5 JS -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
|
||||
<!-- Custom JS -->
|
||||
<script src="assets/js/main.js?v=<?php echo time(); ?>"></script>
|
||||
<script>
|
||||
if ('serviceWorker' in navigator) {
|
||||
window.addEventListener('load', () => {
|
||||
navigator.serviceWorker.register('/sw.js').then(registration => {
|
||||
console.log('ServiceWorker registration successful with scope: ', registration.scope);
|
||||
}, err => {
|
||||
console.log('ServiceWorker registration failed: ', err);
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
20
manifest.json
Normal file
20
manifest.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"short_name": "PWA",
|
||||
"name": "Progressive Web App",
|
||||
"icons": [
|
||||
{
|
||||
"src": "assets/img/icon-192.png",
|
||||
"type": "image/png",
|
||||
"sizes": "192x192"
|
||||
},
|
||||
{
|
||||
"src": "assets/img/icon-512.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512"
|
||||
}
|
||||
],
|
||||
"start_url": "/index.php",
|
||||
"background_color": "#3367D6",
|
||||
"display": "standalone",
|
||||
"theme_color": "#3367D6"
|
||||
}
|
||||
102
player.php
Normal file
102
player.php
Normal file
@ -0,0 +1,102 @@
|
||||
<?php
|
||||
|
||||
$playlist_url = $_GET['url'] ?? null;
|
||||
|
||||
if (!$playlist_url) {
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
function parse_m3u($content) {
|
||||
$channels = [];
|
||||
$lines = explode("\n", $content);
|
||||
$channel_info = null;
|
||||
|
||||
foreach ($lines as $line) {
|
||||
$line = trim($line);
|
||||
if (empty($line)) continue;
|
||||
|
||||
if (strpos($line, '#EXTINF') === 0) {
|
||||
preg_match('/(?<=tvg-name=").*?(?=")/', $line, $name_match);
|
||||
preg_match('/(?<=tvg-logo=").*?(?=")/', $line, $logo_match);
|
||||
$title = empty($name_match) ? substr(strrchr($line, ","), 1) : $name_match[0];
|
||||
|
||||
$channel_info = [
|
||||
'name' => $title,
|
||||
'logo' => empty($logo_match) ? 'https://via.placeholder.com/150' : $logo_match[0]
|
||||
];
|
||||
} elseif ($channel_info && strpos($line, 'http') === 0) {
|
||||
$channel_info['url'] = $line;
|
||||
$channels[] = $channel_info;
|
||||
$channel_info = null;
|
||||
}
|
||||
}
|
||||
return $channels;
|
||||
}
|
||||
|
||||
$m3u_content = file_get_contents($playlist_url);
|
||||
$channels = parse_m3u($m3u_content);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Player - gomoviz.asia</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<style>
|
||||
body, html { height: 100%; }
|
||||
.player-wrapper { display: flex; height: 100vh; }
|
||||
.channel-sidebar { width: 300px; background-color: #1E1E1E; overflow-y: auto; height: 100%; }
|
||||
.player-main { flex-grow: 1; background-color: #000; display: flex; align-items: center; justify-content: center; }
|
||||
#video-player { width: 100%; height: 100%; }
|
||||
.channel-item { display: flex; align-items: center; padding: 10px; cursor: pointer; border-bottom: 1px solid #333; }
|
||||
.channel-item:hover { background-color: #2F2F2F; }
|
||||
.channel-item img { width: 50px; height: 50px; border-radius: 50%; margin-right: 15px; }
|
||||
.channel-item span { color: #E0E0E0; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="player-wrapper">
|
||||
<div class="channel-sidebar">
|
||||
<div class="p-3 text-center">
|
||||
<a class="navbar-brand fw-bold" href="index.php">gomoviz.asia</a>
|
||||
</div>
|
||||
<div id="channel-list">
|
||||
<?php foreach ($channels as $channel): ?>
|
||||
<div class="channel-item" data-url="<?php echo htmlspecialchars($channel['url']); ?>">
|
||||
<img src="<?php echo htmlspecialchars($channel['logo']); ?>" alt="Logo">
|
||||
<span><?php echo htmlspecialchars($channel['name']); ?></span>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<main class="player-main">
|
||||
<video id="video-player" controls autoplay src=""></video>
|
||||
</main>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const channelItems = document.querySelectorAll('.channel-item');
|
||||
const videoPlayer = document.getElementById('video-player');
|
||||
|
||||
channelItems.forEach(item => {
|
||||
item.addEventListener('click', function() {
|
||||
const streamUrl = this.dataset.url;
|
||||
videoPlayer.src = streamUrl;
|
||||
videoPlayer.play();
|
||||
});
|
||||
});
|
||||
|
||||
// Auto-play the first channel if available
|
||||
if (channelItems.length > 0) {
|
||||
channelItems[0].click();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
47
playlist_manager.php
Normal file
47
playlist_manager.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
session_start();
|
||||
require_once __DIR__ . '/db/config.php';
|
||||
|
||||
if (!isset($_SESSION['user_id'])) {
|
||||
header('Content-Type: application/json');
|
||||
echo json_encode(['error' => 'Authentication required.']);
|
||||
exit;
|
||||
}
|
||||
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$action = $_GET['action'] ?? $_POST['action'] ?? '';
|
||||
|
||||
header('Content-Type: application/json');
|
||||
|
||||
try {
|
||||
$pdo = db();
|
||||
|
||||
if ($action === 'get') {
|
||||
$stmt = $pdo->prepare("SELECT * FROM user_playlists WHERE user_id = ? ORDER BY created_at DESC");
|
||||
$stmt->execute([$user_id]);
|
||||
$playlists = $stmt->fetchAll();
|
||||
echo json_encode($playlists);
|
||||
}
|
||||
|
||||
elseif ($action === 'add') {
|
||||
$name = $_POST['name'] ?? '';
|
||||
$url = $_POST['url'] ?? '';
|
||||
if (!empty($name) && !empty($url)) {
|
||||
$stmt = $pdo->prepare("INSERT INTO user_playlists (user_id, name, url) VALUES (?, ?, ?)");
|
||||
$stmt->execute([$user_id, $name, $url]);
|
||||
echo json_encode(['success' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
elseif ($action === 'delete') {
|
||||
$id = $_POST['id'] ?? '';
|
||||
if (!empty($id)) {
|
||||
$stmt = $pdo->prepare("DELETE FROM user_playlists WHERE id = ? AND user_id = ?");
|
||||
$stmt->execute([$id, $user_id]);
|
||||
echo json_encode(['success' => true]);
|
||||
}
|
||||
}
|
||||
|
||||
} catch (PDOException $e) {
|
||||
echo json_encode(['error' => 'Database error']);
|
||||
}
|
||||
84
premium.php
Normal file
84
premium.php
Normal file
@ -0,0 +1,84 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Premium - gomoviz.asia</title>
|
||||
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
|
||||
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
||||
<style>
|
||||
.poster-card {
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
border-radius: 0.5rem;
|
||||
transition: transform 0.2s ease;
|
||||
}
|
||||
.poster-card img {
|
||||
width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
.poster-card:hover {
|
||||
transform: scale(1.05);
|
||||
}
|
||||
.poster-overlay {
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
|
||||
color: white;
|
||||
padding: 2rem 1rem 1rem;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Top Navigation Bar (same as index.php) -->
|
||||
<nav class="navbar navbar-expand-lg sticky-top">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand fw-bold" href="index.php">gomoviz.asia</a>
|
||||
</div>
|
||||
</nav>
|
||||
|
||||
<main class="container my-5">
|
||||
<div class="text-center mb-5">
|
||||
<h1 class="display-5 fw-bold">Premium Content</h1>
|
||||
<p class="lead text-white-50">Your 10-day free trial is active. Enjoy exclusive movies and shows.</p>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$content_file = 'premium_content.json';
|
||||
$premium_content = [];
|
||||
if (file_exists($content_file)) {
|
||||
$premium_content = json_decode(file_get_contents($content_file), true);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="row row-cols-2 row-cols-md-3 row-cols-lg-5 g-4">
|
||||
<?php if (empty($premium_content)): ?>
|
||||
<p class="text-white-50">No premium content is available at the moment. Please check back later.</p>
|
||||
<?php else: ?>
|
||||
<?php foreach ($premium_content as $item): ?>
|
||||
<div class="col">
|
||||
<a href="<?php echo htmlspecialchars($item['stream_url']); ?>" target="_blank" class="text-decoration-none">
|
||||
<div class="card category-card poster-card text-white h-100">
|
||||
<img src="<?php echo htmlspecialchars($item['poster_url']); ?>" class="card-img" alt="<?php echo htmlspecialchars($item['title']); ?>">
|
||||
<div class="poster-overlay">
|
||||
<h5 class="card-title mb-0"><?php echo htmlspecialchars($item['title']); ?></h5>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
||||
</main>
|
||||
|
||||
<!-- You can add a simplified footer or the full nav bar if needed -->
|
||||
<footer class="text-center p-4 text-white-50">
|
||||
© <?php echo date('Y'); ?> gomoviz.asia
|
||||
</footer>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
401
premium_content.json
Normal file
401
premium_content.json
Normal file
@ -0,0 +1,401 @@
|
||||
[
|
||||
{
|
||||
"title": "7000\t\"Football Event 98: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Inter Milano B vs. Ospitaletto | Sunday",
|
||||
"stream_url": "05 October 2025 19:30\"\t790028\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"title": "7024\t\"Football Event 74: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Sorrento vs. Monopoli | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790051\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 2
|
||||
},
|
||||
{
|
||||
"title": "7025\t\"Football Event 73: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Team Altamura vs. Potenza Calcio | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790052\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 3
|
||||
},
|
||||
{
|
||||
"title": "7026\t\"Football Event 72: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Athletic Carpi vs. Perugia | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790053\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 4
|
||||
},
|
||||
{
|
||||
"title": "7027\t\"Football Event 71: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Forl vs. Nuova Monterosi | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790054\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 5
|
||||
},
|
||||
{
|
||||
"title": "7028\t\"Football Event 70: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Alcione vs. Vicenza | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790055\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 6
|
||||
},
|
||||
{
|
||||
"title": "7030\t\"Football Event 68: Portugal",
|
||||
"category": "Liga 3",
|
||||
"poster_url": "Group A | AD Fafe vs. SC Sao Joao de Ver | Sunday",
|
||||
"stream_url": "05 October 2025 16:15\"\t790057\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 7
|
||||
},
|
||||
{
|
||||
"title": "7036\t\"Football Event 62: Netherlands",
|
||||
"category": "Eredivisie",
|
||||
"poster_url": "Women | Hera United vs. NAC Breda | Sunday",
|
||||
"stream_url": "05 October 2025 15:45\"\t790063\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 8
|
||||
},
|
||||
{
|
||||
"title": "7053\t\"Football Event 45: Portugal",
|
||||
"category": "Liga 3",
|
||||
"poster_url": "Group A | Uniao SC Paredes vs. AD Marco 09 | Sunday",
|
||||
"stream_url": "05 October 2025 14:15\"\t790080\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 9
|
||||
},
|
||||
{
|
||||
"title": "7059\t\"Football Event 39: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Salernitana vs. Cavese | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790086\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 10
|
||||
},
|
||||
{
|
||||
"title": "7060\t\"Football Event 38: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Trapani 1905 vs. Giugliano | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790087\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 11
|
||||
},
|
||||
{
|
||||
"title": "7061\t\"Football Event 37: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Catania vs. Siracusa | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790088\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 12
|
||||
},
|
||||
{
|
||||
"title": "7062\t\"Football Event 36: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Casertana vs. Virtus Casarano | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790089\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 13
|
||||
},
|
||||
{
|
||||
"title": "7063\t\"Football Event 35: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Pro Vercelli vs. Dolomiti Bellunesi | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790090\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 14
|
||||
},
|
||||
{
|
||||
"title": "7064\t\"Football Event 34: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Pro Patria vs. Trento | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790091\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 15
|
||||
},
|
||||
{
|
||||
"title": "7070\t\"Football Event 28: Germany",
|
||||
"category": "Bundesliga",
|
||||
"poster_url": "Women | FC Union Berlin vs. SC Freiburg | Sunday",
|
||||
"stream_url": "05 October 2025 13:00\"\t790097\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 16
|
||||
},
|
||||
{
|
||||
"title": "7086\t\"Football Event 12: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Novara vs. Triestina | Sunday",
|
||||
"stream_url": "05 October 2025 11:30\"\t790113\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 17
|
||||
},
|
||||
{
|
||||
"title": "7087\t\"Football Event 11: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Juventus II vs. Ravenna | Sunday",
|
||||
"stream_url": "05 October 2025 11:30\"\t790114\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 18
|
||||
},
|
||||
{
|
||||
"title": "7090\t\"Football Event 08: Netherlands",
|
||||
"category": "Eredivisie",
|
||||
"poster_url": "Women | ADO Den Haag vs. AZ Alkmaar | Sunday",
|
||||
"stream_url": "05 October 2025 11:15\"\t790117\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 19
|
||||
},
|
||||
{
|
||||
"title": "7000\t\"Football Event 98: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Inter Milano B vs. Ospitaletto | Sunday",
|
||||
"stream_url": "05 October 2025 19:30\"\t790028\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 20
|
||||
},
|
||||
{
|
||||
"title": "7024\t\"Football Event 74: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Sorrento vs. Monopoli | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790051\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 21
|
||||
},
|
||||
{
|
||||
"title": "7025\t\"Football Event 73: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Team Altamura vs. Potenza Calcio | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790052\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 22
|
||||
},
|
||||
{
|
||||
"title": "7026\t\"Football Event 72: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Athletic Carpi vs. Perugia | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790053\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 23
|
||||
},
|
||||
{
|
||||
"title": "7027\t\"Football Event 71: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Forl vs. Nuova Monterosi | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790054\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 24
|
||||
},
|
||||
{
|
||||
"title": "7028\t\"Football Event 70: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Alcione vs. Vicenza | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790055\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 25
|
||||
},
|
||||
{
|
||||
"title": "7030\t\"Football Event 68: Portugal",
|
||||
"category": "Liga 3",
|
||||
"poster_url": "Group A | AD Fafe vs. SC Sao Joao de Ver | Sunday",
|
||||
"stream_url": "05 October 2025 16:15\"\t790057\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 26
|
||||
},
|
||||
{
|
||||
"title": "7036\t\"Football Event 62: Netherlands",
|
||||
"category": "Eredivisie",
|
||||
"poster_url": "Women | Hera United vs. NAC Breda | Sunday",
|
||||
"stream_url": "05 October 2025 15:45\"\t790063\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 27
|
||||
},
|
||||
{
|
||||
"title": "7053\t\"Football Event 45: Portugal",
|
||||
"category": "Liga 3",
|
||||
"poster_url": "Group A | Uniao SC Paredes vs. AD Marco 09 | Sunday",
|
||||
"stream_url": "05 October 2025 14:15\"\t790080\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 28
|
||||
},
|
||||
{
|
||||
"title": "7059\t\"Football Event 39: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Salernitana vs. Cavese | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790086\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 29
|
||||
},
|
||||
{
|
||||
"title": "7060\t\"Football Event 38: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Trapani 1905 vs. Giugliano | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790087\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 30
|
||||
},
|
||||
{
|
||||
"title": "7061\t\"Football Event 37: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Catania vs. Siracusa | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790088\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 31
|
||||
},
|
||||
{
|
||||
"title": "7062\t\"Football Event 36: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Casertana vs. Virtus Casarano | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790089\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 32
|
||||
},
|
||||
{
|
||||
"title": "7063\t\"Football Event 35: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Pro Vercelli vs. Dolomiti Bellunesi | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790090\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 33
|
||||
},
|
||||
{
|
||||
"title": "7064\t\"Football Event 34: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Pro Patria vs. Trento | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790091\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 34
|
||||
},
|
||||
{
|
||||
"title": "7070\t\"Football Event 28: Germany",
|
||||
"category": "Bundesliga",
|
||||
"poster_url": "Women | FC Union Berlin vs. SC Freiburg | Sunday",
|
||||
"stream_url": "05 October 2025 13:00\"\t790097\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 35
|
||||
},
|
||||
{
|
||||
"title": "7086\t\"Football Event 12: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Novara vs. Triestina | Sunday",
|
||||
"stream_url": "05 October 2025 11:30\"\t790113\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 36
|
||||
},
|
||||
{
|
||||
"title": "7087\t\"Football Event 11: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Juventus II vs. Ravenna | Sunday",
|
||||
"stream_url": "05 October 2025 11:30\"\t790114\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 37
|
||||
},
|
||||
{
|
||||
"title": "7090\t\"Football Event 08: Netherlands",
|
||||
"category": "Eredivisie",
|
||||
"poster_url": "Women | ADO Den Haag vs. AZ Alkmaar | Sunday",
|
||||
"stream_url": "05 October 2025 11:15\"\t790117\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 38
|
||||
},
|
||||
{
|
||||
"title": "7000\t\"Football Event 98: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Inter Milano B vs. Ospitaletto | Sunday",
|
||||
"stream_url": "05 October 2025 19:30\"\t790028\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 39
|
||||
},
|
||||
{
|
||||
"title": "7024\t\"Football Event 74: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Sorrento vs. Monopoli | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790051\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 40
|
||||
},
|
||||
{
|
||||
"title": "7025\t\"Football Event 73: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Team Altamura vs. Potenza Calcio | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790052\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 41
|
||||
},
|
||||
{
|
||||
"title": "7026\t\"Football Event 72: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Athletic Carpi vs. Perugia | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790053\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 42
|
||||
},
|
||||
{
|
||||
"title": "7027\t\"Football Event 71: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Forl vs. Nuova Monterosi | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790054\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 43
|
||||
},
|
||||
{
|
||||
"title": "7028\t\"Football Event 70: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Alcione vs. Vicenza | Sunday",
|
||||
"stream_url": "05 October 2025 16:30\"\t790055\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 44
|
||||
},
|
||||
{
|
||||
"title": "7030\t\"Football Event 68: Portugal",
|
||||
"category": "Liga 3",
|
||||
"poster_url": "Group A | AD Fafe vs. SC Sao Joao de Ver | Sunday",
|
||||
"stream_url": "05 October 2025 16:15\"\t790057\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 45
|
||||
},
|
||||
{
|
||||
"title": "7036\t\"Football Event 62: Netherlands",
|
||||
"category": "Eredivisie",
|
||||
"poster_url": "Women | Hera United vs. NAC Breda | Sunday",
|
||||
"stream_url": "05 October 2025 15:45\"\t790063\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 46
|
||||
},
|
||||
{
|
||||
"title": "7053\t\"Football Event 45: Portugal",
|
||||
"category": "Liga 3",
|
||||
"poster_url": "Group A | Uniao SC Paredes vs. AD Marco 09 | Sunday",
|
||||
"stream_url": "05 October 2025 14:15\"\t790080\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 47
|
||||
},
|
||||
{
|
||||
"title": "7059\t\"Football Event 39: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Salernitana vs. Cavese | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790086\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 48
|
||||
},
|
||||
{
|
||||
"title": "7060\t\"Football Event 38: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Trapani 1905 vs. Giugliano | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790087\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 49
|
||||
},
|
||||
{
|
||||
"title": "7061\t\"Football Event 37: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Catania vs. Siracusa | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790088\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 50
|
||||
},
|
||||
{
|
||||
"title": "7062\t\"Football Event 36: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone C | Casertana vs. Virtus Casarano | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790089\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 51
|
||||
},
|
||||
{
|
||||
"title": "7063\t\"Football Event 35: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Pro Vercelli vs. Dolomiti Bellunesi | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790090\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 52
|
||||
},
|
||||
{
|
||||
"title": "7064\t\"Football Event 34: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Pro Patria vs. Trento | Sunday",
|
||||
"stream_url": "05 October 2025 13:30\"\t790091\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 53
|
||||
},
|
||||
{
|
||||
"title": "7070\t\"Football Event 28: Germany",
|
||||
"category": "Bundesliga",
|
||||
"poster_url": "Women | FC Union Berlin vs. SC Freiburg | Sunday",
|
||||
"stream_url": "05 October 2025 13:00\"\t790097\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 54
|
||||
},
|
||||
{
|
||||
"title": "7086\t\"Football Event 12: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone A | Novara vs. Triestina | Sunday",
|
||||
"stream_url": "05 October 2025 11:30\"\t790113\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 55
|
||||
},
|
||||
{
|
||||
"title": "7087\t\"Football Event 11: Italy",
|
||||
"category": "Serie C",
|
||||
"poster_url": "Girone B | Juventus II vs. Ravenna | Sunday",
|
||||
"stream_url": "05 October 2025 11:30\"\t790114\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 56
|
||||
},
|
||||
{
|
||||
"title": "7090\t\"Football Event 08: Netherlands",
|
||||
"category": "Eredivisie",
|
||||
"poster_url": "Women | ADO Den Haag vs. AZ Alkmaar | Sunday",
|
||||
"stream_url": "05 October 2025 11:15\"\t790117\tlive\t815\thttp:\/\/xplatinmedia.com:8080\/images\/836b75cfe266fa40acc2ffa3888e1abf.png\t1759659185\t0",
|
||||
"id": 57
|
||||
}
|
||||
]
|
||||
8
settings.json
Normal file
8
settings.json
Normal file
@ -0,0 +1,8 @@
|
||||
{
|
||||
"trial_duration_public": 2,
|
||||
"trial_duration_premium": 10,
|
||||
"public_price_monthly": 4.99,
|
||||
"premium_price_monthly": 14.99,
|
||||
"public_price_yearly": 49.99,
|
||||
"premium_price_yearly": 149.99
|
||||
}
|
||||
31
sw.js
Normal file
31
sw.js
Normal file
@ -0,0 +1,31 @@
|
||||
const CACHE_NAME = 'pwa-cache-v1';
|
||||
const urlsToCache = [
|
||||
'/',
|
||||
'/index.php',
|
||||
'/assets/css/custom.css',
|
||||
'/assets/js/main.js',
|
||||
'/assets/img/icon-192.png',
|
||||
'/assets/img/icon-512.png'
|
||||
];
|
||||
|
||||
self.addEventListener('install', event => {
|
||||
event.waitUntil(
|
||||
caches.open(CACHE_NAME)
|
||||
.then(cache => {
|
||||
console.log('Opened cache');
|
||||
return cache.addAll(urlsToCache);
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', event => {
|
||||
event.respondWith(
|
||||
caches.match(event.request)
|
||||
.then(response => {
|
||||
if (response) {
|
||||
return response;
|
||||
}
|
||||
return fetch(event.request);
|
||||
})
|
||||
);
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user