<?php
require_once("includes/topo.php");
?>
<script src="tinymce/tinymce.min.js"></script>
<script>
    tinymce.init({
        selector: 'textarea',
        plugins: 'autolink lists link image charmap print preview',
        toolbar: 'undo redo | bold italic | alignleft aligncenter alignright | link image'
    });
</script>

<div class="content-body">
    <div class="container-fluid">
        <div class="page-titles">
            <ol class="breadcrumb">
                <a href="vagas.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 nova vaga</h4>

                            </div>
                            <div class="card-body">
                                <div class="basic-form">
                                    <form action="includes/class_vagas.php?vagas=1" method="post" enctype="multipart/form-data">

                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Empresa</label>
                                            <div class="col-sm-9">

                                                <div class="row align-items-center">
                                                    <div class="col-md-12 my-1">
                                                        <select name="empresa" class="me-sm-2 default-select form-control wide" id="inlineFormCustomSelect" Required>
                                                            <option value="">Escolha...</option>

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

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

                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Categoria</label>
                                            <div class="col-sm-9">

                                                <div class="row align-items-center">
                                                    <div class="col-md-12 my-1">
                                                        <select name="categoria" class="me-sm-2 default-select form-control wide" id="inlineFormCustomSelect" Required>
                                                            <option value="">Escolha...</option>

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

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

                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Título da vaga</label>
                                            <div class="col-sm-9">
                                                <input type="text" name="titulo" class="form-control" value="" Required>

                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Empresa</label>
                                            <div class="col-sm-9">

                                                <div class="row align-items-center">
                                                    <div class="col-md-12 my-1">
                                                        <select name="status" class="me-sm-2 default-select form-control wide" id="inlineFormCustomSelect" Required>
                                                            <option value="">Escolha...</option>

                                                            <option value="Aberta">Aberta</option>
                                                            <option value="Finalizada">Finalizada</option>
                                                            <option value="Cancelada">Cancelada</option>

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

                                            </div>
                                        </div>
                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Descrição</label>
                                            <div class="col-sm-9">
                                                <textarea name="descricao" class="form-control" value=""></textarea>
                                            </div>
                                        </div>

                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Salário</label>
                                            <div class="col-sm-9">
                                                <input type="text" name="salario" class="form-control" value="">

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

                                        <div class="mb-3 row">
                                            <label class="col-sm-3 col-form-label">Benefícios</label>
                                            <div class="col-sm-9">
                                                <input type="text" name="beneficios" class="form-control" value="">

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

                                            </div>
                                        </div>

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



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

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