<?php
require_once 'ApiGlobalFunctions.php';

$usuario=$_POST['uid'];
$password=$_POST['key'];
$url=$_POST['url'];
$bodega=$_POST['wID'];
$include=includec($url);
include $include;

$validate=loginkey($usuario,$password,$url);
if($validate==1){
  mysqli_set_charset($link, "utf8");

   $query=mysqli_query($link, "SELECT * FROM vtiger_secciones WHERE secciones_tks_bodega='$bodega' ");
   $num=mysqli_num_rows($query);    
  $z=0;                  
    while ($row = mysqli_fetch_array($query)) {           
        $seccion=$row['secciones_tks_seccion'];
        $docs[$z]=array('wSecciones'=>$seccion);
        $z++;            
        }
        echo json_encode(setDataJSON($docs,1));
}
