<?php
include "./var.php";
$id_usuario = $_SESSION['id_estrategia'];
$clientesoptions = getclientesoption();

$checksetapas = getchecketapas();
$producto = getoptionproduct();
$tablepresupuestos = getpresupuestos();
$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" id="paso1" >
    
    
    
        <div class="x_panel">
            <div class="x_title">
                    <h2><strong>Cotización:</strong> <small></small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </ul>
                    
                    <div class="clearfix">
                    </div>
                        
                        
                      <div class="" role="tabpanel" data-example-id="togglable-tabs">
                      <ul id="myTabp" class="nav nav-tabs bar_tabs" role="tablist">
                        <li role="presentation" class="active"><a href="#tab_contentp1" id="home-tabp" role="tab" data-toggle="tab" aria-expanded="true"><strong>Alta</strong></a>
                        </li>
                        <li role="presentation" class=""><a href="#tab_contentp2" role="tab" id="profile-tabp" data-toggle="tab" aria-expanded="false"><strong>Edicion</strong></a>
                        </li>
                      </ul>
  <div id="myTabContent2p" class="tab-content">
   
        <div role="tabpanel" class="tab-pane fade active in" id="tab_contentp1" aria-labelledby="home-tab">
               <div class="x_content" >
                            <div class="x_content" id="cotizacion">
                                <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-right">

                                    <div class="form-group">
                                        
                                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Folio:</label>
                                        <div class="col-md-2 col-sm-2 col-xs-12">
                                            <input id="ndegasto" class="form-control col-md-7 col-xs-12" type="text" name="ndegasto" required="required" disabled>
                                        </div>
                                    </div>


                            
                                    <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"  onchange="actualizaproyecto()">
                                                    <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">
                                            <select class="form-control" id="nombredeproyectos" required="required">
                                                <option value="">Seleccione opcion</option>
                                            </select>
                                        </div>
                                    </div>



                                    <div class="form-group">                        


                                        <label class="control-label col-md-3 col-sm-3 col-xs-12">Seleccione Etapas:<br><br></label>
                                    </div>
                                            
                                            


                                    <div class="form-group">
                                        <div class="table-responsive" style="height: 400px; overflow: auto">
                                            <table class="table table-striped jambo_table bulk_action" id="tablaEtapas" cellspacing="0">
                                                <thead>
                                                    <th>Etapa</th>
                                                    <th>Fecha Inicial</th>
                                                    <th>Fecha Final</th>
                                                    <th>Duración (Semanas)</th>
                                                    <th>Total Cotizado</th>
                                                </thead>
                                                <tbody>
                                                    $checksetapas
                                                </tbody>
                                            </table>
                                        </div>
                                    </div>        
                                            
                                    <div class="form-group ln_solid"><br>





                                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-4">
                                            <button id="limpiargastos" class="btn btn-primary" type="reset">Limpiar</button>
                                            <button id="aplicar" type="button" class="btn btn-success" onclick="agregarcotizacion();">Aplicar</button>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>

        </div>
                        
        <div role="tabpanel" class="tab-pane fade" id="tab_contentp2" aria-labelledby="profile-tab">
            <div class="x_content" >
                <div class="x_content" id="cotizacion">
                    <form id="demo-form2" data-parsley-validate class="form-horizontal form-label-right">
                                                                       
                                    <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="idclienteed" required="required"  onchange="actualizaproyecto2()">
                                                    <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">
                                            <select class="form-control" id="nombredeproyectos2" required="required" onchange="actualizacotizacion()">
                                                <option value="">Seleccione opcion</option>
                                            </select>
                                        </div>
                                    </div>
                                    
                                    <div class="form-group">
                                        <label for="middle-name" class="control-label col-md-3 col-sm-3 col-xs-12">Folio:</label>
                                        <div class="col-md-2 col-sm-2 col-xs-12">
                                            <select class="form-control" id="folio" required="required">
                                                <option value="">Seleccione opcion</option>
                                            </select>
                                        </div>
                                    </div>                                            
                                
                                    <div class="form-group ln_solid"><br>
                                        <div class="col-md-6 col-sm-6 col-xs-12 col-md-offset-4">
                                            <button id="limpiaredicion" class="btn btn-primary" type="reset">Limpiar</button>
                                            <button id="buscar" type="button" class="btn btn-success" onclick="cargacotizacion();">Buscar</button>
                                        </div>
                                    </div><br><br><br>       
                       <div class="col-md-12 col-sm-12 col-xs-12">         
                    <div class="table-responsive">
                        <table class="table table-striped jambo_table bulk_action" id="edniv1" class="table table-striped table-bordered dt-responsive nowrap"cellspacing="0">
            
                        <thead>
                        <th>Etapa</th>
                        <th>Fecha inicial</th>
                        <th>Fecha final</th>
                        <th>Duracion(semanas)</th>
                        <th>Total Cotizado</th>
                        </thead>
                        <tbody>
                        
                        </tbody>
                        </table>
                    </div>
                             </div> <br><br><br>       
                                            
                        <div class="form-group">
                                
                                    <div class="col-md-2 col-sm-2 col-xs-2">
                                            <label for="middle-name" >Estatus:
                                        <select  id="status" required="required"  onchange="estatuscotiza()">
                                            <option value="0">Pendiente</option>
                                            <option value="1">Aprobada</option>
                                        </select></label>
                                    </div>
                                   
                                    <div class="col-md-2 col-sm-2 col-xs-2">
                                        <label for="middle-name" >Impuesto:
                                        <select  id="impuesto" required="required">
                                            <option value="0">No</option>
                                            <option value="1">Si</option>
                                        </select></label>
                                    </div>
                                    
                                        <div class="col-md-2 col-sm-2 col-xs-2">
                                            <label for="middle-name" >Fecha:<input id="fechacotiza" type="text" name="ndegasto" required="required" disabled></label>
                                        </div>
                                        
                                        <div class="col-md-2 col-sm-2 col-xs-2">
                                                <label for="middle-name">CC:
                                            <input id="cc" type="text" name="ndegasto" required="required" disabled></label>
                                        </div>
                                            
                                        <div class="col-md-2 col-sm-2 col-xs-2">                                    
                                            <button id="llenarnv3" type="button" class="btn btn-success" onclick="llenaniv3ed();">Detalle</button>
                                        </div>
                            </div>              
                                            
                    </form>
                </div>
            </div>
        </div>
        
    
  </div>
  	
</div>  
                        
                        
                  
            </div>
        </div>

                        
                        
                       
    
    
    
    
   
                                             


                <div class="col-md-12 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_title">
                            <h2><strong>Cotización:</strong> <small>Nivel 2</small></h2>
                            <ul class="nav navbar-right panel_toolbox">
                                <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                            </ul>
                    
                            <div class="clearfix"></div>
                        </div>
                        
                        <div class="x_content" id="cotizanv2">
                            <div class="form-group">
                                <div class="table-responsive" style="height: 300px; weight:20px overflow: auto">
                                    <table class="table table-striped jambo_table bulk_action" id="tablaNivel2" cellspacing="0">
                                        <thead>
                                            <th></th>
                                
                                            <th>Costo Total</th>
                                            <th>Markup</th>
                                            <th>Total Cotizado</th>
                                        </thead>
                                        
                                        <tbody>
                                            <tr><th>Colaboradores</th></tr>
                                            <tr><th>Proveedores</th></tr>
                                            <tr><th>Otros Directos</th></tr>
                                            <tr><th>Indirectos</th></tr>
                                        </tbody>
                                    </table>
                                </div>
                            </div>  
                        </div>
                    </div>
                </div>   
				
              <div class="col-md-12 col-sm-12 col-xs-12">
                <div class="x_panel">
                  <div class="x_title">
                    <h2><i class="fa fa-bars"></i>Cotizacion <small>Nivel 3 (captura)</small></h2>
                    <ul class="nav navbar-right panel_toolbox">
                      <li><a class="collapse-link"><i class="fa fa-chevron-up"></i></a>
                    </ul>
                    <div class="clearfix"></div>
                  </div>
                  <div class="x_content" >
                    <div class="x_content" id="cotizaetapas">
                    </div>
                    <br><br>
                  </div>
                </div>
              </div>

             

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