<?php
session_start();                      
$username=$_SESSION['username'] ?? '';
$password=$_SESSION['password'] ?? '';
$chn=$_GET['chn'] ?? '';
$cyc_no=$_GET['cyc_no'] ?? '';

$chn = $_POST['chn'] ?? '';
$cyc_no = $_POST['cyc_no'] ?? '';

$ip=$_SERVER['REMOTE_ADDR'] ?? '';
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){
	$row = mysql_fetch_assoc($sql);
	$xadmnchk=$row['dept_x'];
	$result = mysql_query("SELECT * FROM cycle_lst_thaw where pat_mrn like '%$chn%'");
	$row = mysql_fetch_assoc($result);
	$xnm=$row['pat_name']." ".$row['part_name'];
	$cycle_typ=$row['cycle_type'];
	$cycle_numbr=$row['x1flag'];

}else {
	session_destroy();
echo "Invalid login";
}
?>
<!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>
#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: -1000000px;
  }
</style>
<script type='text/javascript'>
function fun()
{
    if(document.getElementById("reasonclsng").value!="")
        document.getElementById("button").disabled=false;
    else
    document.getElementById("button").disabled=true;

}
</script>
</head>
<body onLoad="lctfrst()">
<div id="foo"><input name="ptcard" id="ptcard" type="text"></div>
<br><br><br><br><br><br><br><div align="center"><img src="strtupmain.jpg"/></div><br><br>
<div style="color:#006699;font-size:20px;text-align:center">Welcome to NOVA IVF Electronic Witnessing System - EMBRYOLOGY DEPARTMENT</div><br><br><br>
<form action="cycl_clsng_fnl1_fet.php" method="post">
<input name="chn" id="chn" type="hidden" value="<?php echo $chn;?>">
<input name="cycno" id="cycno" type="hidden" value="<?php echo $cycle_numbr;?>">
<div style="color:#FF6600;font-weight:700;font-size:16px;text-align:center">Select appropriate reason to close the cycle and press clos the cycle button<br><br>
<select name="reasonclsng" id="reasonclsng" onChange="fun()">
<option value=""></option>
<option value="1">ET complete</option>
<option value="2">No survival</option>
<option value="3">Difficult cannulation</option>
<option value="5">Power or network issues</option>
<option value="7">Improper witness</option>
</select><br><br>
<input value="Close cycle" type="submit" class="btn-two red large" id="button" disabled="true">
</form></div>
</body>
</html>