| Server IP : 69.72.244.102 / Your IP : 216.73.216.164 Web Server : LiteSpeed System : Linux s3434.fra1.stableserver.net 4.18.0-513.24.1.lve.2.el8.x86_64 #1 SMP Fri May 24 12:42:50 UTC 2024 x86_64 User : konzalta ( 1271) PHP Version : 7.4.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/konzalta/soko.chat/admin/ |
Upload File : |
<?php
require_once __DIR__ . '/../app/auth.php'; require_admin();
if($_SERVER['REQUEST_METHOD']==='POST'){$stmt=$pdo->prepare("UPDATE deals SET status=? WHERE id=?");$stmt->execute([$_POST['status'],(int)$_POST['deal_id']]);flash('success','Updated.');redirect(ADMIN_URL.'/deals.php');}
$deals=$pdo->query("SELECT d.*, c.name county_name, cat.name category_name FROM deals d LEFT JOIN counties c ON c.id=d.county_id LEFT JOIN categories cat ON cat.id=d.category_id ORDER BY d.created_at DESC LIMIT 300")->fetchAll();
?>
<!doctype html><html><head><meta charset="utf-8"><title>Deals</title><link rel="stylesheet" href="<?= e(APP_URL) ?>/assets/css/style.css"></head><body><?php include __DIR__.'/partials_header.php'; ?><div class="wrap"><h2>deals</h2><?php if($m=flash('success')):?><div class="alert"><?= e($m) ?></div><?php endif; ?><table class="table"><tr><th>deal</th><th>county/category</th><th>analytics</th><th>fee</th><th>status</th></tr><?php foreach($deals as $d):?><tr><td><strong><?= e($d['title']) ?></strong><br><?php if($d['status']==='published'):?><a target="_blank" href="<?= e(APP_URL) ?>/deal.php?slug=<?= e($d['slug']) ?>">view</a><?php endif; ?><br><span class="muted"><?= e($d['pricing_reason']) ?></span></td><td><?= e($d['county_name']) ?><br><?= e($d['category_name']) ?></td><td>views <?= e($d['views_count']) ?><br>attempts <?= e($d['unlock_attempts_count']) ?><br>unlocks <?= e($d['unlocks_count']) ?></td><td>Ksh <?= e($d['unlock_fee']) ?><br><span class="muted">rec <?= e($d['recommended_unlock_fee']) ?></span></td><td><form method="post"><input type="hidden" name="deal_id" value="<?= e($d['id']) ?>"><select name="status"><?php foreach(['pending','published','rejected','expired','flagged'] as $s):?><option <?= $d['status']===$s?'selected':'' ?>><?= e($s) ?></option><?php endforeach;?></select><button class="button">update</button></form></td></tr><?php endforeach;?></table></div></body></html>