<?php
session_start();
$username=$_SESSION['username'] ?? '';
$password=$_SESSION['password'] ?? '';
include 'dbcon.php';
$password=md5($password);
$sql = mysqli_query($conn, "SELECT * FROM matcher_usermst WHERE nif_usr='$username' AND nif_pass='$password' AND act_vate='1'");
$login_check = mysqli_num_rows($sql);
if($login_check > 0){
		$chn = $_GET['chn'] ?? '';
		$idscan = $_GET['idscan'] ?? '';
		if ( $chn == $idscan ) {
		$actvty_id = $_GET['cyclid'] ?? '';
		$reasn = $_GET['reasn'] ?? '';
		$result = mysqli_query($conn, "UPDATE actvty_trans_frzng_oocyt SET due_date_comp=now(), actvty_mrk='c', dt_tm_out=now(), user_id_outwrd='$username', outwrdresn='$reasn' WHERE log_no='$actvty_id' limit 1");
        echo "<b>Freezing storage used / discarded successfully!<br>You'll be redirected to main page now";
        echo "<meta http-equiv=Refresh content=2;url=gend_cycle_select.php?chn=$chn>";
		}else{
		echo " Id is not matched ";
        echo "<meta http-equiv=Refresh content=2;url=gend_cycle_select.php?chn=$chn>";
		}
}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>
<style>
#Image {
    margin: 5px;
    border:2px solid #FF3399;
    border-radius: 5px;
    background-size: 210px;
    background-position:center;
}
#Imagex {
    margin: 5px;
    border:2px solid #FF3399;
	width:200px;
	height:200px;
    border-radius: 10px;
    background-size: 210px;
    background-position:center;
}
</style>
  <script language="JavaScript">
     if (navigator.platform.toString().toLowerCase().indexOf("linux") != -1){
	 	document.write('<link type="text/css" rel="stylesheet" href="datepickercontrol_lnx.css">');
	 }
	 else{
	 	document.write('<link type="text/css" rel="stylesheet" href="datepickercontrol.css">');
	 }
    </script>
	<style type="text/css">
	INPUT { margin-right: 1em }
	</style>
</head>
<body>
</body>
</html>