<?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/navUtility.php");

$nav = new navigationUtility();
$categories = $nav->getOptionCategories(true);
?>
<section>
<div class="container-fluid">
    <div class="container">           
            <div class="col-md-12 result-heading">
                <h1>Manage Navigation Option Categories</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">
        <?php
              if($categories[0]['Nbr'] != ''){
                     
                     for($i=0;$i<count($categories);$i++){
                         
                            echo '<div class="col-md-12';
                            if($i == 0 || $i%2 == 0) { echo ' light-white'; }
                            echo '" id="Row_'.$categories[$i]['Nbr'].'" name="Row_'.$categories[$i]['Nbr'].'">';
                            echo '<div class="result-form">';
                            echo '<h2>'.$categories[$i]['Name'].'</h2>';
                            echo '<p>'.$categories[$i]['Desc'].'</p>';
                            echo '<p style="padding-top:20px;">';
                            echo '<div class="form-group" id="Form_'.$categories[$i]['Nbr'].'" id="Name_'.$categories[$i]['Nbr'].'">';
                            echo '<div class="col-md-4">';
                            echo '<input type="radio" id="Status_Active_'.$categories[$i]['Nbr'].'" name="Status_'.$categories[$i]['Nbr'].'" value="1" ';
                            if($categories[$i]['Status'] == '1'){

                               echo 'checked="checked"';

                            }
                            echo ' onclick="updateNavigation(\''.$categories[$i]['Nbr'].'\');"> <span class="cbox">Active</span>';
                            echo '</div>';
                            echo '<div class="col-md-4">';
                            echo '<input type="radio" id="Status_Inactive_'.$categories[$i]['Nbr'].'" name="Status_'.$categories[$i]['Nbr'].'" value="0" ';
                            if($categories[$i]['Status'] == '0'){

                                   echo 'checked="checked"';

                            } 
                            echo ' onclick="updateNavigation(\''.$categories[$i]['Nbr'].'\');"> <span class="cbox">Inactive</span>';
                            echo '</div>';
                            echo '</div>';
                            echo '</p>';
                            echo '</div>';
                            echo '</div>';
                                    
                     }
                     
              }else{
                           
                           echo '<div class="col-md-12 light-white><div class="result-form"><h2>Your search returned no records matching your search criteria</h2></div></div>';
                           
                    }  
         ?>
        </div>
</div>
</div>
</section>