<?php
session_start();

if (!isset($_SESSION['logged_in'])) {
    die("Session expired");
}
include 'dbcon.php';                
$username=$_SESSION['username'] ?? '';
$password=$_SESSION['password'] ?? '';

$chn=$_GET['chn'] ?? '';
$ip=$_SERVER['REMOTE_ADDR'] ?? '';

$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){
	$row = mysqli_fetch_assoc($sql);
	$xadmnchk=$row['dept_x'];

$myfile = fopen("txan526a.txt", "w") or die("Unable to open file!");
$txt = "";
fwrite($myfile, $txt);
fclose($myfile);
$myfile1 = fopen("txan526.txt", "w") or die("Unable to open file!");
$txt1 = "";
fwrite($myfile1, $txt1);
fclose($myfile1);


}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>
</head>
<body>
<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 - ANDROLOGY DEPARTMENT</div><br><br><br><br><br>
<div style="color:#FF6600;font-weight:700;font-size:16px;text-align:center">Scan patient card to proceed ....</div><br><br><br><br><br>
</body>
</html>
