<?php

namespace App\Models;

use App\Core\Model;
use PDO;

class CourseFee extends Model {
    public function getByCourse($courseId) {
        $stmt = $this->db->prepare("SELECT * FROM course_fees WHERE course_id = :course_id");
        $stmt->execute(['course_id' => $courseId]);
        return $stmt->fetchAll();
    }

    public function getMonthlyByCourse($courseId) {
        $stmt = $this->db->prepare("SELECT * FROM course_fees WHERE course_id = :course_id AND frequency = 'Monthly'");
        $stmt->execute(['course_id' => $courseId]);
        return $stmt->fetchAll();
    }
}
