Advertisement
Guest User

Untitled

a guest
May 16th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.92 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require 'link.php';
  4. require 'req.php';
  5. ini_set('error_reporting', E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED);
  6.  
  7. @$user = $_SESSION['user'];
  8. if(@$_POST['rmv']){
  9.     $cn = fopen($dir1.'/'.$user.'.log', 'w');
  10.     fwrite($cn, '');
  11.     fclose($cn);
  12. }
  13. @$pass = $_SESSION['pass'];
  14. if($user and $pass){
  15.     if(checkLogin($user, $pass, $dir2)){
  16.         $loggedin = true;
  17.     }else{
  18.         header("Location: index.php");
  19.         die;
  20.     }
  21. }else{
  22.     header("Location: index.php");
  23.     die;
  24. }
  25. if(@$_SESSION['error'] == '1'){
  26.     $error = '<div id="closer" class="alert alert-dismissible alert-danger">
  27.         <button type="button" onClick="document.getElementById(\'closer\').style.display = \'none\';"class="close" data-dismiss="alert">&times;</button>
  28.         <strong>Oh snap!</strong> It looks like something went wrong.
  29.     </div>';
  30. }elseif(@$_SESSION['error'] == '2'){
  31.     $error = '<div id="closer" class="alert alert-dismissible alert-danger">
  32.         <button type="button" onClick="document.getElementById(\'closer\').style.display = \'none\';"class="close" data-dismiss="alert">&times;</button>
  33.         <strong>Oh snap!</strong> It looks like you don\'t have enough funds.  Add some!
  34.     </div>';
  35. }
  36. ?>
  37.  
  38. <html>
  39.   <head>
  40.     <title>Order History</title>
  41.     <?php
  42.     include 'head.php';
  43.     ?>
  44.   </head>
  45.   <body>
  46.     <center>
  47.     <?php require 'navbar.php';  echo @$error;?>
  48.  
  49. <table style="width:80%; max-width:80%;" class="table table-striped table-hover ">
  50.   <thead>
  51.     <tr>
  52.       <th>#</th>
  53.       <th>Order #</th>
  54.       <th>Link</th>
  55.       <th>Status</th>
  56.       <th>Time - H:M:S</th>
  57.       <th>Info</th>
  58.     </tr>
  59.   </thead>
  60.   <tbody>
  61.   <?php
  62.   $file = file_get_contents($dir1.'/'.$_SESSION['user'].'.log');
  63.  
  64.   $exp = explode('`', $file);
  65.   $x = 0;
  66.   $tabel = '';
  67.   if($exp){
  68.       foreach($exp as $test){
  69.           if($test <> null){
  70.               $x++;
  71.               $expl = explode('-', $test);
  72.               $time = $_SERVER['REQUEST_TIME']-$expl[2];
  73.               $time = gmdate("H:i:s", $time);
  74.               if(strlen($expl[1]) > 75){
  75.                   $expl[1] = substr($expl[1],0,72).'...';
  76.               }
  77.               $file = json_decode(@file_get_contents('https://musicroot.org/services/api.php?key='.$key.'&order='.$expl[0]));
  78.               if($file->status == false){
  79.                   @$file->status = 'API Error';
  80.               }
  81.               if($file->start_count === '0'){
  82.                   $isDone = 'Not Complete';
  83.               }else{
  84.                   $isDone = 'Worked';
  85.               }
  86.               if($file->status == 'Canceled'){
  87.                   $isDone = 'Failed';
  88.               }
  89.               $tabel .= '<tr>';
  90.               $tabel .= '<td>'.$x.'</td>';
  91.               $tabel .= '<td>'.$expl[0].'</td>';
  92.               $tabel .= '<td>'.$expl[1].'</td>';
  93.               $tabel .= '<td>'.$file->status.'</td>';
  94.               $tabel .= '<td>'.$time.'</td>';
  95.               $tabel .= '<td>'.$isDone.'</td>';
  96.               $tabel .= '</tr>';
  97.           }
  98.       }
  99.   }
  100.   if($tabel){
  101.       echo $tabel;
  102.   }
  103.   ?>
  104.    
  105.   </tbody>
  106. </table>
  107.  
  108. <form method="POST">
  109.     <input type="hidden" value="1" name="rmv">
  110.     <input type="submit" class="btn btn-danger" value="Remove All Entries">
  111. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement