Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.23 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head lang="en">
  4. <meta charset="UTF-8">
  5. <title>Airplane - My Files</title>
  6. <!-- Latest compiled and minified CSS -->
  7. <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css">
  8. <link href="Style/Styles.css" rel="stylesheet" />
  9. <script src="JS/jquery.js"></script>
  10. <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
  11. <script>
  12. $(document).ready(function() {
  13.  
  14.  
  15.  
  16. function loadFileList() {
  17.  
  18.  
  19. $.getJSON(
  20. "database.php?f=getFileList", function (response) {
  21.  
  22. console.log(response);
  23.  
  24. if (response.code == 999) {
  25. alert('You need to log in first');
  26. window.location.href = "Main.html";
  27.  
  28. } else {
  29.  
  30. console.log('db');
  31.  
  32. console.log(response.data);
  33. createMyFileList(response.data);
  34. }
  35. });
  36. }
  37. loadFileList();
  38.  
  39.  
  40. function createMyFileList(data) {
  41.  
  42. var myhtml="";
  43.  
  44. for (var i=0; i<data.file_list.length; i++) {
  45.  
  46. //if (data[0]==="."||data[0]==="..") continue;
  47.  
  48.  
  49.  
  50. myhtml+='<li><a href="download.php?d=files/'+data.user_id+'/'+data.file_list[i]+'">'+data.file_list[i]+'</a> <a href="database.php?f=deleteFile&file='+data.file_list[i]+'" class="btn delete-btn">Delete</a></li>';
  51.  
  52.  
  53.  
  54. }
  55. $('#files').html(myhtml);
  56.  
  57. $('.delete-btn').click(function(e) {
  58.  
  59. e.preventDefault();
  60. var href=$(this).attr('href');
  61.  
  62. if (confirm("wanna delete this file?")) {
  63. $.get(href).success(function() {
  64.  
  65. });
  66.  
  67. loadFileList();//reload file list
  68.  
  69. }
  70.  
  71.  
  72. });
  73. }
  74.  
  75. });
  76.  
  77.  
  78.  
  79.  
  80. </script>
  81.  
  82. <style>
  83. h2 {
  84. text-align: center;
  85. color: white;
  86. text-shadow: -1px -1px 0 #000, 1px -1px 0 #000, -1px 1px 0 #000, 1px 1px 0 #000;
  87. }
  88. #menu {
  89. width: 66px;
  90. }
  91. .bigger {
  92. font-size: 35px;
  93. margin: 10px;
  94. color: white;
  95. }
  96. .bigger:hover, .bigger:focus {
  97. color: #3399FF;
  98. }
  99. .bigger2 {
  100. font-size: 35px;
  101. color: #3399FF;
  102. }
  103. body {
  104. background: url(1406961364489.png);
  105. background-position: center center;
  106. background-attachment: fixed!important;
  107. background-size: cover;
  108. }
  109. button {
  110. background: transparent!important;
  111. border: none!important;
  112.  
  113. }
  114. #containereins {
  115. background: url(opac_50.png)!important;
  116. width: 40%;
  117. height: 150px;
  118. margin: 0 auto;
  119. margin-top: 6%;
  120. margin-bottom: 6%;
  121. border: 20px solid;
  122. border-radius: 5px;
  123. border-color: transparent;
  124. }
  125. #containerzwei {
  126. background: url(opac_50.png)!important;
  127. width: 40%;
  128. height: 300px;
  129. margin: 0 auto;
  130. border: 2px solid;
  131. border-radius: 5px;
  132. border-color: transparent;
  133. }
  134. #containerdrei {
  135. background: url(opac_50.png)!important;
  136. border: 2px solid;
  137. border-radius: 5px;
  138. border-color: transparent;
  139. float:left;
  140. width:20%;
  141. height:600px;
  142. position:fixed;
  143. top:80px;
  144. left:80px;
  145. }
  146.  
  147. #containervier{
  148. background: url(opac_50.png)!important;
  149. border: 2px solid;
  150. border-radius: 5px;
  151. border-color: transparent;
  152. float:right;
  153. width:20%;
  154. height:600px;
  155. position:fixed;
  156. top:80px;
  157. right:80px;
  158. }
  159. #menu{
  160. position:fixed;
  161. width:300px;
  162. top:10px;
  163. }
  164. </style>
  165. </head>
  166.  
  167. <body>
  168. <div id="menu">
  169. <a href="Main.html">
  170. <button><i class="glyphicon glyphicon-home bigger"></i></span> </button>
  171. </a> <a href="UserMainStorage.html">
  172. <button>
  173. <div class="file-icon"> <span class="glyphicon glyphicon-folder-close bigger"></span></div>
  174. </button>
  175. </a> <a href="logout.php">
  176. <button> <span class="glyphicon glyphicon-log-out bigger"></span></button>
  177. </a>
  178. </div>
  179. <div id="containereins">
  180. <fieldset>
  181. <h2>Upload File</h2>
  182. <form method="post" action="database.php?f=uploadFile" enctype="multipart/form-data">
  183.  
  184. <input type="hidden" name="MAX_FILE_SIZE" value="100000" />
  185. <input type="file" name="myFile" />
  186.  
  187. </p>
  188. <p>
  189. <input type="submit" name="submit" value="Start upload" />
  190. </p>
  191. </form>
  192. </fieldset>
  193. </div>
  194. <div id="containerzwei">
  195. <fieldset>
  196. <h2>My Files</h2>
  197. </fieldset>
  198. </div>
  199.  
  200. <div id="containerdrei">
  201. <fieldset>
  202. <h2>Directory</h2>
  203.  
  204. <ul id="files">
  205. <!--list of files go here-->
  206. <!-- <li>[filename] Delete</li>-->
  207. </ul>
  208.  
  209.  
  210. </fieldset>
  211. </div>
  212.  
  213. <div id="containervier">
  214. <h2>File Options</h2>
  215. </div>
  216. </body>
  217. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement