瀏覽代碼

Updates 2021

tobychui 3 年之前
父節點
當前提交
f561474046
共有 11 個文件被更改,包括 61 次插入46 次删除
  1. 0 1
      Memo/0.txt
  2. 1 1
      Memo/1.txt
  3. 3 3
      display.php
  4. 4 5
      file.php
  5. 1 1
      img.php
  6. 二進制
      img/cube.png
  7. 二進制
      img/cube_legacy.png
  8. 15 10
      index.php
  9. 21 10
      rx.php
  10. 16 15
      upload.php
  11. 二進制
      uploads/Thumbs.db

+ 0 - 1
Memo/0.txt

@@ -1 +0,0 @@
-48656c6c6f20576f726c64210a57656c636f6d6520746f2074686520494d5553204c61626f7261746f7279206f6e6c696e6520736572766963657320736974652e0a0a546f2075736520746869732073657276696365732c20796f75206861766520746f206f70656e20746869732075726c20696e2051522d436f646520666f726d20696620796f7520617265207573696e6720736d6172742064657669636573206c696b6520736d6172742070686f6e65206f72207461626c6574732e0a0a4f72206f74686572776973652c20696620796f752077616e7420746f206f70656e2061207370656369616c204d656d6f207769746820676976656e206964206e756d6265722c20706c6561736520757365207468652052582066756e6374696f6e206f6e20746f702e

+ 1 - 1
Memo/1.txt

@@ -1 +1 @@
-48656c6c6f20576f726c6421205468697320697320746865206669727374206d6573736167652073656e6420746f20517569636b53656e64206166746572207468652073797374656d2072657365742e
+646174613a66696c652f69697874346c676c2e6a7067

+ 3 - 3
display.php

@@ -11,9 +11,9 @@
     <span class="description">Send data between mobile and laptops.<br> Powered by IMUS Laboratory</span>
     <div class="ts bottom attached tabbed menu" style="color:white;">
         <a class="item" href="index.php" style="color:#9d9ca3;">Send</a>
+		<a class="item" href="file.php" style="color:#9d9ca3;">Files</a>
         <a class="item" href="rx.php" style="color:#9d9ca3;">Receive</a>
-        <a class="item" href="img.php" style="color:#9d9ca3;">Image</a>
-        <a class="item" href="file.php" style="color:#9d9ca3;">Files</a>
+        <!-- <a class="item" href="img.php" style="color:#9d9ca3;">Image</a> -->
 		<a class="active item">Display</a>
     </div>
 </div>
@@ -116,7 +116,7 @@
 </div>
 <div align="left" class="ts container">
 <br>
-CopyRight IMUS Laboratory 2018, All right reserved.
+CopyRight IMUS Laboratory 2021, All right reserved.
 </div>
 </div>
 

+ 4 - 5
file.php

@@ -3,7 +3,6 @@
 <head>
 <title>Quick Send</title>
 <link rel="stylesheet" href="tocas.css">
-<script type="text/javascript" src="urlfix.js"></script>
 </head>
 <body>
 <?php
@@ -16,10 +15,10 @@
     <span class="large header">Quick Send System</span>
     <span class="description">Send data between mobile and laptops.<br> Powered by IMUS Laboratory</span>
     <div class="ts bottom attached tabbed menu" style="color:white;">
-        <a class="item" href="index.php" style="color:#9d9ca3;">Send</a>
+		<a class="item" href="index.php" style="color:#9d9ca3;">Text</a>
+		<a class="active item" href="file.php">Files</a>
         <a class="item" href="rx.php" style="color:#9d9ca3;">Receive</a>
-        <a class="item" href="img.php" style="color:#9d9ca3;">Image</a>
-        <a class="active item" href="file.php">Files</a>
+        <!-- <a class="item" href="img.php" style="color:#9d9ca3;">Image</a> -->
     </div>
 </div>
 
@@ -64,7 +63,7 @@
 </div>
 <div align="left" class="ts container">
 <br>
-CopyRight IMUS Laboratory 2018, All right reserved.
+CopyRight IMUS Laboratory 2021, All right reserved.
 </div>
 </div>
 

+ 1 - 1
img.php

@@ -127,7 +127,7 @@
 </div>
 <div align="left" class="ts container">
 <br>
-CopyRight IMUS Laboratory 2018, All right reserved.
+CopyRight IMUS Laboratory 2021, All right reserved.
 </div>
 </div>
 <script>

二進制
img/cube.png


二進制
img/cube_legacy.png


File diff suppressed because it is too large
+ 15 - 10
index.php


+ 21 - 10
rx.php

@@ -40,10 +40,10 @@ function qdecode(){
     <span class="large header">Quick Send System</span>
     <span class="description">Send data between mobile and laptops.<br> Powered by IMUS Laboratory</span>
     <div class="ts bottom attached tabbed menu" style="color:white;">
-        <a class="item" href="index.php" style="color:#9d9ca3;">Send</a>
-        <a class="active item" href="rx.php">Receive</a>
-        <a class="item" href="img.php" style="color:#9d9ca3;">Image</a>
-        <a class="item" href="file.php" style="color:#9d9ca3;">Files</a>
+        <a class="item" href="index.php" style="color:#9d9ca3;">Text</a>
+		<a class="item" href="file.php" style="color:#9d9ca3;">Files</a>
+        <a class="active item" href="rx.php" style="">Receive</a>
+        <!-- <a class="item" href="img.php" style="color:#9d9ca3;">Image</a> -->
     </div>
 </div>
 <div class="ts container">
@@ -51,11 +51,7 @@ function qdecode(){
 <div class="ts stackable grid">
     <div class="four wide column" align="center">
 		<h4>QuickSend ID</h4>
-		<div class="ts fluid input">
-			<input type="text" id="mid" placeholder="Memo ID" style="width:100%;">
-		</div>
-		<button id="viewbtn"class="ts basic fluid button" onclick="manual_redirect();" >View</button>
-		<div class="ts tiny statistic" onClick="cloneCode();">
+        <div class="ts tiny statistic" onClick="//cloneCode();">
 			<div class="label">Latest QSCode Number</div>
 			<div class="value" id="lcode"><?php
 			$max = 0;
@@ -68,6 +64,15 @@ function qdecode(){
 			echo $max;
 			?></div>
 		</div>
+
+        <button id="viewbtn"class="ts basic primary fluid button" style="" onclick="view_latest();" >View Latest</button>
+		<div class="ts horizontal divider">or </div>
+        <div class="ts fluid input">
+			<input type="text" id="mid" placeholder="Memo ID" style="width:100%;">
+		</div>
+		<button id="viewbtn"class="ts basic fluid button" onclick="manual_redirect();" >View Share Code</button>
+        
+		
 		
 	</div>
     <div class="twelve wide column">
@@ -101,7 +106,7 @@ function qdecode(){
 </div>
 <div align="left" class="ts container">
 <br>
-CopyRight IMUS Laboratory 2018, All right reserved.
+CopyRight IMUS Laboratory 2021, All right reserved.
 </div>
 </div>
 
@@ -114,6 +119,12 @@ $("#viewbtn").keyup(function(event) {
     }
 });
 
+function view_latest(){
+    var latestCode = $("#lcode").text().trim();
+    $("#mid").val(latestCode);
+    manual_redirect();
+}
+
 function resizeCanvasImage(img, canvas, maxWidth, maxHeight) {
     var imgWidth = img.width, 
         imgHeight = img.height;

+ 16 - 15
upload.php

@@ -19,11 +19,13 @@ if (isset($_GET['json']) && $_GET['json'] == "true"){
 if (file_exists($target_file)) {
     //echo "Sorry, file already exists.";
     $uploadOk = 0;
+	$displayMsg = "Upload Failed: File already exists";
 }
 // Check file size
 if ($_FILES["fileToUpload"]["size"] > 25000000) {
     //echo "Sorry, your file is too large.";
     $uploadOk = 0;
+	$displayMsg = "Upload Failed: File larger than 25MB";
 }
 // Allow certain file formats
 if($imageFileType == "php") {
@@ -32,15 +34,15 @@ if($imageFileType == "php") {
 // Check if $uploadOk is set to 0 by an error
 if ($uploadOk == 0) {
     //echo "Sorry, your file was not uploaded.";
-// if everything is ok, try to upload file
-	$displayMsg = "Sorry, your file was not uploaded. (Maybe file already exists / Not allowed format / file larger than 25MB)";
+	// if everything is ok, try to upload file
+	//$displayMsg = "Sorry, your file was not uploaded. (Maybe file already exists / Not allowed format / file larger than 25MB)";
 } else {
     if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) {
         //echo "The file ". basename( $_FILES["fileToUpload"]["name"]). " has been uploaded.";
 		$filename =  $_FILES["fileToUpload"]["name"];
-		$displayMsg = "Done.";
+		$displayMsg = "Upload Succeed";
     } else {
-		$displayMsg = "Sorry, there was an error uploading your file.";
+		$displayMsg = "Upload Failed: Internal Server Error";
         //echo "Sorry, there was an error uploading your file.";
     }
 }
@@ -51,7 +53,7 @@ if ($filename != ""){
 	$content = "data:file/" . $filename;
 	$content = bin2hex($content);
 	$max = 0;
-		foreach (new DirectoryIterator('Memo/') as $fileInfo) {
+		foreach (new DirectoryIterator($memodir) as $fileInfo) {
 			if ($fileInfo->isDot()) continue;
 			$current = pathinfo($fileInfo->getFilename())['filename'];
 			if (!is_numeric($current)) continue;
@@ -60,11 +62,11 @@ if ($filename != ""){
 		
 	//Check if the number of files exceed the max
 	if ($max > 1000){
-		foreach (new DirectoryIterator('Memo/') as $fileInfo) {
+		foreach (new DirectoryIterator($memodir) as $fileInfo) {
 				$current = pathinfo($fileInfo->getFilename())['filename'];
 				if (!is_numeric($current)) continue;
 				if ((int)$current != 0){
-					unlink('Memo/' . $current . ".txt");
+					unlink($memodir . $current . ".txt");
 				}
 		}
 		$max = 0;
@@ -90,7 +92,7 @@ if ($filename != ""){
 }else{
 	if ($jsonReply == true){
 		if ($uploadOk == 0){
-			echo json_encode("Sorry, your file was not uploaded. (Maybe file already exists / Not allowed format / file larger than 25MB)");
+			echo json_encode("Upload Failed: File already exists / Not allowed format / file larger than 25MB");
 		}
 		exit();
 	}
@@ -101,7 +103,6 @@ if ($filename != ""){
 <head>
 <title>Quick Send</title>
 <link rel="stylesheet" href="tocas.css">
-<script type="text/javascript" src="urlfix.js"></script>
 </head>
 <body>
 <?php
@@ -114,10 +115,10 @@ if ($filename != ""){
     <span class="large header">Quick Send System</span>
     <span class="description">Send data between mobile and laptops.<br> Powered by IMUS Laboratory</span>
     <div class="ts bottom attached tabbed menu" style="color:white;">
-        <a class="item" href="index.php" style="color:#9d9ca3;">Send</a>
+        <a class="item" href="index.php" style="color:#9d9ca3;">Text</a>
+		<a class="active item" href="file.php">Files</a>
         <a class="item" href="rx.php" style="color:#9d9ca3;">Receive</a>
-        <a class="item" href="img.php" style="color:#9d9ca3;">Image</a>
-        <a class="active item" href="file.php">Files</a>
+        <!-- <a class="item" href="img.php" style="color:#9d9ca3;">Image</a> -->
     </div>
 </div>
 
@@ -140,8 +141,8 @@ if ($filename != ""){
 			?></div>
 		</div>
 	</div>
-    <div class="twelve wide column">
-		<h2 class="ts header"><?php echo $displayMsg;?></h2><br>
+    <div class="center aligned twelve wide column">
+		<p class="ts header"><?php echo $displayMsg;?></p><br>
 		<a href="file.php" class="ts basic button">Upload Next File</a>
 		<br>
 	</div>
@@ -160,7 +161,7 @@ if ($filename != ""){
 </div>
 <div align="left" class="ts container">
 <br>
-CopyRight IMUS Laboratory 2018, All right reserved.
+CopyRight IMUS Laboratory 2021, All right reserved.
 </div>
 </div>
 

二進制
uploads/Thumbs.db


Some files were not shown because too many files changed in this diff