<?php

/* 
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
require_once('../config/database.php');
include_once '../security/session_config.php';
include_once '../security/csrf.php';

// include objects
include_once "../resources/offering.php";
include_once '../config/properties.php';
$csrf_token = $_POST['csrf_token'];
validate_csrf_request($csrf_token);

// initialize objects
$offering = new Offering();
$course_notes = null;
$offering_id = $_POST['offering_id'];
$user_id = $_POST['user_id'];
$offering->offering_id = $offering_id;
$offering->user_id = $user_id;
$stmt = $offering->get_your_note();
if ($stmt->rowCount() > 0) {
    if ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        if ($row['course_notes'] != "") {
            $course_notes = $row['course_notes'];
        }
    }
}
echo $course_notes;
?>