<?php
define('Admin_USER',true);
session_start();
if(!isset($_SESSION['adm1n']) || $_SESSION['adm1n']['Nbr'] == ''){
  
       header("Location: ../misc/default.php");
       exit;
       
}
require_once("../../includes/php/defines.php");
require_once("../../includes/php/classes/mainClass.php");
require_once("../../includes/php/classes/documentClass.php");

$d = new docClass;
$categories = $d->getDocCategories();

?>
<section>
<div class="container-fluid">
    <div class="container">
        <div class="col-md-4">
            <div class="col-md-12 result-heading">
                <div class="rh-form">
                    <div class="col-md-10">
                        <h1>Document Search</h1>
                        <form id="Search_Form" name="Search_Form"> 
                            <div class="form-group">
                                <input type="button" value="Upload Document" onclick="contentChanger('documents/add-document.php','','','documents/manage-documents.php');">
                            </div>                         
                            <div class="form-group">
                                <label>Document Category</label>
                                <select  class="col-md-12" id="Category" name="Category" onchange="processSearch('Documents','No_Clear');">
                                    <option value="" selected="selected">choose</option>
                                    <?php
                                    for($i=0;$i<count($categories);$i++){

                                        echo '<option value="'.$categories[$i]['Nbr'].'">'.$categories[$i]['Name'].'</option>';

                                    }
                                    ?>
                                </select>
                            </div>                                                        
                        </form>
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-8">
            <div class="col-md-12 result-heading">
                <h1>Uploaded Documents</h1>&nbsp;
              <div id="Animation">
                  <div class="blockG" id="rotateG_01"></div>
                  <div class="blockG" id="rotateG_02"></div>
                  <div class="blockG" id="rotateG_03"></div>
                  <div class="blockG" id="rotateG_04"></div>
                  <div class="blockG" id="rotateG_05"></div>
                  <div class="blockG" id="rotateG_06"></div>
                  <div class="blockG" id="rotateG_07"></div>
                  <div class="blockG" id="rotateG_08"></div>                                            
              </div>
              <div id="Result" style="margin-bottom:25px;"></div>                 
            </div>
            <div id="RowContainer">
              <p class="empty_msg">Choose a document/upload category from the drop down menu on the right.</p>
            </div>
        </div>
    </div>
</div>
</section>