<?php
session_start();                      
$username=$_SESSION['username'] ?? null;
$password=$_SESSION['password'] ?? null;
$deprtmnt = "4";
$sub1_xx = $_GET["sub1_xx"] ?? '';
$orgin_chn = $_GET["orgin_chn"] ?? '';
$cyc_no = $_GET["cyc_no"] ?? '';
$semen_id = $_GET["semen_id"] ?? '';
$x_first=explode('.',$sub1_xx)[0] ?? '';
$x_procid=$_GET["sub1_xx"] ?? null;
$xchnx=$orgin_chn.".".$cyc_no;
$myfile = fopen("txiv834.txt", "w") or die("Unable to open file!");
$txt = $orgin_chn.".".$semen_id.".".$sub1_xx.".";
$txt1 = $_GET["orgin_chn"] ?? null;
fwrite($myfile, $txt);
fclose($myfile);

include 'dbcon.php';
//	$sql = mysqli_query($conn, "INSERT INTO matcher_tag_gen (reslt_dt, ent_by, chn_cycle, grpbypid, process_main_id, p_mark)
//	VALUES(now(), '$username', '$xchnx', '$x_first', '$x_procid', '1')") or die (mysqli_error($conn));

$myfileb = fopen("txiv834b.txt", "w") or die("Unable to open file!");
$txtb = $username.",".$xchnx.",".$x_first.",".$x_procid;
fwrite($myfileb, $txtb);
fclose($myfileb);
?>
<!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;
}
</style>
</head>
<body>
<?php
$xnm = '';
$result = mysqli_query($conn, "SELECT * FROM new_case where chn like '%$txt%'");
$login_check1 = mysqli_num_rows($result);
//if($login_check1 > 0){
$row = mysqli_fetch_assoc($result);
$x_resp_nm1 = $row['resp_dr_nm'] ?? '';
$pt_gend = $row['pat_gend'] ?? '';
$xnm=($row['pat_nm'] ?? '')." ".($row['part_nm'] ?? '')." ".($row['pat_sur'] ?? '');
echo "<br><br>";
echo "<div align='center' style='font-size:20px'><font color=blue>You are going to generate tag for patient</font></div>";
echo "<br><br>";
echo "<div align='center' style='font-size:22px'><font color=red>"."[ Department : IVF Lab ] ".$txt1." ".$xnm."</font><br><br></div>";
echo "<br><br>";
echo "<div align='center' style='font-size:18px'><font color=blue>Press yes if want to write tag and then put blank tag on device</font> | click";
echo "<a href='main_wlcm_ivflabn.php'><font color=blue>here</font></a> to go to main list"."</font></div>";
?>
</body>
</html>
