<?php 
  defined('BASEPATH') OR exit('No direct script access allowed');
  
  ?>
<div class="content-wrapper">
  <section class="content-header">
    <?php echo $pagetitle; ?>
    <?php echo $breadcrumb; ?>
  </section>
  <section class="content">
    <div class="row">
      <div class="col-md-12">
        <div class="box">
          <div class="box box-primary">
            <!-- Primer bloque -->
            <div class="box-body">
              <?php 
                if ($message) {
                	echo '<pre>';
                	echo '<h4><b>Mensaje:</b></h4>';
                	echo '<h5>' . $message . '</h5>';
                	echo '</pre>';
                } 
                ?>
              <?php echo form_open(current_url(), array('class' => 'form-horizontal', 'id_memo' => 'form-edit_memo')); ?>
              <div class="panel panel-default">
                <div class="panel-body">
                  <div class="col-sm-12">
                    <div class="text-center">
                      <h4>CARGA DE DATOS PARA MEMOS</h4>
                    </div>
                    <table class="tablaCentrada" border="1px solid rgb(0, 0, 0)" style="width: 100%;">
                      <tbody>
                        <tr>
                          <td><label for="id_memo">ID MEMO</label></td>
                          <td><?php echo form_input($id_memo) ?></td>
                        </tr>
                         <tr>
                          <td>N° MEMO</td>
                          <td><?php echo form_input($nro_memo) ?></td>
                        </tr>
                        <tr>
                          <td>AÑO</td>
                          <td><?php echo form_input($anho_memo) ?></td>
                        </tr>
                        <!--<tr>
                          <td>EMISOR</td>
                          <td><?php //echo form_input($id_emisor) ?></td>
                        </tr>-->
                        <tr>
                          <td>EMISOR</td>
                          <td>
                              <?php $attribute = 'class="form-control selectpicker" title="Profesional" id="id_prof_emisor" name="id_prof_emisor" '; echo form_dropdown('id_prof_emisor', $prof_emisor, $prof_emisor_sel, $attribute); ?>
                              <?php $attribute = 'class="form-control selectpicker" title="Emisor" id="id_emisor" name="id_emisor" '; echo form_dropdown('id_emisor', $emisor, $emisor_sel, $attribute); ?>                              
                            </td>
                        </tr>
                        <!--<tr>
                          <td>RECEPTOR</td>
                          <td><?php //echo form_input($id_receptor); ?></td>
                        </tr>-->
                        <tr>
                          <td>RECEPTOR</td>
                          <td>
                            <?php $attribute = 'class="form-control selectpicker" title="Profesional" id="id_prof_receptor" name="id_prof_receptor" '; echo form_dropdown('id_prof_receptor', $prof_receptor, $prof_receptor_sel, $attribute); ?>
                            <?php $attribute = 'class="form-control selectpicker" title="Receptor" ="id_receptor" name="id_receptor" '; echo form_dropdown('id_receptor', $receptor, $receptor_sel, $attribute); ?>                              
                          </td>
                        </tr>
                        <tr>
                          <td>REFERENCIA</td>
                          <td><?php echo form_input($referencia); ?></td>
                        </tr>
                        <tr>
                          <td>DESCRIPCIÓN</td>
                          <td><?php echo form_input($descripcion) ?></td>
                        </tr>
                        <tr>
                          <td>FECHA</td>
                          <td>
                            <div class="input-group date" data-provide="datepicker" data-date-format="dd/mm/yyyy">
                              <?php echo form_input($fecha);?>
                              <div class="input-group-addon">
                                <i class="fa fa-calendar"></i>
                              </div>
                            </div>
                          </td>
                        </tr>
                        <tr>
                          <td>USUARIO</td>
                          <td><?php echo form_input($id_usuario) ?></td>
                        </tr>
                       
                      </tbody>
                    </table>

                    <br>
                    <?php //echo anchor('proyectos/mantenimiento/proyecto_mantenimiento/'.$id_proyecto['value'], '<i class="btn btn-primary">MANTENIMIENTO</i>'); ?>
                   
                  </div>
                </div>
              </div>
              <div class="panel panel-default">
                <div class="panel-body">
                  <!-- Sección botones -->
                  <div class="col-sm-offset-0 col-sm-12" align="center">
                    <?php echo form_button(array('name' => 'accion','type' => 'submit','value' => '1','class'
                      => 'btn btn-primary', 'content' =>  'GUARDAR')); ?>
                    <?php echo '&nbsp;';?>
                    <?php //echo '&nbsp;';?>
                    <?php //echo anchor('memos/memos/', 'VOLVER', array('class' => 'btn btn-primary', 'content' => 'REGRESAR')); ?>
                  </div>
                </div>
              </div>
              <?php echo form_close();?>
            </div>
            <!-- Fin primer bloque -->
                                <!-- CREAR FORMULARIO - DETALLES -->
 

             <?php echo form_open_multipart('memos/memos/actualizar_detalle', array('class' => 'form-horizontal', 'id' => 'form-actualizar_detalle')); ?>

              <?php echo form_input($id_memo);?>

              
              <!-- MEMOS DETALLES -->
     
              <div class="col-md-12">
                <div class="box">
                    <div class="box-header with-border">
                        <h3 class="box-title"> Detalles</h3>
                    </div>
                    <!-- Primer bloque -->
                    <div class="box-body">
                        <div class="col-sm-12">
                            <div class="form-group">
                                <label class="control-label col-sm-2" for="id_detalle"><?php echo lang('m_del_id'); ?></label>
                                <div class="col-sm-4"><?php echo form_input($id_detalle); ?></div>
                                <label class="control-label col-sm-2" for="item"><?php echo lang('m_del_item'); ?></label>
                                <div class="col-sm-4"><?php echo form_input($item); ?></div>
                               
                            </div>
                            <div class="form-group">
                               <!-- <label class="control-label col-sm-2" for="id_exp"><?php //echo lang('m_del_id_exp'); ?></label>
                                <div class="col-sm-4"><?php //echo form_input($id_exp); ?></div>
                              -->
                                <label class="control-label col-sm-2" for="notificacion"><?php echo lang('m_del_notificacion'); ?></label>
                                <div class="col-sm-4"><?php echo form_input($notificacion); ?></div>
                            </div>
                            <div class="form-group">
                                

                                <div class="col-sm-2">
                                  <label for="codigo_unico_ref">Codigo Unico. Ref.</label>
                                  <div>
                                    <?php echo form_input($codigo_unico_ref);?>
                                  </div>
                                </div> 
                                <div class="col-sm-2" >
                                  <label for="id_exp">Expe.Referencia</label>
                                  <?php  
                                  $attribute = 'class="form-control selectpicker" data-live-search="true" title="Referencia" id="id_exp" name="id_exp"'; 
                                  echo form_dropdown('id_exp', $expe, $expe_sel, $attribute); ?>
                                </div>  
                               <div class="col-sm-2" id="codigo_id_exp" name="codigo_id_exp"> 
                                  <label for="codigo_id_exp" id="codigo_id_exp">
                                    <?php echo lang('m_del_id_exp'); ?> </label>
                                    <?php //echo form_input($codigo_unico); ?>
                                    <?php echo form_input($id_exp); ?>
                                </div>
                                                                
                            </div>                             
                           
                            <!-- Sección botones -->
                            <div class="form-group">
                              <div class="col-sm-12" align="center">
                                  <?php
                                    echo form_button(array('name' => 'accion', 'type' => 'submit', 'class' => 'btn btn-success btn-flat', 'content' => ' Guardar Datos', 'id_detalle' => 'boton','value' => '1'));
                                  ?>
                                
                                  <?php echo '&nbsp;';?>
                              
                              </div>
                            </div>
                        </div>
                    </div>
                </div>
              </div>
   

             <?php echo form_close();?>
             <!--  Cierre de Formulario -->




             <?php //echo form_input($id_memo);?>

              <div class="form-group">

                <div style="overflow-y: visible;">
                    <table id="tabla_m_detalles" class="table table-striped table-hover">
                        <thead>
                            <tr>
                                <th><?php echo lang('m_del_id');?></th>
                                <th><?php echo lang('m_del_id_exp');?></th>
                                <th><?php echo lang('m_del_notificacion');?></th>
                                <th><?php echo lang('m_del_item');?></th>
                                <th><?php echo lang('m_del_codigo_unico');?></th>
                                <th><?php echo 'acciones';?></th>
                           </tr>
                       </thead>
                        <tbody class="muestra_m_detalles">
                            <?php
                            $i = 0;
                            if (isset($m_detalle)) : ?>
                            <?php foreach ($m_detalle as $detalle) : $i = $i + 1;?>
                            <tr>
                                <td><?php echo htmlspecialchars($detalle['id_detalle'], ENT_QUOTES, 'UTF-8'); ?></td>
                                <td><?php echo htmlspecialchars($detalle['id_exp'], ENT_QUOTES, 'UTF-8'); ?></td>
                                <td><?php echo htmlspecialchars($detalle['notificacion'], ENT_QUOTES, 'UTF-8'); ?></td>
                                <td><?php echo htmlspecialchars($detalle['item'], ENT_QUOTES, 'UTF-8'); ?></td>
                                <td><?php echo htmlspecialchars($detalle['codigo_unico'], ENT_QUOTES, 'UTF-8'); ?></td>
                                <td>

                                    <a href="#" onclick= "obj_edit_detalle(<?php echo $detalle['id_detalle']?>,
                                    <?php echo $detalle['id_exp']  ?>,
                                    <?php //echo $detalle['codigo_unico_ref']  ?>
                                    <?php echo $detalle['item'] ?>)">  
                                     <i class="fa fa-edit btn btn-xs bg-orange color-palette"></i>  
                                    </a>


                                
                                    <?php echo '&nbsp;';?>
                                    <?php
                                          //if ($habilitado_gen or $habilitado_sis) {
                                          //$values->id_memo
                                         echo anchor('memos/Memos/eliminar_detalle/'.$detalle['id_memo'].'/'.$detalle['id_detalle'], '<i class="btn btn-xs bg-red color-palette">Eliminar</i>');
                                        // }
                                    ?>
                                </td>
                                <td></td>
                            </tr>
                            <?php endforeach;?>
                            <?php else : ?>
                            <tr>
                                <td align="center" colspan="12"><b>No hay resultados</b></td>
                            </tr>
                            <?php endif ?>
                        </tbody>
                    </table>
                 </div>
             </div>              
              <!-- FIN - MEMOS DETALLES -->
                <div class="col-sm-offset-0 col-sm-12" align="center">
                    <?php echo anchor('memos/memos/index', 'VOLVER', array('class' => 'btn btn-primary', 'content' => 'REGRESAR')); ?>
                  <!--/div-->
                </div>

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