<?php
  include "include/dbcon.php";
?>
<?php
  global $conn;
  $pid = $_POST["pid"];
  $premark = $_POST["remark"];
  $valid = true;
?>
<?php
  if($premark==""){
    $valid = false;
    $_SESSION["errmsg"] = "<span style='color: #FF0000'>#ERROR: the remark type can not empty.</span>";
  }
?>
<?php
  if( $valid ){
    $query = "UPDATE punchsys_remarkevent SET event='$premark' WHERE id = '$pid'";
    mysqli_query($conn,$query);
    header("location: main.php?pg=sys&ac=evt");

  }else{
	header("location: main.php?pg=sys&ac=evt");
  }
?>