0xV3NOMx
Linux ip-172-26-7-228 5.4.0-1103-aws #111~18.04.1-Ubuntu SMP Tue May 23 20:04:10 UTC 2023 x86_64



Your IP : 18.220.217.228


Current Path : /var/www/html/oums/src/
Upload File :
Current File : /var/www/html/oums/src/home_userlogs.php

	<?php
    include("sys_session.php");
    include("sys_connect.php");
    include("sys_mainphp.php");
    ?>
	<div style="margin-bottom: 5px;" class="head_blue">Recent User Logs</div>
	<div class="tab-content" id="home-content-note">
	    <?php
        if ($type_id == "ADMIN") {
            $myqry = "";
        } elseif ($type_id == 'CHIEF') {
            $myqry = " inner join masdept_user du on lg.fdeptcode = du.fdeptcode and du.fusercode = '$user_id' ";
        } else {
            $myqry = " and em.fusercode = '$user_id' ";
        }

        $mysql = "select 
        concat('[',em.femplcode,'] ',em.femplname) as lemplname,
        concat('[',dp.fdeptcode,'] ',dp.fdeptshrt) as ldeptname,
        lg.flogstype,lg.fremarks,
        date_format(flogsdate,'%d/%m/%Y %h:%i:%s %p') as llogsdate 
        from sys_logs lg 
        inner join masdept dp on lg.fdeptcode = dp.fdeptcode
        inner join masempl em on lg.fusercode = em.fusercode " . $myqry . "
        where ifnull(lg.fusercode,'')<>'' order by flogsdate desc limit 100;";

        $myres = mysqli_query($mycon, $mysql);
        echo "<table class='table table-striped table-condensed'>";
        echo "<tr>";
        echo "<th class='text-left col-sm-2'> Date & Time</th>";
        echo "<th class='text-left col-sm-1'> Client</th>";
        echo "<th class='text-left col-sm-3'> Empl. Name</th>";
        // echo "<th class='text-left col-sm-1'> Log Type</th>";
        echo "<th class='text-left col-sm-6'> Log Description</th>";
        echo "</tr>";
        while ($myrow = mysqli_fetch_assoc($myres)) {
            echo "<tr>";
            echo "<td class='text-left'> $myrow[llogsdate]</td>";
            echo "<td class='text-left'> $myrow[ldeptname] </td>";
            echo "<td class='text-left'> $myrow[lemplname]</td>";
            // echo "<td class='text-left'> $myrow[flogstype]</td>";
            echo "<td class='text-left'> $myrow[fremarks]</td>";
            echo "</tr>";
        }
        echo "</table>";
        ?>
	</div>