<?php

class MatchReport {
    private $db;

    public function __construct(){
        $this->db = new Database;
    }

    // Create a new match report
    public function create($data){
        $this->db->query('INSERT INTO match_reports (fixture_id, referee_id, report_content) VALUES (:fixture_id, :referee_id, :report_content)');
        
        // Bind values
        $this->db->bind(':fixture_id', $data['fixture_id']);
        $this->db->bind(':referee_id', $data['referee_id']);
        $this->db->bind(':report_content', $data['report_content']);

        if($this->db->execute()){
            return $this->db->lastInsertId();
        } else {
            return false;
        }
    }
}
?>