<?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){
	$log_no = $_POST['log_no'] ?? '';
	$chn = $_POST['chn'] ?? '';
	$act_rem = $_POST['act_rem'] ?? '';
	$contnrno = $_POST['contnrno'] ?? '';
	$canistrno = $_POST['canistrno'] ?? '';
	$liftno = $_POST['liftno'] ?? '';
	$vialposno = $_POST['vialposno'] ?? '';
	$frzngtrms = $_POST['frzngtrms'] ?? '';
	$result = mysqli_query($conn, "UPDATE actvty_trans_frzng_sperm SET term_date='$frzngtrms', contnrno='$contnrno', canistrno='$canistrno', liftno='$liftno', vialposno='$vialposno', remarks='$act_rem' WHERE log_no='$log_no' limit 1");
     echo "<b>Record updated successfully!<br>You'll be redirected to patient list page now";
     echo "<meta http-equiv=Refresh content=2;url=gend_cycle_select.php?chn=$chn>";
}else{
echo "User name or password not matched, try login again";
}
?>