<?php 
require_once ("includes/topo.php"); 
 ?>


<div class="content-body">
    <div class="container-fluid">
    <div class="page-titles">
            <ol class="breadcrumb">
                <a href="menus.php" class="btn light btn-dark btn-xs">Voltar</a>
            </ol>
        </div>
        <div class="row">
            <div class="col-xl-12">
                <div class="row">
                    <div class="col-xl-12 col-lg-12">
                        <div class="card">
                            <div class="card-header">
                                <h4 class="card-title">Adicionar novo Menu Pai</h4>
                                
                            </div>
                            <div class="card-body">
                                <div class="basic-form">
                                    <form action="includes/class_menus.php?menus=1" method="post" enctype="multipart/form-data">

                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Nome</label>
                                            <div class="col-sm-9">
                                                <input type="text" name="nome" class="form-control" value="">
                                                
                                            </div>
                                        </div>

                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Link</label>
                                            <div class="col-sm-9">
                                                <input type="text" name="link" class="form-control" value="">
                                                
                                            </div>
                                        </div>

                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Módulo</label>
                                            <div class="col-sm-9">
                                                
                                            <div class="row align-items-center">
                                                <span>Só escolha um módulo se precisar!</span>
                                                <div class="col-md-12 my-1">
                                                    <select name="modulo" class="me-sm-2 default-select form-control wide" id="inlineFormCustomSelect">
                                                        <option value="">Escolha...</option>

                                                        <?php
                                                            $query = $pdo->query("SELECT * FROM modulos order by id asc");
                                                            $modulos = $query->fetchAll(PDO::FETCH_ASSOC);
                                                            for($icat=0; $icat < @count($modulos); $icat++){		
                                                        ?>
                                                        <option value="<?php echo $modulos[$icat]['id'] ?>"><?php echo $modulos[$icat]['nome'] ?></option>
                                                        <?php } ?>

                                                    </select>
                                                </div>
                                            </div>

                                            </div>
                                        </div>

                                        
                                        
                                        
                                        
                                        <div class="mb-3 row">
                                            <div class="col-sm-10">
                                                <button type="submit" class="btn btn-primary">Criar Menu</button>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
					</div>

                    
                    
                </div>
            </div>
        </div>
    </div>
</div>

<?php require_once ("includes/rodape.php");  ?>