<?php
// include('php_gene1.php');
include('info_docu.php');
include('../_cfg/config.php');


//VARIABLES
$db = "vcrxol_".$_POST['empr'];
$user = $db."full";
//$pass = $_POST['pass'];
$server="192.185.41.206";
$pass="vicore1976";
$b=0;
$a=1;
$c=3;

//CONEXCION
$link = mysql_connect($server, $user, $pass, true) or die 
("Error al Conectar a la DB");
mysql_select_db($db, $link) or die ("Error al Selecciona la DB");
// echo "CONEXION OK: ".$db."<br><br>";

//SENTECIA SQL
$query = $_POST['mysql'];
$result = mysql_query($query, $link);
echo mysql_error($link);

$field = mysql_num_fields($result);
// echo "Numero de Columnas: ".$field."<br><br>";

?>


<!DOCTYPE html>
<html>
<head>
</head>
<body>
    
    <script>
    
    $(document).on("click", "#add", function(){
        
        $.ajax({
            url:"",
            method:"GET",
            data: (),
        })
    })
    
        $(document).on("blur", "", function(){
            var a =$(this).data("");
            var b=$(this).text();
            
            actualizar_datos(a, b );
        })
    </script>
<div class="ta">
<div class="tb">
    <table style="background-color:#FFFDFB; border:0px solid #34495e; width:100%; text-align:center;" class="tabla">
        <thead>
            <tr>
                <?php 
                for ( $i = 0; $i < $field; $i++ ) {
                $camp = mysql_field_name($result, $i); 
                ?>
                <th style="border-bottom:solid 0px #34495e; background:#34495e; color:white; padding:3px;">
                <?php
                echo $camp[0];
                echo $camp[1];
                echo $camp[7];
                echo $camp[8];
                echo $camp[9];
                echo $camp[10];
                ?>
                </th>
                <?php } ?>
            </tr>
        </thead>
        <tbody>
        <?php
        while($consulta = mysql_fetch_array($result)){
            if($b != 3){
                echo "<tr style='padding:2px;'>";
                for($f=0; $f < $field; $f++){ ?>
                    <td style="padding:2px;"> <?php echo $consulta[$f]; ?> </td>
         <?php } 
            }else{ ?>
                <tr style="padding:2px;">
                <?php
                for($f=0; $f < $field; $f++){ ?>
                    <td style="padding:2px; border-top:1px dotted #34495e;"> <?php echo $consulta[$f]; ?> </td>
                <?php }
                $b= $b-$c; ?>
                    
                    
      <?php } ?>
      </tr>
      <?php $b=$b+$a; ?>
      
      <?php } ?>
    </tbody></table>
</div>
</div>
</body>
</html>









