<?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'] ?? '';
		$actvty_id = $_GET['actvty_id'] ?? '';
}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;
}
#foo {
    position: fixed;
    top: -100000020px;
  }
</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>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
<script>
function getsecnd() {
var idscan = document.getElementById("idscan").value;
	if (idscan.length > 8 ) {
		var mychn = document.getElementById("mychn").value;
		var mycycle = document.getElementById("mycycle").value;
		var myidscan = document.getElementById("idscan").value;
		var myreasn = document.getElementById("reasn").value;
		window.location.href="actvcty_clsngupdt_embryo_closd.php?chn="+mychn+"&cyclid="+mycycle+"&idscan="+myidscan+"&reasn="+myreasn;
	}
}
</script>
<script>
function lctfrst(){
//$("#idscan").focus();
document.getElementById("idscan").focus();
}
</script>
</head>
<body">
			</br></br></br></br>
			<div id="123" style="color:#006699;font-size:20px;text-align:center"> Scan barcode to outward straw</div>
			<form id="myfrm" name="myfrm" enctype="multipart/form-data">
			<div id="foo">
			
			<input type="hidden" id="mychn" name="mychn" value="<?php echo $chn;?>">
			<input type="hidden" id="mycycle" name="mycycle" value="<?php echo $actvty_id;?>">
			<input type="text" id="idscan" name="idscan" style="width:80px;background-color:#e1e1e1" onKeyUp="getsecnd()"></div>
			<div id="456" style="color:#CC3300;font-size:20px;text-align:center"> 
			Reason : <select name="reasn" id="reasn" style="color:#CC3300;font-size:20px;" onChange="lctfrst()">
			<option value=""></option>
			<option value="1">Used for procedure</option>
			<option value="2">Non Viable</option>
			<option value="3">Non-renewal</option>
			<option value="4">Patient consent to discard</option>
			<option value="5">Straw added by mistake</option>
			</select></div>
			</form>

</body>
</html>
