<?php 
include('session.php');
$topic = "";
$instructions = "";
$link = "";
$due_date = ""; 
$due_time = "";
$attached_file = "";
$date_posted = "";
$time_posted = "";

if($_SERVER["REQUEST_METHOD"] == "GET")
{   
    $ID = $_GET["ID"];
    $sql_evaluation = mysqli_query($db, "SELECT * FROM evaluations WHERE ID='$ID'");
    while($DB_ROW = mysqli_fetch_array($sql_evaluation)) {

        $topic = $DB_ROW["Topic"];
        $link = $DB_ROW["Link"];
        $instructions = $DB_ROW["Instructions"];
        $due_date = $DB_ROW['Due_Date'];
        $due_time = $DB_ROW['Due_Time'];
        $date_posted = $DB_ROW['Date_Posted'];
        $time_posted = $DB_ROW['Time_Posted'];
        $turned_in = $DB_ROW['Turned_in'];
    }
}

if($topic != ""){
    $enable_topic = "";
}
else{
    $enable_topic = "";
}
?>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
      <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>PME-ADMIN</title>
	<link rel="icon" type="image/png" href="images/icons/minsu-icon.ico"/>
	<!-- BOOTSTRAP STYLES-->
    <link href="assets/css/bootstrap.css" rel="stylesheet" />
     <!-- FONTAWESOME STYLES-->
    <link href="assets/css/font-awesome.css" rel="stylesheet" />
     <!-- MORRIS CHART STYLES-->
    <link href="assets/js/morris/morris-0.4.3.min.css" rel="stylesheet" />
        <!-- CUSTOM STYLES-->
    <link href="assets/css/custom.css" rel="stylesheet" />
     <!-- GOOGLE FONTS-->
   <link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />


</head>
<body style="font-family: Arial;">
    <div id="wrapper">
        <!-- /. NAV SIDE  -->
            <div id="page-inner" style="padding-left: 30px; padding-right: 30px;">
                <div class="row">
                    <div class="col-md-12">
                    <a href="evaluations-su.php?campus=<?php echo $_GET['campus']; ?>"><button style="float: left; margin-top: 20px; cursor: pointer; background-color: #313131; border-radius: 5px; margin-left: 10px;" title="Click to go back"><img src="images/back_btn.png" width="25px" height= "25px" style="border: none; background-color: #313131; border-radius: 5px; padding: 3px;"></button></a><p style="color: white; background-color: #3c5755; padding: 18px; margin-top: -0.1px; font-family: Arial; font-weight: bold; font-size: 27px;">&nbsp<img src="images/comments_white.png" style="width: 40px; height: 40px; margin-top: -5px;">&nbsp Evaluation</p>   
                    <br>
                </div>
                <?php
                    if($due_date == "None" || $due_time == "None"){
                      $due = "No due date";
                      $due_date = ""; 
                      $due_time = "";
                    }
                    else{
                      $due = "Due";
                    }
                    echo '<div style="background-color: #f9f9f9; padding-bottom: 30px;">';
                    echo '<p style="margin-left: 40px; font-size: 14px; color: #696969;">Posted '.$date_posted. ' <span style="float: right; padding-right: 80px; font-weight: bold;">'.$due. ' ' . $due_date . ' ' . $due_time .'</span></p>';
                    echo '<p style="margin-left: 40px; font-size: 16px; font-weight: bold; ">'.$enable_topic.' '.$topic.'</p>';
                    echo '<hr><p style="margin-left: 40px; margin-top: -20px; font-size: 14px; padding-right: 30px; ">'.$instructions.'</p>';
                    echo '<br><a href="' .$link. '" style="margin-left: 40px;" target="_blank">'.$link.'</a>';
                    echo '</div><hr>';
                ?>        
                </div>  
                <div class="col-md-3 col-sm-12 col-xs-12">         
			<div class="panel panel-back noti-box" style="background-color: #f1f1f1;">
            <center><img src="images/turned_in.jpg" alt="Message" style="width:80px;height:75px;"></center>
                
            <center><div class="text-box">
                    <p class="main-text"><?php echo $turned_in;?></p>
                    <p class="text-muted">Turned in</p>
                </div></center>
             </div>
		     </div>
            </div>
    </div>
     <!-- /. WRAPPER  -->
    <!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
    <!-- JQUERY SCRIPTS -->
    <script src="assets/js/jquery-1.10.2.js"></script>
      <!-- BOOTSTRAP SCRIPTS -->
    <script src="assets/js/bootstrap.min.js"></script>
    <!-- METISMENU SCRIPTS -->
    <script src="assets/js/jquery.metisMenu.js"></script>
      <!-- CUSTOM SCRIPTS -->
    <script src="assets/js/custom.js"></script>

    <script>
    // Get the modal
    var modal = document.getElementById("myModal");

    // Get the button that opens the modal
    var btn = document.getElementById("myBtn");

    // Get the <span> element that closes the modal
    var span = document.getElementsByClassName("close")[0];

    // When the user clicks the button, open the modal 
    btn.onclick = function() {
    modal.style.display = "block";
    }

    // When the user clicks on <span> (x), close the modal
    span.onclick = function() {
    modal.style.display = "none";
    }

    // When the user clicks anywhere outside of the modal, close it
    window.onclick = function(event) {
    if (event.target == modal) {
        modal.style.display = "none";
    }
    }
    </script>

    <script>
       document.getElementById('select-all').onclick = function() {
        var checkboxes = document.querySelectorAll('input[type="checkbox"]');
        for (var checkbox of checkboxes) {
            checkbox.checked = this.checked;
        }
       } 
    </script>

    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
    <script>
    $("#checkboxes input").click(function () {
    $("#output").text($("#checkboxes input:checked").map(function () {
        return $(this).val();
    }).get().join());
    }).click().click();
    </script>

    <!-- <script>
        document.getElementById('submitID').disabled = true; //Disable at first
        //Listen for keyup event (after we hit a key)
        //-----------------------------------------------------------
        //NOTE: We can also use the change event, but the submit button
        //      won't update until we finish typing the whole thing
        //-----------------------------------------------------------
        document.getElementById('myInputFieldID').addEventListener('keyup', e => {
        //Check for the input's value
        if (e.target.value == "") {
            document.getElementById('submitID').disabled = true;
        }
        else {
            document.getElementById('submitID').disabled = false;
        }
        });
        </script> -->
        
   
</body>
</html>
