postactions.php 654 B

12345678910111213141516
  1. <?php
  2. if($place == "assets" && $sched == "save"){
  3. if(isset($newscriptid)){
  4. $schedtime = trim($_POST["datetime"]);
  5. $addsched = "INSERT INTO schedules (assetid, scriptid, runtime, userid) values (?, ?, ?, ?)";
  6. if($stmt = mysqli_prepare($link, $addsched)){
  7. mysqli_stmt_bind_param($stmt, "iisi", $asset, $newscriptid, $schedtime, $userid);
  8. if(mysqli_stmt_execute($stmt)){
  9. header("location: ?a=assets&asset=$asset&do=scripts");
  10. exit;
  11. }else{
  12. echo "Oops! Something went wrong. Please try again later.";
  13. }
  14. }
  15. }
  16. }