|
|
@@ -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();
|
|
|
- }
|
|
|
}
|
|
|
}
|
|
|
|