File manager - Edit - /home/cipherteam/htdocs/cipherteam.in/APPS/CronJobs/Kfintech/kfin_list_view.php
Back
<?php ini_set('display_errors', 1); error_reporting(E_ALL); /* ---------- CONFIG ---------- */ // Node binary (Node 18) $NODE = "/usr/bin/node"; // JS file $JS_FILE = __DIR__ . "/kfin_fetch_ipo_list.js"; /* ---------- EXECUTE NODE ---------- */ $cmd = escapeshellcmd($NODE) . " " . escapeshellarg($JS_FILE) . " 2>&1"; $output = shell_exec($cmd); if (!$output) { die("ERROR: Node output empty"); } $data = json_decode(trim($output), true); if (!$data || empty($data['ok'])) { echo "<pre>Error from Node:\n"; print_r($output); echo "</pre>"; exit; } $options = $data['options'] ?? []; /* ---------- HELPER ---------- */ function slugify($text) { $text = strtolower(trim($text)); $text = preg_replace('/[^a-z0-9]+/', '-', $text); return trim($text, '-'); } ?> <!DOCTYPE html> <html> <head> <title>KFintech IPO List</title> <meta charset="utf-8"> <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"> </head> <body class="bg-light"> <div class="container mt-4"> <h3 class="mb-3">KFintech – Select IPO List</h3> <div class="card shadow-sm"> <div class="card-body p-0"> <table class="table table-bordered table-hover mb-0"> <thead class="table-dark"> <tr> <th width="60">#</th> <th>IPO Name</th> <th width="35%">Data Value</th> </tr> </thead> <tbody> <?php if (count($options) === 0): ?> <tr> <td colspan="3" class="text-center text-muted">No IPOs found</td> </tr> <?php else: ?> <?php $i = 1; foreach ($options as $row): // Force valid structure if (!is_array($row)) continue; $name = isset($row['name']) && is_string($row['name']) ? $row['name'] : ''; $value = isset($row['value']) && is_string($row['value']) ? $row['value'] : ''; if ($name === '' || $value === '') continue; ?> <tr> <td><?= $i++; ?></td> <td><?= htmlspecialchars($name, ENT_QUOTES, 'UTF-8'); ?></td> <td class="fw-bold text-primary"> <?= htmlspecialchars($value, ENT_QUOTES, 'UTF-8'); ?> </td> </tr> <?php endforeach; ?> <?php endif; ?> </tbody> </table> </div> </div> <p class="mt-3 text-muted"> Total IPOs: <strong><?= count($options); ?></strong> </p> </div> </body> </html>
| ver. 1.4 |
Github
|
.
| PHP 8.2.9 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings