<?php
require_once 'ApiGlobalFunctions.php';

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

$validate=loginkey($usuario,$password,$url);
if($validate==1){
    mysqli_set_charset($link, "utf8");
    $query=mysqli_query($link, "SELECT paquetes_tks_centrodecosto FROM vtiger_paquetes_tks_centrodecosto WHERE presence='1'");
        $num=mysqli_num_rows($query);    
    $z=0;
    $docs=array();
        while ($row=mysqli_fetch_array($query)) {
            $courier=$row['paquetes_tks_centrodecosto'];
            $docs[$z]=array('courier'=>$courier);
            $z++;
            }
    echo json_encode(setDataJSON($docs, 1));
}
?>
