<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>Actualizar el 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">
                                    <option value="">--Seleccione--</option>
                                    @foreach ($mat as $m)
                                        @if ($m->cve_mat == $tem->materia->cve_mat)
                                            <option value="{{ $m->cve_mat }}" selected>{{ $m->nombre_mat }}</option>
                                        @else
                                            <option value="{{ $m->cve_mat }}">{{ $m->nombre_mat }}</option>
                                        @endif
                                    @endforeach
                                </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 }}">
                            </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 }}">
                            </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 }}">
                            </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">{{ $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">{{ $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">{{ $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">{{ $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">{{ $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">{{ $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">{{ $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">{{ $tem->fuentes_tem }}</textarea>
                            </div>
                            <div class="col-form-label col-md-2 col-sm-1 d-none d-sm-block">
                            </div>
                        </div>
                        <br>
                        <div class="x_title">
                            <h2>Unidades</h2>
                            <div class="clearfix"></div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-md-right">
                                <label class="text-sm-left" for="numero">No.
                                    de la unidad <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <input type="text" id="numero" name="numero" required="required"
                                    class="form-control form-control-sm">
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_numero" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-md-right">
                                <label class="text-sm-left" for="tema">Tema
                                    <span class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <input type="text" id="tema" name="tema" required="required"
                                    class="form-control form-control-sm" ">
                            </div>
                            <div class="                               col-md-4 col-sm-4 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_tema" style="display: none">
                                </div>
                            </div>
                        </div>
                        <div class="mb-1 row">
                            <div class="col-form-label col-md-4 col-sm-4 col-xs-12 text-left text-md-right">
                                <label class="text-sm-left" for="subtema">Subtema <span
                                        class="required">*</span>
                                </label>
                            </div>
                            <div class="col-md-4 col-sm-4 col-xs-12">
                                <textarea class="form-control form-control-sm" id="subtema" name="subtema" rows="7" style="resize: none"></textarea>
                            </div>
                            <div class="col-md-1 col-sm-2 col-xs-12 m-1">
                                <button type="button" class="btn btn-secondary" onClick="modificar_uni()"><i
                                        class="fa fa-plus"></i>
                                </button>
                            </div>
                            <div class="col-md-3 col-sm-2 col-xs-12">
                                <div class="alert alert-danger" role="alert" id="a_subtema" style="display: none">
                                </div>
                            </div>
                        </div>

                        <div id="contenedor_unidades">
                            <div class="form-group" id="temario">
                                <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>
                                            <td>
                                                <center>Acción</center>
                                            </td>
                                        </tr>
                                    </thead>
                                    <tbody id="contenedor_reng">

                                                                          @foreach ($uni
                                    as $u)
                                <tr class="row_unidades" id="rowunidad_{{ $u->unidad->no_uni }}">
                                    <?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);
                                    }
                                    ?>
                                    <input type="hidden" class="numero_id" id="numero_1"
                                        value=" {{ $u->unidad->no_uni }}">
                                    <input type="hidden" class="tema_id" id="tema_1"
                                        value=" {{ $u->unidad->tema_uni }}">
                                    <input type="hidden" class="subtema_id" id="subtema_1"
                                        value="{{ $cadTex }}">
                                    <td data-label="No. Unidad: " class="u">
                                        {{ $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>
                                    <td>
                                        <div class="text-center">
                                            <?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 .= '';
                                                            $banderaE = false;
                                                            $banderaP = false;
                                                        } else {
                                                            $banderaE = false;
                                                            $banderaP = false;
                                                        }
                                                    }
                                                }
                                                $cadTex .= substr($cadena, $i, 1);
                                            }
                                            ?>
                                            <!--modal para actualizar una unidad-->
                                            <button type="button" class="btn btn-success btn-sm"
                                                data-toggle="tooltip" data-placement="top" title=""
                                                data-original-title="Modificar" title="Actualizar Unidad"
                                                onclick="modalUnidad({{ $tem->cve_tem }},{{ $u->unidad->no_uni }},'{{ $u->unidad->tema_uni }}','{{ $cadTex }}','update_unaUnidad(this.form,{{ $u->unidad->cve_uni }},{{ $tem->cve_tem }});');"><i
                                                    class="fa fa-pencil"></i></button>
                                            <!--modal para actualizar una unidad-->
                                        </div>
                                    </td>
                                </tr>
                                @endforeach
                                </tbody>
                                </table>
                            </div>
                        </div>
                        <br>
                        <div id="act_apren">
                        </div>

                        <div id="contenedor_competencias">
                            <div class="" id="competencia">
                                <table id="tabla2" class="table table-striped jambo_table bulk_action">
                                    <thead>
                                        <tr>
                                            <td>
                                                <center>No. Unidad</center>
                                            </td>
                                            <td>
                                                <center>Actividades de Aprendizaje</center>
                                            </td>
                                            <td>
                                                <center>Competencia Especifica</center>
                                            </td>
                                            <td>
                                                <center>Competencia Genérica</center>
                                            </td>
                                            <td>
                                                <center>Acción</center>
                                            </td>
                                        </tr>
                                    </thead>
                                    <tbody id="contenedor_rengcom">
                                        @foreach ($act as $a)
                                            <tr class="row_competencias"
                                                id="row_{{ $a->ActividadAprendizaje->nou_actapre }}">
                                                <input type="hidden" class="unidad_id" id="unidad_1"
                                                    value="{{ $a->ActividadAprendizaje->nou_actapre }}">
                                                <input type="hidden" class="competenciaesp_id" id="competenciaesp_1"
                                                    value="{{ $a->ActividadAprendizaje->actapre_actapre }}">
                                                <input type="hidden" class="competenciage_id" id="competenciage_1"
                                                    value="{{ $a->ActividadAprendizaje->competenciasEsp_actapre }}">
                                                <input type="hidden" class="actapre_id" id="actapre_1"
                                                    value="{{ $a->ActividadAprendizaje->competenciasGen_actapre }}">
                                                <td data-label="No. Unidad: " class="u">
                                                    {{ $a->ActividadAprendizaje->nou_actapre }}</td>
                                                <td data-label="Actividades de Aprendizaje: " class="u">
                                                    <?php
                                                    $cadTexA = '';
                                                    $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) {
                                                                    $cadTexA .= '<br>';
                                                                    $banderaE = false;
                                                                    $banderaP = false;
                                                                } else {
                                                                    $banderaE = false;
                                                                    $banderaP = false;
                                                                }
                                                            }
                                                        }
                                                        $cadTexA .= substr($cadena, $i, 1);
                                                    }
                                                    echo $cadTexA;
                                                    ?></td>
                                                <td data-label="Competencia Especifica: " class="t">
                                                    {{ $a->ActividadAprendizaje->competenciasEsp_actapre }}
                                                </td>
                                                <td data-label="Competencia Genérica: " class="s">
                                                    <ol class="row_subtemas" id="subT_'rowunidad_1'">
                                                        <?php
                                                        $cadTexG = '';
                                                        $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) {
                                                                        $cadTexG .= '<br>';
                                                                        $banderaE = false;
                                                                        $banderaP = false;
                                                                    } else {
                                                                        $banderaE = false;
                                                                        $banderaP = false;
                                                                    }
                                                                }
                                                            }
                                                            $cadTexG .= substr($cadena, $i, 1);
                                                        }
                                                        echo $cadTexG;
                                                        ?>
                                                    </ol>
                                                </td>
                                                <td>
                                                    <div class="">
                                                        <!--modal para actualizar una Actividad-->
                                                        <button type="button" class="btn btn-success btn-sm"
                                                            data-toggle="tooltip" data-placement="top" title=""
                                                            data-original-title="Modificar"
                                                            title="Actualizar Actividad"
                                                            onclick="modalActividad({{ $a->ActividadAprendizaje->nou_actapre }},'{{ $a->ActividadAprendizaje->actapre_actapre }}','{{ $a->ActividadAprendizaje->competenciasEsp_actapre }}','{{ $a->ActividadAprendizaje->competenciasGen_actapre }}','update_unaActividad({{ $a->ActividadAprendizaje->cve_actapre }},{{ $tem->cve_tem }});');"><i
                                                                class="fa fa-pencil"></i></button>
                                                        <!--modal para actualizar una Actividad-->
                                                        <button type="button" class="btn btn-danger btn-sm"
                                                            data-toggle="tooltip" data-placement="top" title=""
                                                            data-original-title="Eliminar"
                                                            onclick="modalConfirm('¿Está seguro(a) qué deseas eliminar el registro <span > {{ $a->ActividadAprendizaje->nou_actapre }}</span>?','delete_actividad({{ $a->ActividadAprendizaje->cve_actapre }},{{ $tem->cve_tem }});');"><i
                                                                class="fa fa-trash"></i></button>
                                                    </div>
                                                </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 class="col">
                                        <button type="button"
                                            onclick="update_temario(this.form,{{ $tem->cve_tem }})"
                                            class="btn btn-success btn-block" form="form-nueva"> <i
                                                class=" fa fa-pencil"></i> Actualizar </button>
                                    </div>
                                </div>
                            </div>
                            <div class="col-md-3 col-sm-12"></div>
                        </div>
                    </form>
                    <br>
                </div>
            </div>
        </div>
    </div>
</div>
<script>
    $(document).ready(function() {
        $('[data-toggle="tooltip"]').tooltip();
    });
</script>
<script>
    $(document).ready(function() {
        $('[data-toggle="tooltip"]').click(function() {
            $('[data-toggle="tooltip"]').tooltip("hide");

        });
    });
</script>
