Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require 'CreateTables.php';
- require 'db_connection.php';
- $tableName = 'providerInfo';
- $getProvider = "SELECT * FROM $tableName";
- $statement = $conn->prepare($getProvider);
- $statement->execute();
- $results = $statement->fetchAll(PDO::FETCH_ASSOC);
- $number_of_rows = $statement->rowCount();
- $tableName = 'setting';
- $getProvider = "SELECT * FROM $tableName ORDER BY reg_date DESC";
- $statement = $conn->prepare($getProvider);
- $statement->execute();
- $refresh = $statement->fetch(PDO::FETCH_ASSOC);//print_r($refresh);
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <?php include('includes/head.php'); ?>
- </head>
- <body>
- <?php include('includes/navbar.php') ?>
- <div class="container-fluid" style="background: #ffffff">
- <div class="panel panel-primary">
- <div class="panel-heading">
- Status
- </div>
- <div class="panel-body">
- <table id="example" class="table table-striped table-bordered" cellspacing="0" width="100%">
- <thead>
- <th>#</th>
- <th>0</th>
- <th>Status</th>
- <th>Supplier</th>
- <th>Host & Port</th>
- <th>Username</th>
- <th>Password</th>
- <th>Expire date</th>
- <th>Connections</th>
- <th>Notes</th>
- <th>Downloads</th>
- </thead>
- <tbody>
- <?php
- $i = 1;
- foreach ($results as $provider) {
- /*$host_name = "http://ss1.slykdns.com:5005";
- $username = "freelancer";
- $password = "password";*/
- $host_name = $provider['host_port'];
- $username = $provider['username'];
- $password = $provider['password'];
- $result = getValue($host_name, $username, $password);
- if ($result->auth == 0) {
- echo '<div class="alert alert-warning">
- Authenticate Failed for this user:' . $username . '
- </div>';
- continue;
- }
- ?>
- <tr>
- <td><?php echo $i++; ?></td>
- <td><?php
- if ($result->status == "Active") {
- echo '<strong> <p class="text-success">ON</p></strong>';
- } else {
- echo '<strong> <p class="text-danger">OFF</p></strong>';
- }
- ?>
- </td>
- <td><?php
- if ($result->status == "Active") {
- echo '<strong> <p class="text-success">Enabled</p></strong>';
- } else {
- echo '<strong> <p class="text-danger">Disable</p></strong>';
- }
- ?></td>
- <td><?php echo $provider['provider_name']; ?></td>
- <td><?php echo $provider['host_port'] ?></td>
- <td><?php echo $result->username; ?></td>
- <td><?php echo $result->password; ?></td>
- <td><?php echo(date("d/m/Y h:i:s A T", $result->exp_date)); ?></td>
- <td><?php echo $result->active_cons . "/ ";
- echo $result->max_connections; ?></td>
- <td><?php $provider['notes'] ?></td>
- <td>
- <a class="btn btn-success"
- href="<?php echo $host_name . '/get.php?username=' . $username . '&password=' . $password . '&type=m3u&output=ts'; ?>">Download</a>
- <a class="btn btn-info"
- href="<?php echo $host_name . '/get.php?username=' . $username . '&password=' . $password . '&type=m3u&output=m3u8'; ?>">Download</a>
- </td>
- </tr>
- <?php
- }
- ?>
- </tbody>
- </table>
- </div>
- </div>
- </div>
- <div class="footer">
- <div class="container">
- Copyright
- </div>
- </div>
- </body>
- <script>
- $(document).ready(function () {
- $('#example').DataTable();
- });
- </script>
- </html>
- <?php
- function getValue($host_name, $username, $password)
- {
- $url = $host_name . "/" . "player_api.php?username=" . $username . "&password=" . $password;
- //$url = 'test.json'; // path to your JSON file
- $data = file_get_contents($url); // put the contents of the file into a variable
- $characters = json_decode($data); // decode the JSON feed
- foreach ($characters as $character) {
- //print_r($character);
- //echo $character->auth;
- return $character;
- break;
- }
- return 0;
- }
- $value = $refresh['page_refresh_time'];//echo $value;
- ?>
- <script>
- setTimeout(function () {
- window.location.reload(1);
- }, <?php echo $value;?>);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement