<?php
if(!isset($_GET['Id']) || $_GET['Id'] == ''){
       
       header("Location: manage-options.php");
       exit;
       
}
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();
$info = $nav->getOptionInfo($_GET['Id']);
?>
<section>
	<div class="container-fluid">
		<div class="container">
			<div class="col-md-12 result-heading">
				<div class="rh-form">				
					<h1>Modify Navigation Option</h1>&nbsp;					
					<form class="a-r-form" id="Admin_Form">
                                                                             <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"></div>                         
						<div class="form-group">
							<label>Category Option</label>
							<select  class="col-md-12" id="Category" name="Category">
								<option value="" selected="selected">- choose -</option>
                                                                                                      <?php
                                                                                                                for($i=0;$i<count($categories);$i++){
                                                                                                                       
                                                                                                                       echo '<option value="'.$categories[$i]['Nbr'].'"';
                                                                                                                       if($info['Category'] == $categories[$i]['Nbr']){
                                                                                                                              
                                                                                                                              echo ' selected="selected"';
                                                                                                                              
                                                                                                                       }
                                                                                                                       echo '>'.$categories[$i]['Name'].'</option>';
                                                                                                                       
                                                                                                                }
                                                                                                      ?>
							</select>
						</div>						
                                                                             <div class="form-group">
							<label>Name</label>
							<input type="text" class="col-md-12" id="Name" name="Name" value="<?php echo $info['Name']; ?>" >
						</div>
                                                                             <div class="form-group">
							<label>Page</label>
							<input type="text" class="col-md-12" id="Page" name="Page" value="<?php echo $info['Page']; ?>" >
						</div>																							
						<div class="form-group">
                                                                                          <p class="label-p">Description</p>
							<textarea class="col-md-12" rows="5" id="Desc" name="Desc"><?php echo $info['Desc']; ?></textarea>
						</div>
						<div class="form-group">
							<label>Visible On Navigation</label>
							<div class="col-md-4">
                                                        <input type="radio" value="1" name="Visible" <?php if($info['Visible'] == 1){ echo ' checked="checked"'; } ?> > <span class="cbox">Visible</span>
							</div>
							<div class="col-md-4">
								<input type="radio" value="0" name="Visible" <?php if($info['Visible'] == 0){ echo ' checked="checked"'; } ?> > <span class="cbox">Not Visible</span>
							</div>
						</div>							
						<div class="form-group" id="Submit_Paragraph">
							<input type="hidden" id="Id" name="Id" value="<?php echo $info['Nbr']; ?>"/>
                                                                                           <input type="button" value="submit" onclick="processForm('Modify-Navigation-Option','No_Clear');">
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</section>