1234567891011121314151617181920212223242526272829 |
- <?php
- $data = json_decode(file_get_contents("data.json"),true);
- $id = $_POST["id"];
- $data[$id]["path"] = $_POST["path"];
- if($_POST["secure_sharing"] == "nil"){
- $data[$id]["secure_sharing"] = false;
- }else{
- $data[$id]["secure_sharing"] = true;
- if($_POST["secure_sharing"] == "user"){
- $data[$id]["sharewith"] = array($_POST["userList"]);
- }else if($_POST["secure_sharing"] == "pwd"){
- $data[$id]["password"] = $_POST["pwd"];
- }
- }
- if($_POST["isstart"] == "yes"){
- $data[$id]["startd"] = $_POST["startd"];
- $data[$id]["startt"] = $_POST["startt"];
- }
- if($_POST["isstop"] == "yes"){
- $data[$id]["stopd"] = $_POST["stopd"];
- $data[$id]["stopt"]= $_POST["stopt"];
- }
- if($_POST["is_access"] == "yes"){
- $data[$id]["remain"] = $_POST["numaccess"];
- }
- file_put_contents("data.json",json_encode($data));
|