<?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')");
//-------------
    $id = 0;
    if(isset($_GET['id'])){
    	$id = $_GET['id'];
    }
//-------------
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//ID" "http://www.w3.org/TR/html4/frameset.dtd">
<html lang="id">
<head>
	<title>USER ACTIVITY</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/balance.ico" rel="icon" type="image/icon" />

	<style
	></style>
	
</head>
<body>
<br>
<a href="../coding/coding_main.php" title="Lihat Keuangan Hari ini"><button style="padding : 10px; width:100%; background-color:#546E7A;">CODING</button></a>
<br>
<br>
<table width="100%" cellpadding="4">
	<tr class="head">
		<th width="30">ID</th>
		<th width="125">Tanggal</th>
		<th width="30">UserID</th>
		<th align="left">Halaman</th>
	</tr>

<?php 
$sty = 1;
$sql = "SELECT * FROM novia_abc_user_logs ORDER BY tanggal DESC";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
	while($row = $result->fetch_assoc()) {
	$Userid = $row['userid'];
	$Username = $USERNAME[$Userid];
	if ($Userid == $id){	
		$si = $row['id'] + 1;
		$y = 2;
		$result1 = fmod($si,$y);
		if ( $result1 == 0 ) $sty = "dua";
		if ( $result1 == 1 ) $sty = "satu";

    
?>
	<tr class=<?php echo $sty; ?>>
		<td width="30" align="center"><?php echo $row["id"]; ?></td>
		<td width="125" align="left"><?php echo $row["tanggal"]; ?></td>
		<td width="30" align="center"><?php echo $Username; ?></td>			
		<td><?php echo $row["filename"]; ?></td>
	</tr>
<?php
	}
	}
}
?>


</body>