<?php include("session_controller.php"); 

if ((isset($_GET['asset_no'])) && ($_GET['asset_no'] != "")) {
  $deleteSQL = sprintf("DELETE FROM assets WHERE s_no=%s",
                       GetSQLValueString($_GET['asset_no'], "int"));

  mysqli_select_db($conn, $database_conn);
  $Result1 = mysqli_query($conn, $deleteSQL) or die(mysqli_error($conn));

  $deleteGoTo = $_SERVER['HTTP_REFERER'];
  if (isset($_SERVER['QUERY_STRING'])) {
    $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
    $deleteGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $deleteGoTo));
}
?>