<?php
/*   __________________________________________________
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.17  |
    |              on 2026-01-30 06:01:16              |
    |    GitHub: https://github.com/pk-fr/yakpro-po    |
    |__________________________________________________|
*/
 goto TSs8Z; MNDqF: require_once RUTA_APP . 'Conexion.php'; goto raf9i; TSs8Z: require_once 'Categoria.php'; goto MNDqF; raf9i: class CategoriaDatos { public static function getCategoriaById(int $id) : ?Categoria { goto GRwkK; GRwkK: $retorno = null; goto xY3N5; Mpro6: if (!($row = sv_mysqli_fetch_array($result))) { goto NSJ5T; } goto Pp5ZF; bp8jT: return $retorno; goto xgxwe; J1A8k: $result = sv_mysqli_query($con, $query); goto Mpro6; sN2_c: $query = "SELECT id, CRM, Nombre, Posicion, Visible,Contraido FROM dialvox_crm_categoria WHERE id = '" . limpia($id) . "'"; goto J1A8k; Pp5ZF: $retorno = new Categoria($row["id"], CRMDatos::getCRMById($row["CRM"]), $row["Nombre"], $row["Posicion"], $row["Contraido"], $row["Visible"]); goto Nk4WH; Nk4WH: NSJ5T: goto YgGDi; xY3N5: $con = getConnection(); goto sN2_c; YgGDi: sv_mysqli_close($con); goto bp8jT; xgxwe: } public static function addCategoria(Categoria $categoria) : int { goto BmxWI; AP1el: if (!($result = sv_mysqli_query($con, $query))) { goto MUcPq; } goto Q0Ukk; Q0Ukk: $retorno = mysqli_insert_id($con); goto POcO3; POcO3: MUcPq: goto upA3s; LTqgu: $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 AP1el; upA3s: sv_mysqli_close($con); goto zTyKi; uYi5U: $con = getConnection(); goto LTqgu; zTyKi: return $retorno; goto Wh9Cd; BmxWI: $retorno = 0; goto uYi5U; Wh9Cd: } public static function updateCategoria(Categoria $categoria) : int { goto V5mK7; KpRJR: $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 oSbVs; CW2ib: $retorno = 1; goto hjO1J; DXP7s: $con = getConnection(); goto KpRJR; EFSGm: sv_mysqli_close($con); goto LylnV; LylnV: return $retorno; goto oGv4G; oSbVs: if (!($result = sv_mysqli_query($con, $query))) { goto Py5HY; } goto CW2ib; V5mK7: $retorno = 0; goto DXP7s; hjO1J: Py5HY: goto EFSGm; oGv4G: } public static function deleteCategoria(Categoria $categoria) : int { goto AmX2V; PXc7e: if (!($result = sv_mysqli_query($con, $query))) { goto Xcnsj; } goto D6c22; Zj6UB: sv_mysqli_close($con); goto DsPUk; AmX2V: $retorno = 0; goto tMwLf; EIXg1: $query = "UPDATE dialvox_crm_categoria SET Visible = FALSE WHERE id = '" . limpia($categoria->getId()) . "'"; goto PXc7e; D6c22: $retorno = 1; goto zjHuY; zjHuY: Xcnsj: goto Zj6UB; DsPUk: return $retorno; goto glkMH; tMwLf: $con = getConnection(); goto EIXg1; glkMH: } public static function getCategoriasByCRM(CRM $crm) : array { goto YR9_T; YR9_T: $retorno = array(); goto kruLT; eHOBD: if (!($result = sv_mysqli_query($con, $query))) { goto z7idO; } goto JFFbJ; ptK2L: $retorno[] = self::getCategoriaById($row["id"]); goto ojLGs; ZupL4: K4aHh: goto x211Y; VRsjR: sv_mysqli_close($con); goto Biudz; ojLGs: goto ZvR4w; goto ZupL4; Biudz: return $retorno; goto UTI4a; kruLT: $con = getConnection(); goto Vy18q; JFFbJ: ZvR4w: goto WxXCL; Vy18q: $query = "SELECT id FROM dialvox_crm_categoria WHERE CRM = '" . limpia($crm->getId()) . "' AND Visible = TRUE ORDER BY Posicion"; goto eHOBD; x211Y: z7idO: goto VRsjR; WxXCL: if (!($row = sv_mysqli_fetch_array($result))) { goto K4aHh; } goto ptK2L; UTI4a: } public static function listCategoriasByCRM(CRM $crm) : array { goto B3f9D; J6L22: goto DIwuZ; goto n0Qwo; WnLL3: return $retorno; goto CvHyy; RITBH: $query = "SELECT id,Nombre FROM dialvox_crm_categoria WHERE CRM = '" . limpia($crm->getId()) . "' AND Visible = TRUE"; goto BNTPD; FW79_: $con = getConnection(); goto RITBH; Mt32c: $retorno[] = new Categoria($row["id"], $crm, $row["Nombre"], -1, false, true); goto J6L22; n0Qwo: Gta_6: goto H8nWf; LhipL: if (!($row = sv_mysqli_fetch_array($result))) { goto Gta_6; } goto Mt32c; H8nWf: ycWvz: goto VNbyf; Svxuo: DIwuZ: goto LhipL; BNTPD: if (!($result = sv_mysqli_query($con, $query))) { goto ycWvz; } goto Svxuo; B3f9D: $retorno = array(); goto FW79_; VNbyf: sv_mysqli_close($con); goto WnLL3; CvHyy: } public static function countCategoriasByCRM(CRM $crm) : int { $retorno = 0; return $retorno; } }