<!--
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.
-->
<?php 
include 'insmenu.php';
include '../ConnectionDatabase.php';
include 'InstructorObject.php';
$currentUserId = $_SESSION['UserId'];
?>

<?php 
if (isset($_REQUEST['examDeleteButton'])) {
    $selectedExamID = $_POST['selectedExamId'];
    InstructorObject::deleteExam($selectedExamID);
    // $query = "DELETE from exam where examid='$selectedExamID'";
    //mysql_query($query) or die (mysql_error());
}
if (isset($_REQUEST['manageQuestionsButton'])) {
    $selectedExamID = $_POST['selectedExamId'];
    $_SESSION['selectedExamId'] = $selectedExamID;
    header('Location: ./insmanagequestions.php');
}
if (isset($_REQUEST['editExam_saveButton'])) {
    //$examName = addslashes($_POST['popup_examName']);
    //$examType = addslashes($_POST['popup_examTypeRadios']);
    $parts = explode('/', $_POST['popup_startDate']);
    $startDate = addslashes("{$parts['2']}-{$parts['1']}-{$parts['0']}");
    // change date format to yyyy-mm-dd(for mysql)
    $parts = explode('/', $_POST['popup_endDate']);