index.php 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <html>
  2. <meta name="viewport" content="width=device-width, initial-scale=1">
  3. <head>
  4. <title>Quick Send</title>
  5. <link rel="stylesheet" href="tocas.css">
  6. <script type="text/javascript" src="urlfix.js"></script>
  7. </head>
  8. <body>
  9. <?php
  10. if (isset($_GET['rx']) && $_GET['rx'] != ""){
  11. header("Location: display.php?id=" . $_GET['rx']);
  12. die();
  13. }
  14. ?>
  15. <div class="ts inverted heading fluid slate" style="background-color:#2c2835;color:white;">
  16. <span class="large header">Quick Send System</span>
  17. <span class="description">Send data between mobile and laptops.<br> Powered by IMUS Laboratory</span>
  18. <div class="ts bottom attached tabbed menu" style="color:white;">
  19. <a class="active item" href="index.php">Send</a>
  20. <a class="item" href="rx.php" style="color:#9d9ca3;">Receive</a>
  21. <a class="item" href="img.php" style="color:#9d9ca3;">Image</a>
  22. <a class="item" href="file.php" style="color:#9d9ca3;">Files</a>
  23. </div>
  24. </div>
  25. <div class="ts container">
  26. <br><br>
  27. <div class="ts stackable grid">
  28. <div class="four wide column" align="center">
  29. <div id="output"></div>
  30. <div class="ts small statistic">
  31. <div class="label">QuickSend ID</div>
  32. <div class="value" id="sid"><?php
  33. $max = 0;
  34. foreach (new DirectoryIterator('Memo/') as $fileInfo) {
  35. if ($fileInfo->isDot()) continue;
  36. $current = pathinfo($fileInfo->getFilename())['filename'];
  37. if (!is_numeric($current)) continue;
  38. if ($current > $max) $max = $current;
  39. }
  40. echo $max+1;
  41. ?></div>
  42. </div>
  43. </div>
  44. <div class="twelve wide column">
  45. <div class="ts fluid input" style="height:250px">
  46. <textarea id="textholder" placeholder="Text to be sent via QRcode."></textarea>
  47. </div><br><br>
  48. <div class="ts container" align="right">
  49. <button class="ts tiny basic button" onclick="senddata()">Generate QR-Code</button>
  50. </div>
  51. </div>
  52. </div>
  53. <div class="ts horizontal divider">Latest QuickSend code</div>
  54. <div class="ts stackable fluid horizontal list">
  55. <?php
  56. $max = 0;
  57. foreach (new DirectoryIterator('Memo/') as $fileInfo) {
  58. if ($fileInfo->isDot()) continue;
  59. $current = pathinfo($fileInfo->getFilename())['filename'];
  60. if (!is_numeric($current)) continue;
  61. if ($current > $max) $max = $current;
  62. }
  63. $number = 10;
  64. if ($max < 10){
  65. $number = $max;
  66. }
  67. for( $i = 0; $i <= $number; $i++){
  68. echo "<div class='ts label'><a class='item' onCLick='rx(" . ($max - $i) . ");'>QSCODE#" . ($max - $i) . "</a></div>";
  69. }
  70. ?>
  71. </div>
  72. <br><br><br><br><br><br>
  73. <div style="position: fixed;
  74. z-index: 100;
  75. bottom: 0;
  76. left: 0;
  77. width: 100%;
  78. background-color:#2c2835;
  79. color:white;">
  80. <div class="ts container">
  81. <img class="ts tiny right floated image" src="img/cube.png"></img>
  82. </div>
  83. <div align="left" class="ts container">
  84. <br>
  85. CopyRight IMUS Laboratory 2018, All right reserved.
  86. </div>
  87. </div>
  88. </div>
  89. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
  90. <script type="text/javascript" src="jquery.qrcode.min.js"></script>
  91. <script>
  92. jQuery(function(){
  93. jQuery('#output').qrcode("Hello World");
  94. })
  95. function senddata(){
  96. textarea = $('#textholder').val();
  97. $.ajax({
  98. type: "POST",
  99. url: "StickMemo.php",
  100. data:{ content: textarea },
  101. success: function(data){
  102. //alert(data);
  103. $("#output").empty();
  104. jQuery('#output').qrcode("http://imuslab.com/qs/display.php?id=" + data);
  105. $("#sid").html(data);
  106. }
  107. })
  108. }
  109. $(document).ready(function(){
  110. });
  111. function rx(id){
  112. top.location.href = "http://imuslab.com/qs/display.php?id=" + id;
  113. }
  114. </script>
  115. </body>
  116. </html>