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

$chn = $_POST['chn'] ?? ($_GET['chn'] ?? '');
$cyc_no=sprintf("%06d", $_GET['cyc_no'] ?? '');

$chnwcyc=$chn.".".$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'];
    }
else {
	session_destroy();
echo ("<SCRIPT LANGUAGE='JavaScript'> window.location.href='invalidlogin.html'; </SCRIPT>");
}
$xadmnchk = $xadmnchk ?? '';
$xclr = 'blue';
?>
<!DOCTYPE HTML>
<html>
<head>
<title></title>
<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>
</head>
<body id="top">

			<section id="one" class="wrapper style1">
				<header class="major">
<h3>Matches for <?php echo $chn?></h3>
							<section>
<?php
//include 'dbcon.php';
$result = mysql_query("SELECT * FROM matcher_tag_gen where chn_cycle like '%$chnwcyc%' order by ent_no asc");
echo "<table width=100% border='0' class='imagetable'> 
<tr>
<th width =auto align='left' bgcolor='#E0EFFC' style='text-align:left;font-size:18px;'>Tag generated</th> 
</tr>"; 
	while($row=mysql_fetch_array($result)) 
	{
		$xdelnav = '';
		if($xadmnchk=="1"){
		$xdelnav="<a href='delrecy.php?cntr=$row[ent_no];'> [ Remove ]</a>";
		}
		echo "<tr>"; 
                           if($row['process_main_id']=="a1:b01"){
						   $xprocedure="Pool dish (35mm Dish)";
						   }elseif($row['process_main_id']=="a1:b02"){
						   $xprocedure="Post Denudation dish (60 mm Dish)";
						   }elseif($row['process_main_id']=="a1:b03"){
						   $xprocedure="ICSI Dish";
						   }elseif($row['process_main_id']=="a1:b04"){
						   $xprocedure="Fert dish (D0)";
						   }elseif($row['process_main_id']=="a1:b05"){
						   $xprocedure="Cleave dish (D1)";
						   }elseif($row['process_main_id']=="a1:b06"){
						   $xprocedure="Blast Dish (D3)";
						   }elseif($row['process_main_id']=="a1:b10"){
						   $xprocedure="Freezing dish (d3)";
						   }elseif($row['process_main_id']=="a1:b07"){
						   $xprocedure="Blast Dish (D5/6)";
						   }elseif($row['process_main_id']=="a1:b13"){
						   $xprocedure="Biopsy dish (d5)";
						   }elseif($row['process_main_id']=="a1:b21"){
						   $xprocedure="Freezing dish (d5)";
						   }elseif($row['process_main_id']=="a1:b14"){
						   $xprocedure="Biopsy dish (d6)";
						   }elseif($row['process_main_id']=="a1:b22"){
						   $xprocedure="Freezing dish (d6)";
						   }elseif($row['process_main_id']=="a1:b08"){
						   $xprocedure="ET Dish";
						   }elseif($row['process_main_id']=="a1:b09"){
						   $xprocedure="PGT Biopsy Dish";
						   }elseif($row['process_main_id']=="a1:b10"){
						   $xprocedure="Freezing dish";
						   }elseif($row['process_main_id']=="a1:b11"){
						   $xprocedure="Thaw Dish";
						   }elseif($row['process_main_id']=="a1:b12"){
						   $xprocedure="ET Dish";
						   }elseif($row['process_main_id']=="a2:b01"){
						   $xprocedure="Semen Collection container";
						   }elseif($row['process_main_id']=="a2:b02"){
						   $xprocedure="DG Tube/ Swim up Tube";
						   }elseif($row['process_main_id']=="a2:b03"){
						   $xprocedure="Post wash tube";
						   }else{
						   $xprocedure="Screen label not defined";
						   }

					$xentby=$row['ent_by'];

echo "<td width=100% style='text-align:left;font-size:18px;'>"."<font color='#009900'>".date('d/m/Y',strtotime($row['reslt_dt']))." ".substr($row['reslt_dt'],-8)." by user ".$xentby."</font>"." - "."<font color='$xclr'>".$xprocedure."</font>".$xdelnav."</td>";
}
?>
</section>
<A HREF="gend_cycle_select.php?chn=<?php echo $chn;?>" class="btn-two blue large">Back to patient page</A>
</header>
</section>
</body>
</html>
