<div class="">
    <div class="page-title">
        <div class="title_left">
            <h3>Temario</h3>
        </div>
    </div>
    <div class="clearfix"></div>
    <div class="row">
        <div class="col-md-12 col-sm-12 col-xs-12">
            <div class="x_panel">
                <div class="x_title">
                    <h2>Consultar un temario</h2>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                    <form id="form-nueva" data-parsley-validate class="form-horizontal form-label-left"
                        enctype="multipart/form-data">
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                                <label class="text-sm-left" for="materia">Materia <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <select id="materia" name="materia" required="required"
                                    class="form-control form-control-sm" disabled>
                                    <option value="{{ $tem->materia->cve_mat }}">{{ $tem->materia->nombre_mat }}
                                    </option>
                                </select>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_materiaf" style="display: none">
                                </div>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                                <label class="text-sm-left" for="horasT">Horas
                                    teóricas <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <input type="text" id="horasT" name="horasT" required="required"
                                    class="form-control form-control-sm" oninput="total_horas_materias()"
                                    value="{{ $tem->horasTeoricas_tem }}" disabled>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                                <div class="alert alert-danger" role="alert" id="a_horasT" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_horasT" style="display: none">
                                </div>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>

                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                                <label class="text-sm-left" for="horasP">Horas
                                    practicas <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <input type="text" id="horasP" name="horasP" required="required"
                                    class="form-control form-control-sm" oninput="total_horas_materias()"
                                    value="{{ $tem->horasPracticas_tem }}" disabled>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_horasP" style="display: none">
                                </div>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>

                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                                <label class="text-sm-left" for="totalH">Total
                                    de horas <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <input type="text" id="totalH" name="totalH" required="required"
                                    class="form-control form-control-sm" value="{{ $tem->totalHoras_tem }}" disabled>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>

                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                                <label class="text-sm-left" for="caracterasig">Caracterización de la asignatura<span
                                        class="required">*</span>
                                </label>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <textarea class="form-control form-control-sm" id="caracterasig" name="caracterasig" rows="8"
                                    style="resize: none" disabled>{{ $tem->caracterasig_tem }}</textarea>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_caracter"
                                    style="display: none">
                                </div>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                                <label class="text-sm-left" for="intencion">Intención didáctica<span
                                        class="required">*</span>
                                </label>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <textarea class="form-control form-control-sm" id="intencion" name="intencion" rows="8" style="resize: none"
                                    disabled>{{ $tem->intendidac_tem }}</textarea>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                            <div class="col-md-8 col-sm-10 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_intencion"
                                    style="display: none">
                                </div>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div <div class="mb-1 row">
                        <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                        </div>
                        <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                            <label class="text-sm-left" for="competenciasdesa">Competencias
                                a desarrollar <span class="required">*</span>
                            </label>
                        </div>
                        <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                        </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <textarea class="form-control form-control-sm" id="competenciasdesa" name="competenciasdesa" rows="5"
                            style="resize: none" disabled>{{ $tem->competenciasDes_tem }}</textarea>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <div class="alert alert-danger" role="alert" id="a_comdesa" style="display: none">
                        </div>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-form-label col-md-8 col-sm-10 col-xs-12 text-left">
                        <label class="text-sm-left" for="competenciaspre">Competencias
                            previas <span class="required">*</span>
                        </label>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <textarea class="form-control form-control-sm" id="competenciaspre" name="competenciaspre" rows="5"
                            style="resize: none" disabled>{{ $tem->competenciasPre_tem }}</textarea>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <div class="alert alert-danger" role="alert" id="a_compre" style="display: none">
                        </div>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <label class="text-sm-left" for="practica">Práctica<span class="required">*</span>
                        </label>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <textarea class="form-control form-control-sm" id="practica" name="practica" rows="5" style="resize: none"
                            disabled>{{ $tem->practicas_tem }}</textarea>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <div class="alert alert-danger" role="alert" id="a_practica" style="display: none">
                        </div>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <label class="text-sm-left" for="proyecasig">Proyecto de asignatura<span
                                class="required">*</span>
                        </label>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <textarea class="form-control form-control-sm" id="proyecasig" name="proyecasig" rows="5"
                            style="resize: none" disabled>{{ $tem->proyectoasig_tem }}</textarea>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <div class="alert alert-danger" role="alert" id="a_proyecasig" style="display: none">
                        </div>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <label class="text-sm-left" for="evalcom">Evaluación por competencias<span
                                class="required">*</span>
                        </label>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <textarea class="form-control form-control-sm" id="evalcom" name="evalcom" rows="5" style="resize: none"
                            disabled>{{ $tem->evalcom_tem }}</textarea>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <div class="alert alert-danger" role="alert" id="a_evalcom" style="display: none">
                        </div>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <label class="text-sm-left" for="fuenteinf">Fuentes de información<span
                                class="required">*</span>
                        </label>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <textarea class="form-control form-control-sm" id="fuenteinf" name="fuenteinf" rows="5" style="resize: none"
                            disabled>{{ $tem->fuentes_tem }}</textarea>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div class="mb-1 row">
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                    <div class="col-md-8 col-sm-10 col-xs-12">
                        <div class="alert alert-danger" role="alert" id="a_fuenteinf" style="display: none">
                        </div>
                    </div>
                    <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                    </div>
                </div>
                <div id="contenedor_unidades">
                    <div class="">
                        <table id="tabla" class="table table-striped jambo_table bulk_action">
                            <thead>
                                <tr>
                                    <td>
                                        <center>No. Unidad</center>
                                    </td>
                                    <td>
                                        <center>Tema</center>
                                    </td>
                                    <td>
                                        <center>Subtema</center>
                                    </td>
                                </tr>
                            </thead>
                            <tbody id="contenedor_reng">

                                @foreach ($uni as $u)
                                    <tr class="row_unidades" id="rowunidad_1">
                                        <td data-label="No. Unidad: " class="u text-center">
                                            {{ $u->unidad->no_uni }}
                                        </td>
                                        <td data-label="Tema" class="t">
                                            {{ $u->unidad->tema_uni }}</td>
                                        <td data-label="Subtema: " class="s">
                                            <p class="row_subtemas" id="subT_'rowunidad_1'">

                                                <?php
                                                $cadTex = '';
                                                $banderaP = false;
                                                $banderaE = false;
                                                $cadena = $u->unidad->subtema_uni;
                                                for ($i = 0; $i < strlen($cadena); $i++) {
                                                    if (substr($cadena, $i, 1) == '.') {
                                                        $banderaP = true;
                                                    } else {
                                                        if (substr($cadena, $i, 1) == ' ' && $banderaP) {
                                                            $banderaE = true;
                                                        } else {
                                                            if (intval(substr($cadena, $i, 1)) >= 0 && intval(substr($cadena, $i, 1)) <= 9 && $banderaE) {
                                                                $cadTex .= '<br>';
                                                                $banderaE = false;
                                                                $banderaP = false;
                                                            } else {
                                                                $banderaE = false;
                                                                $banderaP = false;
                                                            }
                                                        }
                                                    }
                                                    $cadTex .= substr($cadena, $i, 1);
                                                }
                                                echo $cadTex;
                                                ?>
                                            </p>
                                        </td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
                <br>
                <div class="x_title">
                    <h2>Actividades de aprendizaje</h2>
                    <div class="clearfix"></div>
                </div>
                <div id="contenedor_competencias">
                    <div class="">
                        <table id="tabla" class="table table-striped jambo_table bulk_action">
                            <thead>
                                <tr>
                                    <td>
                                        <center>No. Unidad</center>
                                    </td>
                                    <td>
                                        <center>Competencia Especifica</center>
                                    </td>
                                    <td>
                                        <center>Competencia Genérica</center>
                                    </td>
                                    <td>
                                        <center>Actividades de Aprendizaje </center>
                                    </td>
                                </tr>
                            </thead>
                            <tbody id="contenedor_reng">
                                @foreach ($act as $a)
                                    <tr class="row_unidades" id="rowunidad_1">
                                        <td data-label="No. Unidad: " class="u text-center">
                                            {{ $a->ActividadAprendizaje->nou_actapre }}</td>
                                        <td data-label="Competencia Especifica: " class="t">
                                            {{ $a->ActividadAprendizaje->competenciasEsp_actapre }}
                                        </td>
                                        <td data-label="Competencia Genérica: " class="s">
                                            <p class="row_subtemas" id="subT_'rowunidad_1'">
                                                <?php
                                                $cadTex = '';
                                                $banderaP = false;
                                                $banderaE = false;
                                                $cadena = $a->ActividadAprendizaje->competenciasGen_actapre;
                                                for ($i = 0; $i < strlen($cadena); $i++) {
                                                    if (substr($cadena, $i, 1) == '.') {
                                                        $banderaP = true;
                                                    } else {
                                                        if (substr($cadena, $i, 1) == ' ' && $banderaP) {
                                                            $banderaE = true;
                                                        } else {
                                                            if (intval(substr($cadena, $i, 1)) >= 0 && intval(substr($cadena, $i, 1)) <= 9 && $banderaE) {
                                                                $cadTex .= '<br>';
                                                                $banderaE = false;
                                                                $banderaP = false;
                                                            } else {
                                                                $banderaE = false;
                                                                $banderaP = false;
                                                            }
                                                        }
                                                    }
                                                    $cadTex .= substr($cadena, $i, 1);
                                                }
                                                echo $cadTex;
                                                ?>
                                            </p>
                                        </td>
                                        <td data-label="Actividades de Aprendizaje: " class="t">
                                            <?php
                                            $cadTex = '';
                                            $banderaP = false;
                                            $banderaE = false;
                                            $cadena = $a->ActividadAprendizaje->actapre_actapre;
                                            for ($i = 0; $i < strlen($cadena); $i++) {
                                                if (substr($cadena, $i, 1) == '.') {
                                                    $banderaP = true;
                                                } else {
                                                    if (substr($cadena, $i, 1) == ' ' && $banderaP) {
                                                        $banderaE = true;
                                                    } else {
                                                        if (intval(substr($cadena, $i, 1)) >= 0 && intval(substr($cadena, $i, 1)) <= 9 && $banderaE) {
                                                            $cadTex .= '<br>';
                                                            $banderaE = false;
                                                            $banderaP = false;
                                                        } else {
                                                            $banderaE = false;
                                                            $banderaP = false;
                                                        }
                                                    }
                                                }
                                                $cadTex .= substr($cadena, $i, 1);
                                            }
                                            echo $cadTex;
                                            ?>
                                        </td>
                                    </tr>
                                @endforeach
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="ln_solid"></div>
                <div class="mb-1 row">
                    <div class="col-md-3 col-sm-12"></div>
                    <div class="col-md-6 col-sm-12">
                        <div class="row">
                            <div class="col">
                                <button class="btn btn-dark btn-block" type="button" onclick="listado_temario()"><i
                                        class="fa fa-times"></i>
                                    Cancelar</button>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-3 col-sm-12"></div>
                </div>
                </form>
                <br>
            </div>
        </div>
    </div>
</div>
</div>
