<?php
session_start();                      
$username=$_SESSION['username'] ?? '';
$password=$_SESSION['password'] ?? '';
include 'dbcon.php';
$password=md5($password);
$sql = mysql_query("SELECT * FROM matcher_usermst WHERE nif_usr='$username' AND nif_pass='$password' AND act_vate='1'");
$login_check = mysql_num_rows($sql);
if($login_check > 0){
$xdiaryid=$_GET['cntr'] ?? '';
	$result1 = mysql_query("SELECT * FROM matcher_tag_gen where ent_no='$xdiaryid' limit 1");
	while($row1=mysql_fetch_array($result1)) 
	{
	$ychn=$row1['chn_cycle'];
	$reslt_dt=$row1['reslt_dt'];
	$ent_by=$row1['ent_by'];
	$chn_cycle=$row1['chn_cycle'];
	$grpbypid=$row1['grpbypid'];
	$process_main_id=$row1['process_main_id'];
	$p_mark=$row1['p_mark'];
	}
	$sql = mysql_query("INSERT INTO matcher_tag_remv (reslt_dt, ent_by, chn_cycle, grpbypid, process_main_id, p_mark) VALUES( '$reslt_dt', '$ent_by', '$chn_cycle', '$grpbypid', '$process_main_id', '$p_mark')") or die (mysql_error());
mysql_query("DELETE from matcher_tag_gen WHERE ent_no='$xdiaryid' limit 1");
					echo "<b>Tag generation record removed successfully!<br>You'll be redirected to scanning page to start over";
					echo "<meta http-equiv=Refresh content=2;url=main_wlcm_andron.php>";
}else{
echo "User name or password not matched, try login again"; 
}
?>
<!DOCTYPE HTML>
<html>
<head>
<style type="text/css">
INPUT { margin-right: 1em }
</style>
<link href="../style.css" rel="stylesheet" type="text/css" />
<link href="style_btn.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js_button.js"></script>
<link href="../style_btn.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js_button.js"></script>
<style>
#foo {
    position: fixed;
    top: -1000000px;
  }
</style>
</head>
<body>
</body>
</html>
