3ndur4nce 3 éve
szülő
commit
159d6e5262
2 módosított fájl, 10 hozzáadás és 70 törlés
  1. 8 69
      WebPage/place/getvalues.php
  2. 2 1
      WebPage/place/scripts.php

+ 8 - 69
WebPage/place/getvalues.php

@@ -69,79 +69,18 @@ if($_SERVER["REQUEST_METHOD"] == "POST"){
     require "place/postactions.php";
 }
 
-if(isset($acc)){
-    if($acc == "yes"){
-        $sql = "UPDATE request SET treated_by = ?, approved = 1 WHERE id = ?";
-        if($stmt = mysqli_prepare($link, $sql)){
-            mysqli_stmt_bind_param($stmt, "si", $currentusr, $req);
+if(isset($place)){
+    if($place == 'delscript'){
+        $delscriptqry = "DELETE FROM scripts WHERE id = ?";
+        if($stmt = mysqli_prepare($link, $delscriptqry)){
+            mysqli_stmt_bind_param($stmt, "i", $script);
             if(mysqli_stmt_execute($stmt)){
-                header("location: ?a=launch&req=$req");
-                exit();
-            } else{
+                header("location: ?a=scripts");
+                exit;
+            }else{
                 echo "Oops! Something went wrong. Please try again later.";
             }
         }
-    }elseif($acc == "cltclass"){
-        $sql = "UPDATE request SET clientid = ? WHERE id = ?";
-        if($stmt = mysqli_prepare($link, $sql)){
-            mysqli_stmt_bind_param($stmt, "ii", $cltid, $req);
-            if(mysqli_stmt_execute($stmt)){
-                header("location: ?a=launch&req=$req");
-                exit();
-            } else{
-                echo "Oops! Something went wrong. Please try again later.";
-            }
-        }
-    }elseif($acc == "reqend"){
-        $sql = "UPDATE request SET approved = 3 WHERE id = ?";
-        if($stmt = mysqli_prepare($link, $sql)){
-            mysqli_stmt_bind_param($stmt, "i", $req);
-            if(mysqli_stmt_execute($stmt)){
-                header("location: ?a=launch");
-                exit();
-            } else{
-                echo "Oops! Something went wrong. Please try again later.";
-            }
-        }
-    }
-}
-
-if(isset($stpdn)){
-    $stepqry = mysqli_query($link, "select * from repports where id='$rep'");
-    while($row = mysqli_fetch_array($stepqry)){
-        $stepsdone = $row['stepsdone'];
-    }
-    if(strpos("$stepsdone", "<$stpdn>")){
-        $stepsdone = str_replace("<$stpdn>","",$stepsdone);
-        $delstepqry = "UPDATE repports SET stepsdone = ? WHERE id = $rep";
-        if($stmt = mysqli_prepare($link, $delstepqry)){
-            mysqli_stmt_bind_param($stmt, "s", $stepsdone);
-            if(mysqli_stmt_execute($stmt)){
-                header("location: ?a=launch&acc=rapp&req=$req&rep=$rep");
-                exit();
-            }
-        }
-    }else{
-        $stepsdone = $stepsdone."<$stpdn>";
-        $addstepqry = "UPDATE repports SET stepsdone=? WHERE id=$rep";
-        if($stmt = mysqli_prepare($link, $addstepqry)){
-            mysqli_stmt_bind_param($stmt, "s", $stepsdone);
-            if(mysqli_stmt_execute($stmt)){
-                header("location: ?a=launch&acc=rapp&req=$req&rep=$rep");
-                exit();
-            }
-        }
-    }
-}
-
-if(isset($repdn)){
-    $delrepqry = "UPDATE repports SET repstat = 1 WHERE id = ?";
-    if($stmt = mysqli_prepare($link, $delrepqry)){
-        mysqli_stmt_bind_param($stmt, "i", $rep);
-        if(mysqli_stmt_execute($stmt)){
-            header("location: ?a=launch&acc=rapp&req=$req");
-            exit();
-        }
     }
 }
 

+ 2 - 1
WebPage/place/scripts.php

@@ -44,8 +44,9 @@ echo "</div>";
                 <option value='$powershell'>PowerShell</option>
                 <option value='$bash'>BASH</option>
             </select><br>
-            <textarea type='longtext' name='script' class='input-script' placeholder='Enter Script Here'>$scriptdata</textarea>
+            <textarea type='longtext' name='script' class='input-script' placeholder='Enter Script Here'>$scriptdata</textarea><br>
             <input type='submit' class='button' value='Save'>
+            <a href='?a=delscript&script=$script' class='button' style='background-color:red; color:black;'>Delete</a>
             </form>
         ";
     }