File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/admin3/viewipo.php
Back
<?php include 'config.php'; session_start(); if (!isset($_SESSION['loggedin']) || $_SESSION['loggedin'] !== true) { header("Location: login.php"); exit; } $id = $_GET['id'] ?? null; if (!$id) { die("Invalid IPO ID."); } $stmt = $pdo->prepare("SELECT * FROM ipo_post WHERE id = ?"); $stmt->execute([$id]); $ipo = $stmt->fetch(PDO::FETCH_ASSOC); if (!$ipo) { die("IPO not found."); } function safe($v) { return htmlspecialchars((string)$v, ENT_QUOTES, 'UTF-8'); } function showDMY($dateStr) { if (!$dateStr) return '-'; $ts = strtotime($dateStr); if ($ts === false) return safe($dateStr); return date('d-m-Y', $ts); } function badgeLive($val) { $val = strtoupper((string)$val); return ($val === 'YES') ? '<span class="s-badge s-badge-live">LIVE</span>' : '<span class="s-badge s-badge-notlive">NOT LIVE</span>'; } function badgeStatus($val) { $val = strtoupper((string)$val); if ($val === 'NEW') return '<span class="s-badge s-badge-new">NEW</span>'; if ($val === 'PRESENT') return '<span class="s-badge s-badge-present">PRESENT</span>'; if ($val === 'PAST') return '<span class="s-badge s-badge-past">PAST</span>'; return '<span class="s-badge s-badge-default">'.safe($val).'</span>'; } function badgeType($val) { $val = strtoupper((string)$val); if ($val === 'S') return '<span class="s-badge s-badge-sme">SME</span>'; if ($val === 'M') return '<span class="s-badge s-badge-main">MAINLINE</span>'; return '<span class="s-badge s-badge-default">'.safe($val).'</span>'; } function registrarLabel($url) { $registrars = [ 'https://ipo.bigshareonline.com/IPO_Status.html' => 'Bigshare', 'https://in.mpms.mufg.com/Initial_Offer/public-issues.html' => 'MUFG - Linkintime', 'https://ipostatus.kfintech.com/' => 'KFintech Kosmic', 'https://www.skylinerta.com/ipo.php' => 'Skyline', 'https://ipostatus1.cameoindia.com/' => 'Cameo', 'https://www.purvashare.com/investor-service/ipo-query' => 'Purva', 'https://maashitla.com/allotment-status/public-issues' => 'Maashitla', 'https://www.masserv.com/opt.asp' => 'Mas Services', 'https://www.satellitecorporate.com/ipo-query.php' => 'Satellite Corporate', 'http://ipo.alankit.com/' => 'Alankit', 'https://ipostatus.integratedregistry.in/RegistrarsToSTANew.aspx?od=2' => 'Integrated Registry' ]; return $registrars[$url] ?? 'Allotment Link'; } function kv($label, $value, $mono=false) { $v = ($value === '' || $value === null) ? '-' : $value; $cls = $mono ? 'mono' : ''; return ' <div class="kv-card"> <div class="kv-label">'.$label.'</div> <div class="kv-value '.$cls.'">'.$v.'</div> </div> '; } $img = trim((string)($ipo['img'] ?? '')); $url = trim((string)($ipo['url'] ?? '')); $allot = trim((string)($ipo['allotment'] ?? '')); ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>View IPO — <?= safe($ipo['c_name']) ?></title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet"> <link rel="preconnect" href="https://fonts.googleapis.com"> <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap" rel="stylesheet"> <style> :root { --primary: #4f46e5; --primary-light: #e0e7ff; --primary-dark: #3730a3; --surface: #ffffff; --surface-alt: #f8fafc; --border: #e2e8f0; --text: #1e293b; --text-muted: #64748b; --success: #059669; --success-light: #ecfdf5; --warning: #d97706; --warning-light: #fffbeb; --danger: #dc2626; --danger-light: #fef2f2; --info: #0284c7; --info-light: #f0f9ff; --teal: #0d9488; --teal-light: #f0fdfa; --radius: 12px; --radius-sm: 8px; --shadow-sm: 0 1px 2px rgba(0,0,0,0.05); --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04); --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.04); } * { box-sizing: border-box; } body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; background: #f1f5f9; color: var(--text); min-height: 100vh; margin: 0; padding: 0; } .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; } /* ── Top Bar ── */ .top-bar { background: var(--surface); border-bottom: 1px solid var(--border); padding: 16px 0; position: sticky; top: 0; z-index: 100; box-shadow: var(--shadow-sm); } .top-bar .inner { max-width: 1280px; margin: 0 auto; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; } .brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 20px; color: var(--primary); } .brand-icon { width: 36px; height: 36px; background: var(--primary); color: #fff; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; } .top-actions { display: flex; align-items: center; gap: 10px; } .btn-back { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); padding: 8px 18px; border-radius: var(--radius-sm); font-weight: 500; font-size: 13px; text-decoration: none; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; } .btn-back:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); } .btn-edit-top { background: var(--primary); color: #fff; border: none; padding: 8px 20px; border-radius: var(--radius-sm); font-weight: 600; font-size: 13px; text-decoration: none; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; } .btn-edit-top:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); } /* ── Main ── */ .main-wrap { max-width: 1280px; margin: 0 auto; padding: 24px; } /* ── Hero Banner ── */ .hero-banner { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 28px; margin-bottom: 24px; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; } .hero-left { display: flex; align-items: center; gap: 16px; min-width: 0; } .hero-logo { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--border); object-fit: contain; background: #fff; padding: 4px; flex-shrink: 0; } .hero-logo-placeholder { width: 52px; height: 52px; border-radius: 12px; background: var(--primary-light); color: var(--primary); display: grid; place-items: center; font-size: 24px; flex-shrink: 0; } .hero-name { font-size: 22px; font-weight: 800; color: var(--text); } .hero-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; } /* ── Status Badges ── */ .s-badge { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; } .s-badge-live { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; } .s-badge-notlive { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); } .s-badge-new { background: var(--primary-light); color: var(--primary); border: 1px solid #c7d2fe; } .s-badge-present { background: var(--success-light); color: var(--success); border: 1px solid #a7f3d0; } .s-badge-past { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); } .s-badge-sme { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; } .s-badge-main { background: #dbeafe; color: #1e40af; border: 1px solid #bfdbfe; } .s-badge-default { background: var(--surface-alt); color: var(--text-muted); border: 1px solid var(--border); } .chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 12px; border-radius: 6px; background: var(--surface-alt); border: 1px solid var(--border); font-size: 12px; font-weight: 500; color: var(--text-muted); } .chip strong { color: var(--text); } /* ── Section Card ── */ .sec-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 20px; } .sec-header { padding: 16px 20px; background: var(--surface-alt); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; } .sec-title { font-size: 14px; font-weight: 700; color: var(--text); margin: 0; display: flex; align-items: center; gap: 8px; } .sec-hint { font-size: 12px; color: var(--text-muted); font-weight: 500; } .sec-body { padding: 20px; } /* ── KV Cards ── */ .kv-card { padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-alt); height: 100%; transition: border-color 0.2s; } .kv-card:hover { border-color: #cbd5e1; } .kv-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 4px; } .kv-value { font-size: 14px; font-weight: 600; color: var(--text); } /* ── Text Block ── */ .text-block { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; line-height: 1.65; font-size: 14px; color: var(--text); } /* ── Image Card ── */ .img-preview { background: linear-gradient(45deg, #e2e8f0 25%, transparent 25%), linear-gradient(-45deg, #e2e8f0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #e2e8f0 75%), linear-gradient(-45deg, transparent 75%, #e2e8f0 75%); background-size: 16px 16px; background-position: 0 0, 0 8px, 8px -8px, -8px 0; border-radius: var(--radius-sm); padding: 12px; border: 1px solid var(--border); margin-bottom: 12px; } .img-preview img { border-radius: var(--radius-sm); width: 100%; display: block; } /* ── Link Box ── */ .link-box { background: var(--surface-alt); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; margin-bottom: 12px; } .link-box:last-child { margin-bottom: 0; } .link-box-header { display: flex; justify-content: space-between; align-items: center; gap: 12px; } .link-open-btn { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); color: var(--text-muted); text-decoration: none; font-size: 14px; transition: all 0.2s; flex-shrink: 0; } .link-open-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); } .link-url { font-size: 11px; color: #94a3b8; word-break: break-all; margin-top: 8px; } /* ── Action Card ── */ .action-btn-primary { display: block; width: 100%; padding: 12px; border-radius: var(--radius-sm); background: var(--primary); color: #fff; font-size: 14px; font-weight: 600; text-decoration: none; text-align: center; transition: all 0.2s; border: none; margin-bottom: 8px; } .action-btn-primary:hover { background: var(--primary-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-md); } .action-btn-secondary { display: block; width: 100%; padding: 12px; border-radius: var(--radius-sm); background: var(--surface-alt); color: var(--text-muted); font-size: 14px; font-weight: 600; text-decoration: none; text-align: center; transition: all 0.2s; border: 1px solid var(--border); } .action-btn-secondary:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); } .divider { border: none; border-top: 1px dashed var(--border); margin: 16px 0; } /* ── Responsive ── */ @media (max-width: 768px) { .main-wrap { padding: 16px; } .hero-banner { padding: 18px 20px; } .hero-name { font-size: 18px; } .sec-body { padding: 16px; } .sec-header { padding: 14px 16px; } .hero-right { display: none; } } </style> </head> <body> <!-- Top Bar --> <div class="top-bar"> <div class="inner"> <div class="brand"> <div class="brand-icon">👁️</div> View IPO </div> <div class="top-actions"> <a href="index.php" class="btn-back">← Back to List</a> <a href="editipo.php?id=<?= urlencode($ipo['id']) ?>" class="btn-edit-top">✏️ Edit IPO</a> </div> </div> </div> <div class="main-wrap"> <!-- Hero Banner --> <div class="hero-banner"> <div class="hero-left"> <?php if (!empty($img)): ?> <img src="<?= safe($img) ?>" alt="Logo" class="hero-logo" onerror="this.style.display='none'; this.nextElementSibling.style.display='grid';"> <div class="hero-logo-placeholder" style="display:none;">📊</div> <?php else: ?> <div class="hero-logo-placeholder">📊</div> <?php endif; ?> <div> <div class="hero-name"> <?= safe($ipo['c_name']) ?> <?php if (!empty($ipo['emoji'])): ?> <span style="margin-left:4px;"><?= safe($ipo['emoji']) ?></span> <?php endif; ?> </div> <div class="hero-badges"> <?= badgeLive($ipo['islive']) ?> <?= badgeStatus($ipo['status']) ?> <?= badgeType($ipo['TYPE']) ?> <span class="chip">ID: <strong class="mono"><?= safe($ipo['id']) ?></strong></span> <span class="chip">Key: <strong class="mono"><?= safe($ipo['ipokey']) ?></strong></span> <span class="chip">Rating: <strong><?= safe($ipo['rat']) ?>/10</strong></span> </div> </div> </div> </div> <div class="row g-3"> <!-- LEFT COLUMN --> <div class="col-lg-8"> <!-- Timeline --> <div class="sec-card"> <div class="sec-header"> <p class="sec-title">📅 IPO Timeline</p> <span class="sec-hint">Key dates</span> </div> <div class="sec-body"> <div class="row g-3"> <div class="col-md-6"><?= kv('Issue Date (Text)', safe($ipo['i_date'])) ?></div> <div class="col-md-6"><?= kv('Close Date (Text)', safe($ipo['c_date'])) ?></div> <div class="col-md-6"><?= kv('IPO Open', safe(showDMY($ipo['ipo_open']))) ?></div> <div class="col-md-6"><?= kv('IPO Close', safe(showDMY($ipo['ipo_close']))) ?></div> <div class="col-md-4"><?= kv('Allotment', safe(showDMY($ipo['ipo_allotment']))) ?></div> <div class="col-md-4"><?= kv('Refund', safe(showDMY($ipo['ipo_refund']))) ?></div> <div class="col-md-4"><?= kv('Credit', safe(showDMY($ipo['ipo_credit']))) ?></div> <div class="col-md-6"><?= kv('Listing', safe(showDMY($ipo['ipo_listing']))) ?></div> <div class="col-md-6"><?= kv('Date Note', safe($ipo['date'])) ?></div> </div> </div> </div> <!-- Price & Application --> <div class="sec-card"> <div class="sec-header"> <p class="sec-title">💰 Price & Application</p> </div> <div class="sec-body"> <div class="row g-3"> <div class="col-md-6"><?= kv('Offer Price', safe($ipo['o_price'])) ?></div> <div class="col-md-6"><?= kv('GMP', safe($ipo['GMP'])) ?></div> <div class="col-md-6"><?= kv('Minimum Application', safe($ipo['m_application'])) ?></div> <div class="col-md-6"><?= kv('NO', safe($ipo['NO'])) ?></div> <div class="col-md-6"><?= kv('Suggestion', safe($ipo['suggestion'])) ?></div> <div class="col-md-6"><?= kv('Status', safe($ipo['status'])) ?></div> </div> </div> </div> <!-- Content --> <div class="sec-card"> <div class="sec-header"> <p class="sec-title">📝 Content</p> </div> <div class="sec-body"> <div class="mb-3"> <div class="kv-label" style="margin-bottom:8px;">Details</div> <div class="text-block"> <?= !empty($ipo['details']) ? nl2br(safe($ipo['details'])) : '<span style="color:var(--text-muted);">No details added.</span>' ?> </div> </div> <hr class="divider"> <div> <div class="kv-label" style="margin-bottom:8px;">Subscription</div> <div class="text-block"> <?= !empty($ipo['subscription']) ? nl2br(safe($ipo['subscription'])) : '<span style="color:var(--text-muted);">No subscription info added.</span>' ?> </div> </div> </div> </div> </div> <!-- RIGHT COLUMN --> <div class="col-lg-4"> <!-- Image --> <div class="sec-card"> <div class="sec-header"> <p class="sec-title">🖼️ Image</p> </div> <div class="sec-body"> <?php if (!empty($img)): ?> <div class="img-preview"> <img src="<?= safe($img) ?>" alt="IPO Image" onerror="this.style.display='none'; document.getElementById('img-fallback').classList.remove('d-none');"> <div id="img-fallback" class="d-none" style="text-align:center; padding:20px; color:var(--text-muted); font-size:13px;">Image preview not available</div> </div> <a href="<?= safe($img) ?>" target="_blank" style="display:block; width:100%; padding:10px; border-radius:var(--radius-sm); background:var(--primary-light); color:var(--primary); font-size:13px; font-weight:600; text-decoration:none; text-align:center; transition:all 0.2s; margin-bottom:10px;">Open Image ↗</a> <div class="link-url mono"><?= safe($img) ?></div> <?php else: ?> <div style="text-align:center; padding:24px; color:var(--text-muted); font-size:13px;">No image URL.</div> <?php endif; ?> </div> </div> <!-- Links --> <div class="sec-card"> <div class="sec-header"> <p class="sec-title">🔗 Important Links</p> </div> <div class="sec-body" style="padding:16px;"> <!-- Allotment --> <div class="link-box"> <div class="link-box-header"> <div> <div class="kv-label">Allotment Registrar</div> <div class="kv-value"><?= !empty($allot) ? safe(registrarLabel($allot)) : '-' ?></div> </div> <?php if (!empty($allot)): ?> <a class="link-open-btn" target="_blank" href="<?= safe($allot) ?>" title="Open Allotment">↗</a> <?php endif; ?> </div> <?php if (!empty($allot)): ?> <div class="link-url mono"><?= safe($allot) ?></div> <?php endif; ?> </div> <!-- URL --> <div class="link-box"> <div class="link-box-header"> <div> <div class="kv-label">IPO URL</div> <div class="kv-value"><?= !empty($url) ? 'Available' : '-' ?></div> </div> <?php if (!empty($url)): ?> <a class="link-open-btn" target="_blank" href="<?= safe($url) ?>" title="Open URL">↗</a> <?php endif; ?> </div> <?php if (!empty($url)): ?> <div class="link-url mono" style="white-space:pre-wrap; word-break:break-word;"><?= safe($url) ?></div> <?php endif; ?> </div> </div> </div> <!-- Quick Actions --> <div class="sec-card"> <div class="sec-header"> <p class="sec-title">⚡ Quick Actions</p> </div> <div class="sec-body"> <a href="editipo.php?id=<?= urlencode($ipo['id']) ?>" class="action-btn-primary">✏️ Edit IPO</a> <a href="index.php" class="action-btn-secondary">← Back to List</a> </div> </div> </div> </div> </div> <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings