<?php
include 'conn.php';
error_reporting(E_ERROR | E_PARSE);
session_start();

$_SESSION['database'] = $_GET['database'];
$_SESSION['suc'] = $_GET['suc'];

$cDbName = $_SESSION['database'];
$cCodSuc = $_SESSION['suc'];

$cSql_Dep = "SELECT dep_id, UPPER(TRIM(dep_descripcion)) AS dep_descripcion FROM $cDbName.depositos WHERE (suc_id=$cCodSuc) AND (IFNULL(dep_activo,0)=1) AND (IFNULL(para_la_venta,0)=1) ORDER BY 2";
$oData = mysqli_query($connection, $cSql_Dep);

$jsonData = array();
$jsonTempData = array();

while($row = mysqli_fetch_assoc($oData)){
  $jsonTempData['e_id']= $row['e_id'];
  $jsonTempData['e_descripcion']= utf8_encode($row['e_descripcion']);

  $jsonData[] = $jsonTempData;
}

header('Content-type: application/json');
print_r(json_encode($jsonData));

$row=NULL;
$jsonData=NULL;
$jsonTempData1=NULL;

mysqli_free_result($oData);
mysqli_close($connection);

/*
ULTIMA MODICICASION 2022-09-01 JOHNN GUTIERREZ
*/
?>