<?php
session_start();
include "./var.php";
$datostablausuarios = getusuarios();
$tablagastos = getgastos($_SESSION['id_estrategia']);
$tablalineadeneg = gelineadenegocio();
$movingresostab = getmovingresostab();
$tipodeproveedortable = gettipodeproveedortable();
$proveedoresoption = getoptionproveedor();
$gettipoproveeoption =getoptiontipoprov();
$relacionprov = getrelacionproveedor();

$adicionales=<<<sss
<script src="../js/scripttable.js"></script>
<script>
$('#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');
    }
} );

$('#example3').DataTable();
var table = $('#example3').DataTable();

$('#example3 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-sm-6">
          <div class="x_panel">
            <div class="x_title">
              <h2><strong>Tipo de Proveedor:</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 class="control-label col-md-4 col-sm-4 col-xs-12" for="first-name">Tipo de Proveedor:
                  </label>
                  <div class="col-md-8 col-sm-8 col-xs-8">
                    <input type="text" id="tipoprovv" name="tipoprovv" required="required" class="form-control col-md-7 col-xs-12">
                  </div>
                </div>
                <div class="form-group">
                  <label class="control-label col-md-4 col-sm-4 col-xs-12" for="first-name">Descripción:
                  </label>
                  <div class="col-md-8 col-sm-8 col-xs-8">
                    <input type="text" id="descripciontp" name="descripciontp" required="required" class="form-control col-md-7 col-xs-12">
                  </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="limpiaregresos" class="btn btn-primary" type="reset">Limpiar</button>
                    <button type="button" class="btn btn-success" onclick="agregartipoproveedor();">Guardar</button>
                  </div>
                </div>
              </form>
            </div>
            <br>
            <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;&nbsp;Tipo de Proveedor</th>
                    <th>Descrpción</th>
                    <th>Fecha</th>
                    <th>Eliminar</th>
                  </thead>
                  <tbody>
                  $tipodeproveedortable
                  </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-sm-6">
          <div class="x_panel">
            <div class="x_title">
              <h2><strong>Asignar Tipo de Proveedor:</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 class="control-label col-md-4 col-sm-4 col-xs-12" for="first-name">Seleccione Proveedor:
                  </label>
                  <div class="col-md-8 col-sm-8 col-xs-8">
                    <select class="form-control" id="idproveedor" required="required">
                      <option value="">Seleccione proveedor</option>
                      $proveedoresoption
                    </select>
                  </div>
                </div>
                <div class="form-group">
                  <label class="control-label col-md-4 col-sm-4 col-xs-12" for="first-name">Tipo de Proveedor:
                  </label>
                  <div class="col-md-8 col-sm-8 col-xs-8">
                    <select class="form-control" id="tipoprovee" required="required">
                      <option value="">Seleccione tipo de proveedor</option>
                      $gettipoproveeoption
                    </select>
                  </div>
                </div>
                <div class="form-group">
                  <label for="middle-name" class="control-label col-md-4 col-sm-4 col-xs-12">Especialista</label>
                  <div class="col-md-8 col-sm-8 col-xs-8">
                    <select class="form-control" required="required" id="especialista">
                      <option value="">Seleccione estado de usuario</option>
                      <option value="1">Si</option>
                      <option value="0">No</option>
                    </select>
                  </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="limpiatipoprovv" class="btn btn-primary" type="reset">Limpiar</button>
                    <button type="button" class="btn btn-success" onclick="asignartipoproveedor();">Guardar</button>
                  </div>
                </div>
              </form>
            </div>
            <br>
            <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>&nbsp;&nbsp;&nbsp;&nbsp;Proveedor</th>
                    <th>&nbsp;&nbsp;Tipo de proveedor</th>
                    <th>&nbsp;&nbsp;Especialista</th>
                    <th>Eliminar</th>
                  </thead>
                  <tbody>
                    $relacionprov
                    
                  </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>
llll;
echo $varend;
echo $adicionales;
echo $cerrarend;
?>