<?php 
    include("../db.php");
    if($_POST){

        $id=$_GET['id'];
        $_POST['type']='submenu';
        $_POST['status']=1;
        $db->updateAry("extra_menu", $_POST, "where id=$id");
        
        header("Location: extra");
    }
?>

<!DOCTYPE html>
<html>
<head>
    <title>Admin Dashboard</title>
    <?php include("meta.php"); ?>

</head>
<body> 
 
<?php include("header.php"); ?>

<?php include("sidebar.php"); 

if(isset($_GET['id'])){
    $id=$_GET['id'];
}

    $data = $db->getRow("select * from extra_menu where id=$id ");

?>

<div class="main">
    
    <div class="container">
        <div class="row">
            <div class="col-md-12">
                <div class="content-div">
                    <h2 style="font-size: 20px;">EDIT EXTRA MENUS</h2>
                    
                    <form action="" method="post" >
                        <div class="form-row row">
                            <div class="col-md-2"><label style="margin-left: 18%;">Link name</label></div>
                            <div class="col-md-10"><input  name="linkname" value="<?php echo $data['linkname'];?>" style="width:50%;height: 140%;" >
                        </div>
                        </div>
                        <div class="form-row row" style="margin-top: 2%;">
                            <div class="col-md-2"><label style="margin-left: 18%;">Heading</label></div>
                            <div class="col-md-10"><input  name="heading" value="<?php echo $data['heading'];?>" style="width:50%;height: 140%;" >
                        </div>
                        </div>
                       
                       <br>
                        <div class="form-row form-check text-center"><input type="submit" class="btn btn-primary" style="margin-left: -34%;" value="Save Changes"></div>
                    </form>
                    
                </div>

            </div>   
        </div>
    </div>
    
</div>
     
</body>
</html> 
