scripts.php 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <div class="launchcollumn">
  2. <a>Scripts</a><br>
  3. <?php
  4. $getscriptsqry = mysqli_query($link, "select * from scripts ORDER BY name ASC");
  5. while($row = mysqli_fetch_array($getscriptsqry)){
  6. echo "<a href='?a=scripts&script=".$row['id']."' class='collumnbutton'>".$row['name']."</a>";
  7. }
  8. echo "</div>";
  9. if(isset($script)){
  10. $getscriptsqry = mysqli_query($link, "select * from scripts where id = $script");
  11. while($row = mysqli_fetch_array($getscriptsqry)){
  12. $scriptname = $row['name'];
  13. $scriptdata = $row['data'];
  14. $shell = $row['shell'];
  15. }
  16. if($shell == 'powershell'){
  17. $powershell = "powershell' selected='selected";
  18. $cmd = "cmd";
  19. $bash = "bash";
  20. }elseif($shell == 'cmd'){
  21. $powershell = "powershell";
  22. $cmd = "cmd' selected='selected";
  23. $bash = "bash";
  24. }elseif($shell == 'bash'){
  25. $powershell = "powershell";
  26. $cmd = "cmd";
  27. $bash = "bash' selected='selected";
  28. }
  29. echo "<div class='editcollumn'>
  30. <a>$scriptname</a><br>
  31. <form action='?a=scripts&script=$script&do=scriptedit' method='POST'>
  32. <select id='shell' name='shell'>
  33. <option value='$cmd'>CMD</option>
  34. <option value='$powershell'>PowerShell</option>
  35. <option value='$bash'>BASH</option>
  36. </select><br>
  37. <textarea type='longtext' name='script' class='input-script' placeholder='Enter Script Here'>$scriptdata</textarea>
  38. <input type='submit' class='button' value='Save'>
  39. </form>
  40. ";
  41. }