<?php 
require_once('db_connection.php');

class Log  
{
    private $db;

    function __construct($dbconn){
        $this->db = $dbconn;
    }

    // Function to create a new expense record
    public function createLog($user_id, $activity) {
        $query = "INSERT INTO `logs` (`id`, `user_id`, `activity`, `activity_date`) VALUES (NULL, $user_id, 'Edit User', current_timestamp())";
        $result = mysqli_query($this->db,$query);
   
    }

    
      public function getAllLogs() {
        $query = "SELECT * FROM `logs` JOIN users ON logs.user_id = users.id";
        $result = $this->db->query($query);
        
        return $result->fetch_all(MYSQLI_ASSOC); 
    }

}

  
