Advertisement
droidus

Untitled

Jun 13th, 2011
173
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.58 KB | None | 0 0
  1. <?php
  2. if (!isset($_SESSION))
  3. {
  4. session_start();
  5. }
  6. ?>
  7. <?php
  8. include('../Connections/uploader.php');
  9. ?>
  10. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  11. <html xmlns="http://www.w3.org/1999/xhtml">
  12. <head>
  13. <style>
  14. a:link {
  15. text-decoration: none;
  16. }
  17. a:visited {
  18. text-decoration: none;
  19. }
  20. a:hover {
  21. text-decoration: underline;
  22. }
  23. a:active {
  24. text-decoration: none;
  25. }
  26. .pagecontent{
  27. margin-left:auto;
  28. margin-right:auto;
  29. width:500px;
  30. }
  31. </style>
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  33. <title>Untitled Document</title>
  34. </head>
  35. <body>
  36. <?php require_once('http://www.domain.com/header.php'); ?>
  37. <div class="pagecontent">
  38. <h3>Your Account Stats:
  39. <?php
  40. mysql_select_db($database_uploader, $uploader);
  41. $query = "SELECT * FROM members WHERE uname='$loginUsername'";
  42. $result = mysql_query($query) or die(mysql_error());
  43. if (mysql_num_rows($result) > 0) {
  44. $row = mysql_fetch_array($result) or die(mysql_error());
  45. if (($row['acntStatus']) == 0) { // If account is OK
  46. echo "<img src='http://www.domain.com/Images/ok_checkmark_green.png' width='20' height='20' /> OK</h3>";
  47. mysql_close($result);
  48. }
  49. else { // If account is NOT OK
  50. echo "<img src='http://www.domain.com/Images/x.png' width='20' height='20' /> BAD</h3><a href='myaccount.php'>Fix this issue</a>. Contact us for more information. If your account is not fixed soon, there will be a temporary ban on it.";
  51. mysql_close($result);
  52. }
  53. }
  54. ?>
  55. <p>Total storage space:</p>
  56. <?php
  57. print("this is the begining");
  58.  
  59. print("<br><TABLE border=1 cellpadding=5 cellspacing=0>\n");
  60. print("<TR><TH>File Name</TH><th>File Size</th><th>Delete File?</th></TR>\n");
  61. print("<form action=\"\" method=\"post\" id=\"deleteFiles\" name=\"deleteFiles\" >");
  62. if ($handle = opendir('.')) {
  63. while (false !== ($file = readdir($handle))) {
  64.  
  65. if ($file != "." && $file != ".." && (!(is_dir($file)))) {
  66. print("<TR><TD>");
  67. if ((pathinfo($file, PATHINFO_EXTENSION)) == "mp4")
  68. {
  69. $_SESSION['videoFile'] = $_SESSION['user']."/".$file;
  70. echo "<a href=\"../../video/play.php\" target='_blank'>$file</a>\n\n"; // GOOD
  71. }
  72. else
  73. {
  74. echo "<a href=\"/$file\">$file</a>\n";
  75. }
  76. print("</td><td>");
  77. $fileSize = round(((filesize($file))/1024/1024),4);
  78. echo $fileSize." MB <br>";
  79. $count += 1;
  80. $usedStorage = $fileSize + $usedStroage;
  81. print("</td>");
  82. print ("<td align=\"center\"><input name=\"\" type=\"checkbox\" value=\"$file\" /></td>");
  83. }
  84. print("</tr>");
  85. }
  86. closedir($handle);
  87. print("<input name=\"submitDeletedFiles\" type=\"button\" value=\"Submit\" /></form>");
  88. }
  89.  
  90. $MBAmount = 250;
  91. Print ("<br>You currently have uploaded $count files.<br><br>");
  92. $usagePercent = round($usedStorage/$MBAmount, 4);
  93. print("this is the end...");
  94. ?>
  95. <div id="outerPercentContainer" style="width: 500px; background-color:#FFF; border: 2px #000000 solid; position:relative;">
  96. <div id="actualPercentage" style="width: <?php echo $usagePercent; ?>%; background-color:#09F; font-weight:bold;">
  97. <div id="percentageText" style="text-align:center; width:500px;"> <?php echo $usagePercent."% of 250 MB"; ?></div>
  98. </div>
  99. </div>
  100. <?
  101. $acntstorageused = ($acntstorage / 524288000); // bytes=>MB
  102. $usagePercent = round($acntstorageused, 2); // round the decimal for the percentage
  103. $mb = number_format($acntstorage/524288000); // right now, bytes => MB
  104. ?>
  105. <br />
  106. <?php require_once('http://www.domain.com/footer.php'); ?></div>
  107. </body>
  108. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement