<?php
session_start();
$id_session=$_SESSION['id_estrategia'];
include "./var.php";
$fechahoy = date("Y-m-d");
$resulttabla = getcentrosdecostos();
$clientesoption = getclientesoption();
$lnegociooption = getlnegociooption();
$proyectosnombres = getproyectosoption();
$formadedeingreso = getformaingreso();
$movingresosoption = getmovingresosoption();
$selectcuentasoption = getcuentas();
$proveedoresoption = getoptionproveedor();
$egresosdatos = getegresosdatos();


$traspasos = gettraspasos();

$adicionales=<<<sss
<script src="../js/scripttable.js"></script>
<script>
var id_session = "$id_session";
$('#example2').DataTable();
var table = $('#example2').DataTable();

$('#example2 tbody').on( 'click', 'tr', function () {
    if ( $(this).hasClass('selected') ) {
        $(this).removeClass('selected');
    }
    else {
        table.$('tr.selected').removeClass('selected');
        $(this).addClass('selected');
    }
} );

</script>
sss;
echo $varfirst;

echo $var=<<<llll
<div class="right_col" role="main">
    <div class="col-md-12 col-sm-12 col-xs-12"><!--aqui-->
      <div class="x_panel">
        <div class="x_title">
          <h2><strong>Traspasos:</strong><small>Consultar y modificar</small></h2>
          <ul class="nav navbar-right panel_toolbox">
            <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
            </li><a onclick="descargarExcelidtable(2);" title="Exportar a Excel" align="right"> <img src="./images/excel.png" title="Exportar" align="middle" height="22" width="22">Exportar a Excel</a>
            <!--<li class="dropdown">
              <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><i class="fa fa-wrench"></i></a>
              <ul class="dropdown-menu" role="menu">
                <li><a href="#">Settings 1</a>
                </li>
                <li><a href="#">Settings 2</a>
                </li>
              </ul>
            </li>
            <li><a class="close-link"><i class="fa fa-close"></i></a>
            </li>-->
          </ul>
          <div class="clearfix"></div>
        </div>
        <div class="x_content">
          <div class="table-responsive">
            <table class="table table-striped jambo_table bulk_action" id="example2" class="table table-striped table-bordered dt-responsive nowrap"cellspacing="0">
              <thead>
                
                <th>Fecha de registro</th>
                <th>Fecha de Movimiento</th>
                <th>Cuenta de egreso</th>
                <th>Monto</th>
                <!--<th>Total traspaso</th>-->
                <th>Cuenta de Ingreso</th>
                <th>Eliminar</th>
              </thead>
              <tbody>
                $traspasos
              </tbody>
            </table>
          </div>
        <!--<button class="btn btn-danger" type="button" id="button">Borrar</button>
        <small>(Para eliminar un registro debe seleccionarlo y después debe oprimir Borrar).</small>-->
      </div>
    </div>
   </div>
    <div class="col-md-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2><strong>Agregar traspasos:</strong> <small></small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                      </li>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content">
                    <br />
                    <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-left">
                      
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="fechahoy" class="form-control col-md-7 col-xs-12" type="hidden" name="fechahoy" required="required" value="$fechahoy">
                        </div>
                      </div>

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">
                        Cuenta de egreso:
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select class="form-control" id="cuentaegreso" required="required">
                            <option value="">Seleccione cuenta</option>
                            $selectcuentasoption
                          </select>
                        </div>
                      </div>

                      <div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">
                        Monto:
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="montotras" class="form-control col-md-7 col-xs-12" type="text" onkeypress="return NumCheck(event, this)" name="montotras" required="required" placeholder="$">
                        </div>
                      </div>

                      <!--<div class="form-group">
                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">
                        Tipo de cambio:
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="tipocuentatrasp" class="form-control col-md-7 col-xs-12" type="text" onkeypress="return NumCheck(event, this)" name="tipocuentatrasp" required="required" placeholder="$">
                        </div>
                      </div>-->

                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">
                        Cuenta de Ingreso:
                        
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <select class="form-control" id="cuentaingresatras" required="required">
                            <option value="">Seleccione cuenta</option>
                            $selectcuentasoption
                          </select>
                        </div>
                      </div>
                      <div class="form-group">
                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">
                        Fecha de traspaso:
                        
                        </label>
                        <div class="col-md-6 col-sm-6 col-xs-12">
                          <input id="fechamov" class="form-control col-md-7 col-xs-12" type="date" onkeypress="return NumCheck(event, this)"  required >
                        </div>
                      </div>

                     <div class="ln_solid"></div>
                      <div class="form-group">
                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-3">
                          <button id="limpiargastos" class="btn btn-primary" type="reset">Limpiar</button>
                          <button type="button" class="btn btn-success" onclick="agregartraspasos();">Agregar</button>
                        </div>
                      </div>

                    </form>
                  </div>
                </div>
            </div>
</div>
llll;
echo $varend;
echo $adicionales;
echo $cerrarend;
?>