<?php
/*   __________________________________________________
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.17  |
    |              on 2026-04-17 06:44:03              |
    |    GitHub: https://github.com/pk-fr/yakpro-po    |
    |__________________________________________________|
*/
 goto gAbKz; EWTYx: require_once RUTA_APP . 'Conexion.php'; goto WJlq5; gAbKz: require_once 'Categoria.php'; goto EWTYx; WJlq5: class CategoriaDatos { public static function getCategoriaById(int $id) : ?Categoria { goto gzYqm; gzYqm: $retorno = null; goto Zvrw5; S_dwF: if (!($row = sv_mysqli_fetch_array($result))) { goto bjpsK; } goto S6fZS; Zvrw5: $con = getConnection(); goto lBKhH; gX2u6: sv_mysqli_close($con); goto jwplx; S6fZS: $retorno = new Categoria($row["id"], CRMDatos::getCRMById($row["CRM"]), $row["Nombre"], $row["Posicion"], $row["Contraido"], $row["Visible"]); goto tcoLj; lBKhH: $query = "SELECT id, CRM, Nombre, Posicion, Visible,Contraido FROM dialvox_crm_categoria WHERE id = '" . limpia($id) . "'"; goto O2z29; jwplx: return $retorno; goto oKf90; O2z29: $result = sv_mysqli_query($con, $query); goto S_dwF; tcoLj: bjpsK: goto gX2u6; oKf90: } public static function addCategoria(Categoria $categoria) : int { goto R0OkF; ZHboJ: $con = getConnection(); goto OnWxW; j9bfz: Y0GC3: goto sjl3N; KTm0F: if (!($result = sv_mysqli_query($con, $query))) { goto Y0GC3; } goto u5Xbg; OnWxW: $query = "INSERT INTO dialvox_crm_categoria(CRM, Nombre, Posicion, Visible, Contraido) VALUES ('" . limpia($categoria->getCRM()->getId()) . "','" . limpia($categoria->getNombre()) . "','" . limpia($categoria->getPosicion()) . "','" . limpia($categoria->getVisible()) . "','" . limpia($categoria->getContraido()) . "')"; goto KTm0F; JAVoL: return $retorno; goto twhMB; R0OkF: $retorno = 0; goto ZHboJ; u5Xbg: $retorno = mysqli_insert_id($con); goto j9bfz; sjl3N: sv_mysqli_close($con); goto JAVoL; twhMB: } public static function updateCategoria(Categoria $categoria) : int { goto NvmK1; nGkX6: $query = "UPDATE dialvox_crm_categoria SET Contraido = '" . limpia($categoria->getContraido()) . "',CRM='" . limpia($categoria->getCRM()->getId()) . "',Nombre='" . limpia($categoria->getNombre()) . "',Posicion='" . limpia($categoria->getPosicion()) . "',Visible='" . limpia($categoria->getVisible()) . "' WHERE id = '" . limpia($categoria->getId()) . "'"; goto gamx7; u49Ed: $retorno = 1; goto l8IzX; aPJ1U: sv_mysqli_close($con); goto q9fNh; NvmK1: $retorno = 0; goto jn2vV; q9fNh: return $retorno; goto dg2Pz; l8IzX: Z64pp: goto aPJ1U; gamx7: if (!($result = sv_mysqli_query($con, $query))) { goto Z64pp; } goto u49Ed; jn2vV: $con = getConnection(); goto nGkX6; dg2Pz: } public static function deleteCategoria(Categoria $categoria) : int { goto xKYgT; vLZKy: $retorno = 1; goto kmYoa; JA7bC: sv_mysqli_close($con); goto PbGN6; XWaos: if (!($result = sv_mysqli_query($con, $query))) { goto jRdqW; } goto vLZKy; kmYoa: jRdqW: goto JA7bC; xKYgT: $retorno = 0; goto mMosJ; mQUpL: $query = "UPDATE dialvox_crm_categoria SET Visible = FALSE WHERE id = '" . limpia($categoria->getId()) . "'"; goto XWaos; mMosJ: $con = getConnection(); goto mQUpL; PbGN6: return $retorno; goto nggyL; nggyL: } public static function getCategoriasByCRM(CRM $crm) : array { goto uw8GW; WHsGv: sv_mysqli_close($con); goto wiUtV; VmDt8: l7E5Y: goto WHsGv; Zid_f: $con = getConnection(); goto BdpPg; TuSaw: if (!($row = sv_mysqli_fetch_array($result))) { goto CeXBO; } goto ohOSb; ohOSb: $retorno[] = self::getCategoriaById($row["id"]); goto d26Qf; uw8GW: $retorno = array(); goto Zid_f; BdpPg: $query = "SELECT id FROM dialvox_crm_categoria WHERE CRM = '" . limpia($crm->getId()) . "' AND Visible = TRUE ORDER BY Posicion"; goto SAgJk; wiUtV: return $retorno; goto n1tDE; SYMfQ: NDAWS: goto TuSaw; d26Qf: goto NDAWS; goto HX6cJ; HX6cJ: CeXBO: goto VmDt8; SAgJk: if (!($result = sv_mysqli_query($con, $query))) { goto l7E5Y; } goto SYMfQ; n1tDE: } public static function listCategoriasByCRM(CRM $crm) : array { goto vhKfH; R0_nR: sv_mysqli_close($con); goto OousW; WXpXV: goto YriVD; goto RYr3P; BVecZ: YriVD: goto k6sBH; eFjtw: $query = "SELECT id,Nombre FROM dialvox_crm_categoria WHERE CRM = '" . limpia($crm->getId()) . "' AND Visible = TRUE"; goto yNAaV; yNAaV: if (!($result = sv_mysqli_query($con, $query))) { goto ZblpI; } goto BVecZ; vhKfH: $retorno = array(); goto zTf5o; GswfX: ZblpI: goto R0_nR; RYr3P: Ko3pv: goto GswfX; k6sBH: if (!($row = sv_mysqli_fetch_array($result))) { goto Ko3pv; } goto A1Gf6; zTf5o: $con = getConnection(); goto eFjtw; A1Gf6: $retorno[] = new Categoria($row["id"], $crm, $row["Nombre"], -1, false, true); goto WXpXV; OousW: return $retorno; goto wkcKh; wkcKh: } public static function countCategoriasByCRM(CRM $crm) : int { $retorno = 0; return $retorno; } }