<?php
    include('../loginsession.php');
    error_reporting(E_ALL);
    $filename = __FILE__;  //---Nama file saat ini
    $filenameshort = $filename;
    if (strlen($filename) > 48) {$filenameshort = substr($filename, 48);}
    $save = mysqli_query($conn, "INSERT INTO novia_abc_user_logs (userid,filename) VALUES ('$userini_id','$filenameshort')");
//-------------
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//ID" "http://www.w3.org/TR/html4/frameset.dtd">
<html lang="id">
<head>
	<title>RESET FREQUENCY KUNJUNGAN</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
    <link rel="stylesheet" type="text/css" href="css/style.css">
	<link href="images/justice balance.ico" rel="icon" type="image/icon" />
</head>

<body>
<?php 
$mrtocount = "";
$freq = 0;
$sql = "SELECT mr FROM novia_abc_visit ORDER BY mr ASC";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
    while($row = $result->fetch_assoc()) {
		if ($mrtocount != $row["mr"]) {
			$mrtocount = $row["mr"];
			$freq = 0;
		}
		if ($mrtocount == $row["mr"]) {
			$freq++;
			//$save=mysqli_query($conn, "UPDATE novia_abc_biodata SET freq='$freq' where mr='$mrtocount'");
		}
	$save=mysqli_query($conn, "UPDATE novia_abc_biodata SET freq='$freq' where mr='$mrtocount'");
	
?>
				
<?php
			}
		} else {
	}
?>

</body>
</html>
