Linux ubuntu 6.8.0-90-generic #91-Ubuntu SMP PREEMPT_DYNAMIC Tue Nov 18 14:14:30 UTC 2025 x86_64
nginx/1.24.0
: 67.217.245.49 | : 216.73.216.153
Cant Read [ /etc/named.conf ]
8.3.6
www-data
Bypass.pw
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
Backdoor Scanner
Backdoor Create
Alfa Webshell
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
mangapix /
public_html /
berribo /
[ HOME SHELL ]
Name
Size
Permission
Action
js
[ DIR ]
drwxrwxrwx
uploads
[ DIR ]
drwxrwxrwx
.htaccess
480
B
-rwxrwxrwx
00-01.jpg
562.85
KB
-rwxrwxrwx
02.jpg
35.82
KB
-rwxrwxrwx
03.jpg
378.77
KB
-rwxrwxrwx
04-05.jpg
696.59
KB
-rwxrwxrwx
06-07.jpg
685.45
KB
-rwxrwxrwx
08.jpg
421.87
KB
-rwxrwxrwx
09.jpg
410.44
KB
-rwxrwxrwx
10.jpg
330.76
KB
-rwxrwxrwx
AgentForm.html
11.52
KB
-rwxrwxrwx
AgentPanel.html
17.48
KB
-rwxrwxrwx
AgentReport.html
24.23
KB
-rwxrwxrwx
actions.php
8.39
KB
-rwxrwxrwx
add_article.php
18.23
KB
-rwxrwxrwx
add_chapter_section.php
11.79
KB
-rwxrwxrwx
add_new_manga.php
12.93
KB
-rwxrwxrwx
articles.php
18.06
KB
-rwxrwxrwx
bootstrap.min.css
141.49
KB
-rwxrwxrwx
bootstrap.min.js
47.8
KB
-rwxrwxrwx
change-password.php
8.51
KB
-rwxrwxrwx
comment.php
23.33
KB
-rwxrwxrwx
dashboard.php
16.33
KB
-rw-rw-r--
dashboard_ori.php
21.05
KB
-rwxrwxrwx
datasource.php
1.5
KB
-rwxrwxrwx
dbhelper.php
52.98
KB
-rwxrwxrwx
edit_article.php
19.52
KB
-rwxrwxrwx
edit_chapter_section.php
19.73
KB
-rw-rw-r--
edit_chapter_section_org.php
16.57
KB
-rwxrwxrwx
edit_chapter_section_org1.php
35.18
KB
-rwxrwxrwx
edit_chapter_section_ori.php
35.2
KB
-rwxrwxrwx
edit_manga.php
23.37
KB
-rwxrwxrwx
edit_manga2.php
27.92
KB
-rw-rw-r--
error.php
0
B
-rwxrwxrwx
favicon.ico
67.58
KB
-rwxrwxrwx
footer.php
1.21
KB
-rwxrwxrwx
generate_sitemap.php
14.74
KB
-rwxrwxrwx
genre.php
15.07
KB
-rwxrwxrwx
header.php
8.49
KB
-rwxrwxrwx
home.php
45.57
KB
-rwxrwxrwx
index.php
258
B
-rwxrwxrwx
insert-image.png
12.36
KB
-rwxrwxrwx
jquery-slim.min.js
67.97
KB
-rwxrwxrwx
loading-dark.gif
17.85
KB
-rwxrwxrwx
log.txt
208.9
KB
-rwxrwxrwx
login.php
0
B
-rwxrwxrwx
logo_dark.7c81824.png
70.25
KB
-rwxrwxrwx
logo_light.d9991b5.png
70.25
KB
-rwxrwxrwx
logo_white.f5e6e19.png
70.25
KB
-rwxrwxrwx
logout.php
185
B
-rwxrwxrwx
main.js
56
B
-rwxrwxrwx
manage_ads.php
33.09
KB
-rw-rw-r--
manga_requests.php
11.38
KB
-rwxrwxrwx
page_section.php
15.59
KB
-rwxrwxrwx
phpinfo.php
18
B
-rwxrwxrwx
popper.min.js
18.74
KB
-rwxrwxrwx
rome.css
1.76
KB
-rwxrwxrwx
rome.js
433.52
KB
-rwxrwxrwx
script.php
1.41
KB
-rwxrwxrwx
search_keywords.php
11.28
KB
-rw-rw-r--
signin.php
6.97
KB
-rwxrwxrwx
signup.php
7.23
KB
-rwxrwxrwx
sitemap-chapters.xml
1.65
MB
-rw-r--r--
sitemap-genre.xml
5.15
KB
-rw-r--r--
sitemap-manga.xml
30.47
KB
-rw-r--r--
sitemap.xml
648
B
-rwxrwxrwx
sitemap1.xml
13.43
KB
-rwxrwxrwx
sitemap_index.xml
528
B
-rw-r--r--
starter-template.css
109
B
-rwxrwxrwx
statistics.php
24.64
KB
-rwxrwxrwx
stats_data.php
2.94
KB
-rw-rw-r--
style_css.php
97.59
KB
-rwxrwxrwx
styles.css
660.94
KB
-rwxrwxrwx
thumbnail(19).webp
40.43
KB
-rwxrwxrwx
transfer_image.php
1.91
KB
-rwxrwxrwx
upload.php
1.26
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : manage_ads.php
<?php error_reporting(E_ALL); ini_set('display_errors', '1'); ini_set('display_startup_errors', '1'); // manage_ads.php (DROP-IN) — Optimized UI, no external CSS/JS // Requirements: dbhelper.php has: // - getAllAdsScripts() // - saveAdsScript($id,$placement,$provider,$name,$ad_type,$script,$direct_url,$is_active,$sort_order) // - deleteAdsScript($id) if (!isset($_SESSION)) session_start(); if (empty($_SESSION["userId"])) { echo '<script>location.replace("signin.php");</script>'; exit; } require_once __DIR__ . "/dbhelper.php"; $dbhelper = new DBHelper(); if (!function_exists('e')) { function e(string $s): string { return htmlspecialchars($s, ENT_QUOTES, 'UTF-8'); } } function post($k, $d = '') { return isset($_POST[$k]) ? (string)$_POST[$k] : $d; } function geti($k, $d = 0) { return isset($_GET[$k]) ? (int)$_GET[$k] : $d; } function clampi($v, $min, $max) { return max($min, min($max, (int)$v)); } $ok = ''; $err = ''; /* ---------- Handle POST ---------- */ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $action = post('action'); if ($action === 'save') { $id = (int)post('id', '0'); $placement = trim(post('placement')); $provider = trim(post('provider')); $name = trim(post('name')); $ad_type = trim(post('ad_type', 'script')); $script = (string)post('script'); $direct_url = trim(post('direct_url')); $is_active = (int)post('is_active', '1'); $sort_order = (int)post('sort_order', '10'); $is_active = $is_active ? 1 : 0; $sort_order = clampi($sort_order, 0, 9999); $res = $dbhelper->saveAdsScript($id, $placement, $provider, $name, $ad_type, $script, $direct_url, $is_active, $sort_order); if ($res) $ok = "Saved successfully."; else $err = "Save failed. Placement + (Script or Direct URL) is required."; } if ($action === 'delete') { $id = (int)post('id', '0'); $res = $dbhelper->deleteAdsScript($id); if ($res) $ok = "Deleted."; else $err = "Delete failed."; } } /* ---------- Load data ---------- */ $rows = $dbhelper->getAllAdsScripts() ?: []; $editId = geti('edit', 0); $edit = null; if ($editId > 0) { foreach ($rows as $r) { if ((int)($r['id'] ?? 0) === $editId) { $edit = $r; break; } } } $q = trim((string)($_GET['q'] ?? '')); $typeFilter = trim((string)($_GET['type'] ?? '')); $placeFilter = trim((string)($_GET['place'] ?? '')); $filtered = []; if ($rows) { foreach ($rows as $r) { $p = (string)($r['placement'] ?? ''); $t = (string)($r['ad_type'] ?? 'script'); $n = strtolower((string)($r['name'] ?? '')); $prov = strtolower((string)($r['provider'] ?? '')); if ($typeFilter !== '' && $t !== $typeFilter) continue; if ($placeFilter !== '' && $p !== $placeFilter) continue; if ($q !== '') { $qq = strtolower($q); if (strpos($n, $qq) === false && strpos($prov, $qq) === false && strpos(strtolower($p), $qq) === false) continue; } $filtered[] = $r; } } else { $filtered = []; } $placements = ['head', 'body_top', 'body_bottom', 'popunder', 'banner_top', 'banner_mid', 'banner_bottom']; $curPlacement = (string)($edit['placement'] ?? 'head'); $curType = (string)($edit['ad_type'] ?? 'script'); $curActive = (int)($edit['is_active'] ?? 1); function badge($text, $tone = 'gray') { $t = e($text); $cls = "tag tag-$tone"; return "<span class=\"$cls\">$t</span>"; } $totalCount = count($rows); $showCount = count($filtered); ?> <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width,initial-scale=1,viewport-fit=cover"> <title>Manage Ads</title> <style> :root { --bg: #f6f7fb; --card: #ffffff; --text: #0f172a; --muted: #64748b; --muted2: #94a3b8; --line: rgba(15, 23, 42, .10); --shadow: 0 12px 26px rgba(15, 23, 42, .08); --shadow2: 0 18px 40px rgba(15, 23, 42, .14); --r: 18px; --primary: #111827; --accent: #f59e0b; --danger: #ef4444; --ok: #16a34a; --focus: rgba(17, 24, 39, .18); --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; } [data-theme="dark"] { --bg: #0b1220; --card: #0f172a; --text: #e5e7eb; --muted: #9ca3af; --muted2: #6b7280; --line: rgba(255, 255, 255, .10); --shadow: 0 14px 34px rgba(0, 0, 0, .35); --shadow2: 0 20px 44px rgba(0, 0, 0, .45); --primary: #e5e7eb; --focus: rgba(229, 231, 235, .20); } * { box-sizing: border-box } body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: radial-gradient(1200px 600px at 20% -10%, rgba(245, 158, 11, .16), transparent 60%), radial-gradient(900px 500px at 80% 0%, rgba(59, 130, 246, .12), transparent 60%), var(--bg); color: var(--text); } a { color: inherit; text-decoration: none } .topbar { position: sticky; top: 0; z-index: 30; backdrop-filter: blur(10px); background: color-mix(in srgb, var(--bg) 84%, transparent); border-bottom: 1px solid var(--line); } .topbar-inner { width: min(1200px, calc(100% - 24px)); margin: 0 auto; padding: 12px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; } .brand { display: flex; align-items: center; gap: 10px; font-weight: 950; letter-spacing: -.3px } .logo { width: 38px; height: 38px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary) 14%, transparent); border: 1px solid var(--line); box-shadow: 0 10px 20px rgba(0, 0, 0, .08); font-weight: 950; } .brand small { display: block; font-weight: 800; color: var(--muted); margin-top: 2px } .actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap } .btn { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 10px 14px; font-weight: 900; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 8px 18px rgba(15, 23, 42, .06); transition: transform .12s ease, box-shadow .12s ease, opacity .12s ease; white-space: nowrap; } .btn:hover { transform: translateY(-1px); box-shadow: 0 14px 26px rgba(15, 23, 42, .12); } .btn:active { transform: none; opacity: .92 } .btn-primary { background: var(--primary); color: #fff; border-color: transparent; } [data-theme="dark"] .btn-primary { background: #e5e7eb; color: #0b1220 } .btn-ghost { background: transparent; box-shadow: none } .wrap { width: min(1200px, calc(100% - 24px)); margin: 16px auto 64px; } .hero { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 12px 0 12px; } .hero h1 { margin: 0; font-size: 20px; font-weight: 950; letter-spacing: -.3px } .hero p { margin: 6px 0 0; color: var(--muted); font-weight: 800; font-size: 12px; max-width: 720px } .kpis { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end } .kpi { background: color-mix(in srgb, var(--card) 92%, transparent); border: 1px solid var(--line); border-radius: 999px; padding: 8px 12px; font-weight: 900; font-size: 12px; color: var(--muted); box-shadow: 0 8px 18px rgba(15, 23, 42, .06); } .grid { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; } @media(min-width: 980px) { .grid { grid-template-columns: 440px 1fr; } } .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; } .card-head { padding: 12px 14px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; background: color-mix(in srgb, var(--card) 86%, transparent); } .card-head .title { font-weight: 950; letter-spacing: -.2px; display: flex; align-items: center; gap: 10px; } .card-head .sub { color: var(--muted); font-weight: 800; font-size: 12px; margin-top: 2px; } .card-body { padding: 14px; } .msg { margin-top: 12px; padding: 10px 12px; border-radius: 14px; font-weight: 900; font-size: 13px; } .msg.ok { background: color-mix(in srgb, #16a34a 14%, var(--card)); border: 1px solid color-mix(in srgb, #16a34a 35%, var(--line)); color: color-mix(in srgb, #16a34a 70%, var(--text)); } .msg.err { background: color-mix(in srgb, #ef4444 12%, var(--card)); border: 1px solid color-mix(in srgb, #ef4444 35%, var(--line)); color: color-mix(in srgb, #ef4444 72%, var(--text)); } label { display: block; font-size: 12px; font-weight: 950; color: color-mix(in srgb, var(--text) 86%, var(--muted)); margin-bottom: 6px } input, select, textarea { width: 100%; border-radius: 14px; border: 1px solid var(--line); padding: 10px 12px; background: color-mix(in srgb, var(--card) 94%, transparent); color: var(--text); outline: none; transition: box-shadow .12s ease, border-color .12s ease, transform .12s ease, opacity .12s ease; } input:focus, select:focus, textarea:focus { border-color: color-mix(in srgb, var(--text) 22%, transparent); box-shadow: 0 0 0 4px var(--focus); } textarea { min-height: 220px; font-family: var(--mono); font-size: 12px; line-height: 1.45; resize: vertical; } .row { display: grid; grid-template-columns: 1fr; gap: 10px } .row2 { display: grid; grid-template-columns: 1fr; gap: 10px } .row3 { display: grid; grid-template-columns: 1fr; gap: 10px } @media(min-width: 560px) { .row2 { grid-template-columns: 1fr 1fr } .row3 { grid-template-columns: 1fr 1fr 1fr } } .help { margin-top: 8px; color: var(--muted); font-weight: 800; font-size: 12px; line-height: 1.35; } .warn { margin-top: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 10%, var(--card)); color: color-mix(in srgb, var(--accent) 65%, var(--text)); font-weight: 900; font-size: 12px; } .mini-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; justify-content: flex-end } .tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 86%, transparent); font-weight: 950; font-size: 12px; color: var(--muted); white-space: nowrap; } .tag-green { color: color-mix(in srgb, #16a34a 70%, var(--text)); border-color: color-mix(in srgb, #16a34a 35%, var(--line)); background: color-mix(in srgb, #16a34a 10%, var(--card)); } .tag-red { color: color-mix(in srgb, #ef4444 70%, var(--text)); border-color: color-mix(in srgb, #ef4444 35%, var(--line)); background: color-mix(in srgb, #ef4444 10%, var(--card)); } .tag-amber { color: color-mix(in srgb, #f59e0b 70%, var(--text)); border-color: color-mix(in srgb, #f59e0b 35%, var(--line)); background: color-mix(in srgb, #f59e0b 10%, var(--card)); } .tag-blue { color: color-mix(in srgb, #3b82f6 70%, var(--text)); border-color: color-mix(in srgb, #3b82f6 35%, var(--line)); background: color-mix(in srgb, #3b82f6 10%, var(--card)); } .filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--card) 90%, transparent); } .filters .search { flex: 1; min-width: 220px; border-radius: 999px; padding: 11px 14px; } .filters select { border-radius: 999px; padding: 10px 12px; font-weight: 900; font-size: 13px; width: auto; min-width: 160px; } .table-wrap { overflow: auto; } table { width: 100%; border-collapse: collapse; } th, td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; font-size: 13px; vertical-align: top; white-space: nowrap; } th { position: sticky; top: 0; z-index: 1; background: color-mix(in srgb, var(--card) 94%, transparent); font-size: 12px; color: var(--muted); font-weight: 950; letter-spacing: .2px; } td.name-cell { white-space: normal; min-width: 220px; } td.mono { font-family: var(--mono); font-size: 12px; white-space: normal; min-width: 320px; color: var(--muted); } .row-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end } .btn-sm { padding: 8px 12px; font-size: 12px } .btn-danger { border-color: transparent; background: color-mix(in srgb, var(--danger) 86%, #fff); color: #fff; box-shadow: 0 8px 18px rgba(239, 68, 68, .18); } [data-theme="dark"] .btn-danger { background: color-mix(in srgb, var(--danger) 86%, #0b1220); color: #fff; } .muted { color: var(--muted); font-weight: 800 } .footer { margin-top: 16px; text-align: center; color: var(--muted2); font-weight: 800; font-size: 12px; } </style> </head> <body> <div class="topbar"> <div class="topbar-inner"> <div class="brand"> <div class="logo">AD</div> <div> Manage Ads <small>Hilltop / Adcash scripts + directlink</small> </div> </div> <div class="actions"> <button class="btn btn-ghost" id="themeBtn" type="button" title="Toggle theme">🌓 Theme</button> <button class="btn" type="button" onclick="location.href='dashboard.php'">← Back</button> <button class="btn btn-primary" type="button" onclick="location.href='manage_ads.php'">➕ New</button> </div> </div> </div> <div class="wrap"> <div class="hero"> <div> <h1>Ads Scripts & Directlinks</h1> <p> Save ad code in database and include anywhere using: <span style="font-family:var(--mono);font-weight:950">ads_render('head')</span> / <span style="font-family:var(--mono);font-weight:950">ads_render('body_bottom')</span> and <span style="font-family:var(--mono);font-weight:950">ads_directlink('popunder')</span>. </p> </div> <div class="kpis"> <div class="kpi">Showing <b><?= (int)$showCount ?></b> / <b><?= (int)$totalCount ?></b></div> <div class="kpi">Placement: <b><?= $placeFilter !== '' ? e($placeFilter) : 'All' ?></b></div> <div class="kpi">Type: <b><?= $typeFilter !== '' ? e($typeFilter) : 'All' ?></b></div> </div> </div> <?php if ($ok): ?><div class="msg ok"><?= e($ok) ?></div><?php endif; ?> <?php if ($err): ?><div class="msg err"><?= e($err) ?></div><?php endif; ?> <div class="grid"> <!-- LEFT: Editor --> <div class="card"> <div class="card-head"> <div> <div class="title">🧩 Editor</div> <div class="sub"><?= $edit ? ('Editing ID #' . (int)$editId) : 'Create a new ad entry' ?></div> </div> <div class="mini-actions"> <?php if ($edit): ?> <span class="tag tag-blue">ID <?= (int)$editId ?></span> <?php endif; ?> </div> </div> <div class="card-body"> <form method="post" id="adForm"> <input type="hidden" name="action" value="save"> <input type="hidden" name="id" value="<?= (int)($edit['id'] ?? 0) ?>"> <div class="row2"> <div> <label>Placement</label> <select name="placement" id="placement" required> <?php foreach ($placements as $p): ?> <option value="<?= e($p) ?>" <?= ($p === $curPlacement) ? 'selected' : '' ?>><?= e($p) ?></option> <?php endforeach; ?> </select> <div class="help">Use same key in <span style="font-family:var(--mono)">ads_render('...')</span></div> </div> <div> <label>Type</label> <select name="ad_type" id="ad_type"> <option value="script" <?= ($curType === 'script') ? 'selected' : '' ?>>Script / HTML</option> <option value="direct" <?= ($curType === 'direct') ? 'selected' : '' ?>>Directlink URL</option> </select> <div class="help">Directlink returns URL from DB (no script).</div> </div> </div> <div class="row2" style="margin-top:10px"> <div> <label>Provider</label> <input name="provider" id="provider" value="<?= e((string)($edit['provider'] ?? '')) ?>" placeholder="hiltop / adcash / other"> </div> <div> <label>Name (label)</label> <input name="name" id="name" value="<?= e((string)($edit['name'] ?? '')) ?>" placeholder="Example: Hilltop Popunder"> </div> </div> <div class="row3" style="margin-top:10px"> <div> <label>Active</label> <select name="is_active" id="is_active"> <option value="1" <?= ($curActive === 1) ? 'selected' : '' ?>>Yes</option> <option value="0" <?= ($curActive === 0) ? 'selected' : '' ?>>No</option> </select> </div> <div> <label>Sort Order</label> <input name="sort_order" id="sort_order" type="number" value="<?= (int)($edit['sort_order'] ?? 10) ?>" min="0" max="9999"> </div> <div style="display:flex;align-items:end;justify-content:flex-end"> <button class="btn btn-primary" type="submit">💾 Save</button> </div> </div> <div style="margin-top:12px" id="directWrap"> <label>Direct URL (Directlink type)</label> <input name="direct_url" id="direct_url" value="<?= e((string)($edit['direct_url'] ?? '')) ?>" placeholder="https://example.com/...."> <div class="help"> Will be used by <span style="font-family:var(--mono)">ads_directlink('placement')</span>. You can also open it on first click. </div> <div class="mini-actions" style="margin-top:10px;justify-content:flex-start"> <button class="btn btn-sm" type="button" id="testOpenBtn">🔗 Test open</button> <span class="tag tag-amber">Opens in new tab</span> </div> </div> <div style="margin-top:12px" id="scriptWrap"> <label>Script / HTML (Script type)</label> <textarea name="script" id="script_box" placeholder="Paste your Hilltop / Adcash script here..."><?= e((string)($edit['script'] ?? '')) ?></textarea> <div class="warn">⚠️ This will be output RAW on your site. Make sure only trusted admins can edit this page.</div> </div> </form> </div> </div> <!-- RIGHT: List --> <div class="card"> <div class="card-head"> <div> <div class="title">📚 Saved Ads</div> <div class="sub">Filter, edit, delete — scripts + directlinks</div> </div> <div class="mini-actions"> <span class="tag"><?= (int)$showCount ?> shown</span> <span class="tag tag-blue"><?= (int)$totalCount ?> total</span> </div> </div> <form class="filters" method="get"> <input class="search" type="text" name="q" value="<?= e($q) ?>" placeholder="Search name / provider / placement..."> <select name="place"> <option value="">All placements</option> <?php foreach ($placements as $p): ?> <option value="<?= e($p) ?>" <?= ($placeFilter === $p) ? 'selected' : '' ?>><?= e($p) ?></option> <?php endforeach; ?> </select> <select name="type"> <option value="">All types</option> <option value="script" <?= ($typeFilter === 'script') ? 'selected' : '' ?>>script</option> <option value="direct" <?= ($typeFilter === 'direct') ? 'selected' : '' ?>>direct</option> </select> <button class="btn btn-sm" type="submit">🔎 Filter</button> <button class="btn btn-sm" type="button" onclick="location.href='manage_ads.php'">✖ Reset</button> </form> <div class="table-wrap"> <table> <thead> <tr> <th style="min-width:70px">ID</th> <th>Placement</th> <th>Type</th> <th>Active</th> <th style="min-width:140px">Provider</th> <th class="name-cell">Name</th> <th style="min-width:100px">Order</th> <th style="min-width:230px">Value</th> <th style="min-width:170px"></th> </tr> </thead> <tbody> <?php if (empty($filtered)): ?> <tr> <td colspan="9" class="muted" style="padding:16px"> No ads found. Click <b>New</b> to add your first script or directlink. </td> </tr> <?php else: foreach ($filtered as $r): ?> <?php $id = (int)($r['id'] ?? 0); $placement = (string)($r['placement'] ?? ''); $type = (string)($r['ad_type'] ?? 'script'); $active = (int)($r['is_active'] ?? 0); $provider = (string)($r['provider'] ?? ''); $name = (string)($r['name'] ?? ''); $order = (int)($r['sort_order'] ?? 10); $val = ''; if ($type === 'direct') $val = (string)($r['direct_url'] ?? ''); else { $s = (string)($r['script'] ?? ''); $val = (strlen($s) > 160) ? (substr($s, 0, 160) . '…') : $s; } ?> <tr> <td><b>#<?= $id ?></b></td> <td><?= badge($placement, 'blue') ?></td> <td><?= $type === 'direct' ? badge('direct', 'amber') : badge('script', 'gray') ?></td> <td><?= $active ? badge('active', 'green') : badge('off', 'red') ?></td> <td><?= e($provider) ?></td> <td class="name-cell"><?= e($name) ?></td> <td><?= (int)$order ?></td> <td class="mono"><?= e($val) ?></td> <td> <div class="row-actions"> <button class="btn btn-sm" type="button" onclick="location.href='manage_ads.php?edit=<?= $id ?>'">✏️ Edit</button> <form method="post" style="margin:0" onsubmit="return confirm('Delete this ad entry?')"> <input type="hidden" name="action" value="delete"> <input type="hidden" name="id" value="<?= $id ?>"> <button class="btn btn-sm btn-danger" type="submit">🗑 Delete</button> </form> </div> </td> </tr> <?php endforeach; endif; ?> </tbody> </table> </div> <div style="padding:12px 14px" class="muted"> Tip: For multiple scripts in same placement, use Sort Order (lower = first). </div> </div> </div> <div class="footer">© <?= date('Y') ?> Manage Ads</div> </div> <script> (function() { // Theme persist const root = document.documentElement; const btn = document.getElementById('themeBtn'); const saved = localStorage.getItem('mp_theme'); if (saved) root.setAttribute('data-theme', saved); btn && btn.addEventListener('click', () => { const cur = root.getAttribute('data-theme') === 'dark' ? 'dark' : 'light'; const next = cur === 'dark' ? 'light' : 'dark'; root.setAttribute('data-theme', next); localStorage.setItem('mp_theme', next); }); // Type switch const typeSel = document.getElementById('ad_type'); const directWrap = document.getElementById('directWrap'); const scriptWrap = document.getElementById('scriptWrap'); const urlInp = document.getElementById('direct_url'); const scriptBox = document.getElementById('script_box'); const testBtn = document.getElementById('testOpenBtn'); function syncType() { const t = (typeSel && typeSel.value) ? typeSel.value : 'script'; const isDirect = (t === 'direct'); if (directWrap) directWrap.style.display = isDirect ? '' : 'none'; if (scriptWrap) scriptWrap.style.display = isDirect ? 'none' : ''; if (urlInp) urlInp.disabled = !isDirect; if (scriptBox) scriptBox.disabled = isDirect; } if (typeSel) typeSel.addEventListener('change', syncType); syncType(); // Test open direct url if (testBtn) { testBtn.addEventListener('click', () => { const url = (urlInp && urlInp.value) ? urlInp.value.trim() : ''; if (!url) { alert('Direct URL is empty.'); return; } window.open(url, '_blank', 'noopener,noreferrer'); }); } })(); </script> </body> </html>
Close