{% extends 'CmBundle:Z:baseDos.html.twig' %}

{% block stylesheet %}
    <style>
        .error {
            color: red;
            border-color: red;
        }

        form.form-grupos label.error {
            display: none;
        }
    </style>
{% endblock %}

{% block javascripts %}
    <script src="{{ asset('js/misJs/curriculas.js') }}"></script>
    <script src="{{ asset('js/misJs/ver-curriculas.js') }}"></script>
    <script src="{{ asset('js/misJs/validarCurriculas.js') }}"></script>
    <script src="{{ asset('js/misJs/validarMapaCurricular.js') }}"></script>

    <script src="{{asset('js/misJs/cur/editarDatosAsignaturas.js')}}"></script>
{% endblock %}

{% block content %}
    <div class="container-fluid">
        <h1 class="mt-4">REGISTRO DE ASIGNATURA</h1>
        <ol class="breadcrumb mb-2">
            <li class="breadcrumb-item"><a href="{{ path('cm_homepage') }}">Tablero</a></li>
            <li class="breadcrumb-item active">Registro de Asignatura</li>
        </ol>

        <div class="row">
            <div class="col-lg-12">
                <div class="card border-secondary mb-1">
                    <div class="card-header bg-secondary border-secondary text-white">
                        <i class="fas fa-building mr-1"></i>
                        LLENAR EL SIGUIENTE FORMULARIO
                    </div>
                    <div class="card-body">
                        <div class="col-lg-12">
                            <form class="row small" action="{{ path('curricula') }}" method="POST" id="form-curricula">
                                <div class="col-lg-8">
                                    <label class="control-label" for="cveLic">Especialidad:</label>
                                    <select id="cveLic" name="cveLic" class="form-control form-control-sm">
                                        <option value="default">Selecciona</option>
                                        {% if licenciaturas is defined %}
                                            {% set nivel = 0 %}
                                            {% for l in licenciaturas %}
                                                {% if nivel != l.cveNivAca.ideNivAca %}
                                                    <optgroup label="{{ l.cveNivAca.nombre }}"></optgroup>
                                                    {% set nivel = l.cveNivAca.ideNivAca %}
                                                {% endif %}
                                                <option value="{{ l.ideLic }}">{{ l.nomLic }}</option>
                                            {% endfor %}
                                        {% endif %}
                                    </select>
                                </div><!-- col-lg-6 -->
                                <div class="col-lg-6" id="contenedor-mapa-curricular">

                                </div><!-- col-lg-6 -->
                                <div class="col-lg-4">
                                    <label class="control-label" for="clave">CLAVE:</label>
                                    <input type="text" class="form-control form-control-sm" id="clave" name="clave"
                                           placeholder="Clave de la Asignatura">
                                </div><!-- col-lg-4 -->
                                <div class="col-lg-6">
                                    <label class="control-label" for="modalidad">Modalidad:</label>
                                    <select id="modalidad" name="modalidad" class="form-control form-control-sm">
                                        <option value="default">Selecciona</option>
                                        <option value="0">CUATRIMESTRAL</option>
                                        <option value="1">SEMESTRAL</option>
                                    </select>
                                </div><!-- col-lg-6 -->
                                <div class="col-lg-4">
                                    <div id="contenedorSemestre">
                                        <label class="control-label" for="numSem">Numero de Semestre:</label>
                                        <select id="numSem" name="numSem" class="form-control form-control-sm">
                                            <option value="default" selected="true">Selecciona</option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                    <div id="contenedorCuatrimestre">
                                        <label class="control-label" for="numCua">Numero de Cuatrimestre:</label>
                                        <select id="numCua" name="numCua" class="form-control form-control-sm">
                                            <option value="default" selected="true">Selecciona</option>
                                            <option value="1">1</option>
                                            <option value="2">2</option>
                                            <option value="3">3</option>
                                            <option value="4">4</option>
                                            <option value="5">5</option>
                                            <option value="6">6</option>
                                            <option value="7">7</option>
                                            <option value="8">8</option>
                                            <option value="9">9</option>
                                            <option value="10">10</option>
                                            <option value="11">11</option>
                                            <option value="12">12</option>
                                        </select>
                                    </div>
                                </div><!-- col-lg-4 -->
                                <div class="col-lg-8">

                                    <label class="control-label" for="nomAsignatura">NOMBRE DE LA ASIGNATURA:</label>
                                    <input type="text" class="form-control form-control-sm" id="nomAsignatura"
                                           name="nomAsignatura"
                                           placeholder="Nombre de la Asignatura">

                                </div><!-- col-lg-8 -->
                                <div class="col-lg-4">
                                    <label class="control-label" for="tipCurr">TIPO DE ASIGNATURA:</label>
                                    <select id="tipCurr" name="tipCurr" class="form-control form-control-sm">
                                        <option value="default">Selecciona</option>
                                        <option value="1" selected="true">CURRICULAR</option>
                                        <option value="0">EXTRACURRICULAR</option>
                                    </select>
                                </div><!-- col-lg-4 -->
                                <div class="form-group">
                                    <div class="col-sm-offset-2 col-sm-10 text-right">
                                        <button type="submit" class="btn btn-primary">Registrar</button>
                                    </div>
                                </div>
                            </form><!-- form -->

                        </div><!-- FIN col-ñg-12 -->
                    </div><!-- FIN card-body -->
                </div><!-- FIN row -->


            </div>
            <div class="col-lg-12" style="margin-top: solid 2px green;">

            </div>
            <div class="col-lg-12 col-md-12 col-sm-12" style="margin-bottom: 5px;">
                <h4>CONSULTAR ASIGNATURAS</h4>
            </div>
            <div class="col-lg-12 col-md-12 col-sm-12" style="margin-bottom: 5px;">
                <div class="row">
                    <div class="col-lg-4 col-md-4 col-sm-12">
                        <label class="control-label" for="niveles">Especialidad:</label>
                        <select id="niveles" name="niveles" class="form-control form-control-sm">
                            <option value="default" selected="true">Selecciona una opción</option>
                            {% set nivel = 0 %}
                            {% for e in licenciaturas %}
                                {% if nivel != e.cveNivAca.ideNivAca %}
                                    <optgroup label="{{ e.cveNivAca.nombre }}"></optgroup>
                                    {% set nivel = e.cveNivAca.ideNivAca %}
                                {% endif %}
                                <option value="{{ e.ideLic }}">{{ e.nomLic }}</option>
                            {% else %}

                            {% endfor %}
                        </select>
                    </div><!-- col-lg-6 col-md-6 col-sm-12 -->
                    <div class="col-lg-4 col-md-4 col-sm-12" id="contenedor-mapa-curricula-dos">
                    </div><!-- col-lg-6 col-md-6 col-sm-12 -->
                    <div class="col-lg-2 col-md-2 col-sm-12">
                        <label class="control-label" style="width: 100%;">*</label>
                        <a class="btn btn-primary btn-sm" onclick="traerMaterias()">BUSCAR</a>
                    </div><!-- col-lg-6 col-md-6 col-sm-12 -->
                </div><!-- fin row -->
            </div>

            <div class="col-lg-12 col-md-12 col-sm-12 table-responsive" id="contenedor-materias"
                 style="overflow-y: scroll;height: 400px;">

            </div><!-- col-lg-12 col-md-12 col-sm-12 table-responsive -->
        </div>


    </div>

{% endblock %}