opr.php 797 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. $data = json_decode(file_get_contents("data.json"),true);
  3. $id = $_POST["id"];
  4. $data[$id]["path"] = $_POST["path"];
  5. if($_POST["secure_sharing"] == "nil"){
  6. $data[$id]["secure_sharing"] = false;
  7. }else{
  8. $data[$id]["secure_sharing"] = true;
  9. if($_POST["secure_sharing"] == "user"){
  10. $data[$id]["sharewith"] = array($_POST["userList"]);
  11. }else if($_POST["secure_sharing"] == "pwd"){
  12. $data[$id]["password"] = $_POST["pwd"];
  13. }
  14. }
  15. if($_POST["isstart"] == "yes"){
  16. $data[$id]["startd"] = $_POST["startd"];
  17. $data[$id]["startt"] = $_POST["startt"];
  18. }
  19. if($_POST["isstop"] == "yes"){
  20. $data[$id]["stopd"] = $_POST["stopd"];
  21. $data[$id]["stopt"]= $_POST["stopt"];
  22. }
  23. if($_POST["is_access"] == "yes"){
  24. $data[$id]["remain"] = $_POST["numaccess"];
  25. }
  26. file_put_contents("data.json",json_encode($data));