<?php include('session.php') ?>
<?php include('upload.php') ?>
<?php 
if (session_status() == PHP_SESSION_NONE) {
    session_start();
}
?>
<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
      <!-- SEO Meta Tags -->
      <meta name="description" content="Tivo is a HTML landing page template built with Bootstrap to help you crate engaging presentations for SaaS apps and convert visitors into users.">
      <meta name="author" content="Inovatik">
      <!-- OG Meta Tags to improve the way the post looks when you share the page on LinkedIn, Facebook, Google+ -->
      <meta property="og:site_name" content="" />
      <!-- website name -->
      <meta property="og:site" content="" />
      <!-- website link -->
      <meta property="og:title" content=""/>
      <!-- title shown in the actual shared post -->
      <meta property="og:description" content="" />
      <!-- description shown in the actual shared post -->
      <meta property="og:image" content="" />
      <!-- image link, make sure it's jpg -->
      <meta property="og:url" content="" />
      <!-- where do you want your post to link to -->
      <meta property="og:type" content="article" />
      <!-- Website Title -->
      <title>Home - Polytechnic University of the Philippines </title>
      <!-- Styles -->
      <link href="https://fonts.googleapis.com/css?family=Open+Sans:400,400i,700&display=swap&subset=latin-ext" rel="stylesheet">
      <link href="css/bootstrap.css" rel="stylesheet">
      <link href="css/fontawesome-all.css" rel="stylesheet">
      <link href="css/swiper.css" rel="stylesheet">
      <link href="css/magnific-popup.css" rel="stylesheet">
      <link href="css/sstyle.css" rel="stylesheet">
      <link href="css/pme_style.css" rel="stylesheet">
      <link href="css/mystyle.css" rel="stylesheet">
      <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.1.3/dist/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
      <!-- Favicon  -->
      <link rel="icon" href="../images/pup_logo.png">
   </head>
   <style>
      @font-face {
      font-family:"Berkshire Swash";
      src: url("css/berkshireswash-regular.ttf") format("truetype");
      }
   </style>
   <body data-spy="scroll" data-target=".fixed-top">
      <!-- Preloader -->
      <!--<div class="spinner-wrapper">-->
      <!--   <div class="spinner">-->
      <!--      <div class="bounce1"></div>-->
      <!--      <div class="bounce2"></div>-->
      <!--      <div class="bounce3"></div>-->
      <!--   </div>-->
      <!--</div>-->
      <!-- end of preloader -->
      <!-- Navigation -->
      <nav class="navbar navbar-expand-lg navbar-dark navbar-custom fixed-top" style="background-color: 	#892a25; ">
         <div class="container">
            <!-- Text Logo - Use this if you don't have a graphic logo -->
            <!-- <a class="navbar-brand logo-text page-scroll" href="index.html">Tivo</a> -->
            <!-- Image Logo -->
            <a class="navbar-brand logo-image" href="home.php"><img src="images/pup_logo.png" alt="alternative" style="height:50px; width: 50px; "></a>
            <!-- Mobile Menu Toggle Button -->
            <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-awesome fas fa-bars"></span>
            <span class="navbar-toggler-awesome fas fa-times"></span>
            </button>
            <!-- end of mobile menu toggle button -->
            <div class="collapse navbar-collapse" id="navbarsExampleDefault">
               <ul class="navbar-nav ml-auto">
                  <li class="nav-item">
                     <a class="nav-link page-scroll" href="home.php">HOME <span class="sr-only">(current)</span></a>
                  </li>
                  <li class="nav-item">
                        <a class="nav-link page-scroll" href="files.php"><span class="item-text">REQUIREMENTS</span></a>
                  </li>
                  <!-- end of dropdown menu -->
                  <li class="nav-item">
                     <a class="nav-link page-scroll" href="announcements.php">ANNOUNCEMENTS</a>
                  </li>
                  <li class="nav-item">
                     <a class="nav-link page-scroll" href="user-account.php">MY PROFILE</a>
                  </li>
               </ul>
               <span class="nav-item">
               <a class="btn-outline-sm" href="logout.php">LOG OUT</a>
               </span>
            </div>
         </div>
         <!-- end of container -->
      </nav>
        <br><br><br><br>

     <div style="padding:50px;">
     <h2 style="color: #b38930;">Requirements (<?php echo $_SESSION['dept_sess']; ?>)</h2><hr style="border-color: #b38930; margin-bottom: 0px;">
     <br>
     <!-- DROP DOWN LIST FOR POSTED ASSIGNMENT -->
                    <?php
                    $dept = $_SESSION['dept_sess'];
                    $sql_assign = mysqli_query($db, "SELECT * FROM requirements WHERE Department = '$dept' ORDER BY ID DESC");
                    $i = 1;
                    while($DB_ROW = mysqli_fetch_array($sql_assign)) {
                        if($DB_ROW['Due_Date'] == "None" || $DB_ROW['Due_Time'] == "None"){
                            $DB_ROW['Due_Date'] = "";
                            $DB_ROW['Due_Time'] = "";
                            $due = "";
                        }
                        else{
                            $due = "Due";

                        }
                        if($DB_ROW['Attached_File'] == "None"){
                            $DB_ROW['Attached_File'] = "";
                        }

                        echo '<button onclick="myFunction' . $i . '()" style="text-align: left; background-color: #fef9e8; width: 100%; padding: 20px; border: none; border-bottom: solid; border-radius: 5px; border-bottom-width: thin; border-bottom-color: #eccf69; color: #55565d; font-weight: bold;"><img src="images/assignments.png" style="width: 30px; height: 30px;">&nbsp &nbsp ' . $DB_ROW['Title'] . '<span style="float: right; font-weight: normal; font-size: 15px;">'. $due . ' ' . $DB_ROW['Due_Date'] . ' ' . $DB_ROW['Due_Time'] . '</span></button>';
                        echo '<div id="' . $i . '"   style="display: none;   width: 100%; padding: 5px 0; pading-top: 0px; text-align: left; background-color: #f7f7f7; border-bottom: solid; border-width: thin; border-color: #eccf69; border-radius: 10px;">';
                        echo '<br><p style="margin-left: 20px; font-size: 14px; color: #696969;">Posted ' . $DB_ROW["Date_Posted"] . '</p>';
                        echo '<p style="margin-left: 20px; font-size: 14px; ">' . $DB_ROW["Instructions"] . '</p>';
                        echo '<div style="width: 250px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;">';
                        echo '<br><a href="../attached_files/' . $DB_ROW["Attached_File"] . '" title="' . $DB_ROW["Attached_File"] . '" style="margin-left: 20px;" download>' . $DB_ROW["Attached_File"] . '</a>';
                        echo '</div>';

                        echo '<hr style="border-color: #cacaca;"><a href="view_assignment.php?ID='. $DB_ROW['ID'] .'" style="padding-left: 20px; border:none; background-color: #f7f7f7; color: orange; font-weight: bold;">View requirement';
                        echo '</a><br><br>';
                        echo '</div><br>';
                        echo '<script>';
                        echo 'function myFunction' . $i . '() {
                        var x = document.getElementById("' . $i . '");
                        if (x.style.display === "none") {
                            x.style.display = "block";
                        } else {
                            x.style.display = "none";
                        }
                        }
                        </script>';
                        $i++;
                    }
                    ?>
                    </div>

                    <br><br><br><br>
                    <br><br>
      <!-- Footer -->
      <svg class="footer-frame" data-name="Layer 2" xmlns="http://www.w3.org/2000/svg" preserveAspectRatio="none" viewBox="0 0 1920 79">
         <defs>
            <style>.cls-2{fill:#cb9824;}</style>
         </defs>
         <title>footer-frame</title>
         <path class="cls-2" d="M0,72.427C143,12.138,255.5,4.577,328.644,7.943c147.721,6.8,183.881,60.242,320.83,53.737,143-6.793,167.826-68.128,293-60.9,109.095,6.3,115.68,54.364,225.251,57.319,113.58,3.064,138.8-47.711,251.189-41.8,104.012,5.474,109.713,50.4,197.369,46.572,89.549-3.91,124.375-52.563,227.622-50.155A338.646,338.646,0,0,1,1920,23.467V79.75H0V72.427Z" transform="translate(0 -0.188)"/>
      </svg>
      <div class="footer" style="background-color: #cb9824;">
         <div class="container">
            <div class="row">
               <div class="col-md-4">
                  <div class="footer-col first">
                     <h4>About Polytechnic University of the Philippines</h4>
                     <p class="p-small">The Polytechnic University of the Philippines (PUP) is a government educational institution governed by Republic Act Number 8292 known as the Higher Education Modernization Act of 1997, and its Implementing Rules and Regulations contained in the Commission on Higher Education Memorandum Circular No. 4, series 1997.</p>
                  </div>
               </div>
               <!-- end of col -->
               <div class="col-md-4">
                  <div class="footer-col middle">
                     <h4>Important Links</h4>
                     <ul class="list-unstyled li-space-lg p-small">
                        <li class="media">
                           <i class="fas fa-square"></i>
                           <div class="media-body">Visit our facebook page : <a target='_blank' class="white" href="https://web.facebook.com/groups/808785762581233/?ref=share&_rdc=1&_rdr">PUP SAN JUAN</a></div>
                        </li>
                        <li class="media">
                           <i class="fas fa-square"></i>
                           <div class="media-body">See our web developers : <a target='_blank' class="white" href="https://web.facebook.com/kriztiana.org?_rdc=1&_rdr"><br><i class="fas fa-square"></i> Christine J. Fordan, BSIT</a>, <a target='_blank' class="white" href="https://web.facebook.com/ryan.pantig.35?_rdc=1&_rdr"><br><i class="fas fa-square"></i> Ryan Jay Pantig, BSIT</a>, <a target='_blank' class="white" href="https://web.facebook.com/ChesterCave09?_rdc=1&_rdr"><br><i class="fas fa-square"></i> Chester S. Cave, BSIT</a></div>
                        </li>
                     </ul>
                  </div>
               </div>
               <!-- end of col -->
               <div class="col-md-4">
                  <div class="footer-col last">
                     <h4>Contact</h4>
                     <ul class="list-unstyled li-space-lg p-small">
                        <li class="media">
                           <i class="fas fa-map-marker-alt"></i>
                           <div class="media-body">Addition Hills, San Juan, Metro Manila, Philippines.</div>
                        </li>
                        <li class="media">
                           <i class="fas fa-envelope"></i>
                           <div class="media-body">inquire@pup.edu.ph</div>
                        </li>
                     </ul>
                  </div>
               </div>
               <!-- end of col -->
            </div>
            <!-- end of row -->
         </div>
         <!-- end of container -->
      </div>
      <!-- end of footer -->
      <!-- end of footer -->
     
      <!-- Scripts -->
      <script src="js/jquery.min.js"></script> <!-- jQuery for Bootstrap's JavaScript plugins -->
      <script src="js/popper.min.js"></script> <!-- Popper tooltip library for Bootstrap -->
      <script src="js/bootstrap.min.js"></script> <!-- Bootstrap framework -->
      <script src="js/jquery.easing.min.js"></script> <!-- jQuery Easing for smooth scrolling between anchors -->
      <script src="js/swiper.min.js"></script> <!-- Swiper for image and text sliders -->
      <script src="js/jquery.magnific-popup.js"></script> <!-- Magnific Popup for lightboxes -->
      <script src="js/validator.min.js"></script> <!-- Validator.js - Bootstrap plugin that validates forms -->
      <script src="js/scripts.js"></script> <!-- Custom scripts -->
   </body>
</html>