<?php
include "./var.php";
$id_usuario = $_SESSION['id_estrategia'];
$clientesoptions = getclientesoption();
$lineasdenegocio = getoptionlienaneg();
$tipologias = getoptiotipologia();
$checksetapas = getchecketapas();
$producto = getoptionproduct();
$tableproyectos = getproyectos();

$adicionales=<<<sss

<script type="text/javascript">
var idusuario = $id_usuario;

$('#example2').DataTable({
    "lengthMenu": [[5, 10, 15, 20, -1], [5, 10, 15, 20, "All"]]
});
var table = $('#example2').DataTable();

$('#example2 tbody').on( 'click', 'tr', function () {
    
} );
</script>

<script src="../js/scripttable.js"></script>
sss;
echo $varfirst;
echo $var=<<<llll
<script src="js/momment.js"></script>
<div class="right_col" role="main">
                
                <div class="col-md-12 col-xs-12">
                  <div class="x_panel">
                    <div class="x_title">
                      <h2><strong>Agregar y editar proyecto:</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">
                                <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Cliente:</label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                  <select class="form-control" id="idcliente" required="required">
                                    <option value="">Seleccione opcion</option>
                                    $clientesoptions
                                  </select>
                                </div>
                              </div>

                              <div class="form-group">
                                <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Nombre Proyecto :</label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                  <input id="nombreproyectos" class="form-control col-md-7 col-xs-12" type="text" name="ndegasto" required="required">
                                </div>
                              </div>
                                
                              
                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Seleccione linea de negocio:</label>

                                        <div class="col-md-6 col-sm-6 col-xs-12">
                                            <select class="form-control" id="idlnegocio" required="required" onchange="actualizatipologia()">
                                                <option value="">Seleccione opcion</option>
                                                $lineasdenegocio
                                            </select>
                                        </div>
                                    </div>





                                    <div class="form-group">
                                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="last-name">Tipologia:</label>

                                            <div class="col-md-6 col-sm-6 col-xs-12">
                                                <select class="form-control" id="idtipologia" required="required"><!-- idtipologia-->
                                                    <option value="">Seleccione opcion</option>                            
                                                </select>
                                            </div>
                                    </div>
                                    <br>      
                                    
                              <div class="form-group">
                                <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12" data-toggle="tooltip" data-placement="rigth" title="Es el número de metros cuadrados del proyecto">M2 :</label>
                                <div class="col-md-6 col-sm-6 col-xs-12">
                                  <input id="m2proyecto" class="form-control col-md-7 col-xs-12" type="number" step="0.1" name="ndegasto" required="required">
                                </div>
                              </div>

                              <div class="ln_solid"></div>
                              <br>
                              <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="agregarproyecto();">Crear</button>
                                </div>
                              </div>
                      </form>
                    </div>
                  </div>
              </div>
                                    
                                    <div class="row">
    <div class="col-md-12 col-sm-12 col-xs-12"><!--aqui-->
      <div class="x_panel">
        <div class="x_title">
          <h2><strong>Proyectos:</strong><small>Consultar</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">
          <div class="table-responsive">
            <table class="table table-striped jambo_table bulk_action" id="example" class="table table-striped table-bordered dt-responsive nowrap"cellspacing="0">
              <thead>
                <th>&nbsp;&nbsp;&nbsp;&nbsp;Cliente</th>
                <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Proyecto</th>
                <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;M2</th>
                <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Linea de Negocio</th>
                <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tipologia</th>
                <th>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fecha</th>
              </thead>
              <tbody>
                $tableproyectos
              </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>
</div>
llll;
echo $varend;
echo $adicionales;
echo $cerrarend;
?>