|
|
@@ -2,6 +2,7 @@
|
|
|
<a>Scripts</a><br>
|
|
|
<?php
|
|
|
|
|
|
+ echo "<a href='?a=scripts&script=newscript' class='collumnbutton'>--> New <--</a>";
|
|
|
$getscriptsqry = mysqli_query($link, "select * from scripts ORDER BY name ASC");
|
|
|
while($row = mysqli_fetch_array($getscriptsqry)){
|
|
|
echo "<a href='?a=scripts&script=".$row['id']."' class='collumnbutton'>".$row['name']."</a>";
|
|
|
@@ -9,28 +10,35 @@
|
|
|
echo "</div>";
|
|
|
|
|
|
if(isset($script)){
|
|
|
- $getscriptsqry = mysqli_query($link, "select * from scripts where id = $script");
|
|
|
- while($row = mysqli_fetch_array($getscriptsqry)){
|
|
|
- $scriptname = $row['name'];
|
|
|
- $scriptdata = $row['data'];
|
|
|
- $shell = $row['shell'];
|
|
|
- }
|
|
|
- if($shell == 'powershell'){
|
|
|
- $powershell = "powershell' selected='selected";
|
|
|
- $cmd = "cmd";
|
|
|
- $bash = "bash";
|
|
|
- }elseif($shell == 'cmd'){
|
|
|
- $powershell = "powershell";
|
|
|
- $cmd = "cmd' selected='selected";
|
|
|
- $bash = "bash";
|
|
|
- }elseif($shell == 'bash'){
|
|
|
- $powershell = "powershell";
|
|
|
- $cmd = "cmd";
|
|
|
- $bash = "bash' selected='selected";
|
|
|
+ if($script != 'newscript'){
|
|
|
+ $do = "scriptedit";
|
|
|
+ $getscriptsqry = mysqli_query($link, "select * from scripts where id = $script");
|
|
|
+ while($row = mysqli_fetch_array($getscriptsqry)){
|
|
|
+ $scriptname = $row['name'];
|
|
|
+ $scriptdata = $row['data'];
|
|
|
+ $shell = $row['shell'];
|
|
|
+ }
|
|
|
+ if($shell == 'powershell'){
|
|
|
+ $powershell = "powershell' selected='selected";
|
|
|
+ $cmd = "cmd";
|
|
|
+ $bash = "bash";
|
|
|
+ }elseif($shell == 'cmd'){
|
|
|
+ $powershell = "powershell";
|
|
|
+ $cmd = "cmd' selected='selected";
|
|
|
+ $bash = "bash";
|
|
|
+ }elseif($shell == 'bash'){
|
|
|
+ $powershell = "powershell";
|
|
|
+ $cmd = "cmd";
|
|
|
+ $bash = "bash' selected='selected";
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ $do = "newscript";
|
|
|
}
|
|
|
+
|
|
|
echo "<div class='editcollumn'>
|
|
|
- <a>$scriptname</a><br>
|
|
|
- <form action='?a=scripts&script=$script&do=scriptedit' method='POST'>
|
|
|
+ <a>Name</a><br>
|
|
|
+ <form action='?a=scripts&script=$script&do=$do' method='POST'>
|
|
|
+ <input type='text' name='scriptname' class='input' placeholder='Script Name' value='$scriptname'><br>
|
|
|
<select id='shell' name='shell'>
|
|
|
<option value='$cmd'>CMD</option>
|
|
|
<option value='$powershell'>PowerShell</option>
|
|
|
@@ -40,4 +48,7 @@ echo "</div>";
|
|
|
<input type='submit' class='button' value='Save'>
|
|
|
</form>
|
|
|
";
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|