<?php
/*   __________________________________________________
    |  Obfuscated by YAK Pro - Php Obfuscator  2.0.17  |
    |              on 2026-02-13 06:00:54              |
    |    GitHub: https://github.com/pk-fr/yakpro-po    |
    |__________________________________________________|
*/
 goto vEMsF; vEMsF: require_once 'Categoria.php'; goto Rgcep; Rgcep: require_once RUTA_APP . 'Conexion.php'; goto bBuCi; bBuCi: class CategoriaDatos { public static function getCategoriaById(int $id) : ?Categoria { goto fQbqg; Uc8sp: LfWm9: goto B4TmD; fQbqg: $retorno = null; goto Ty58l; ZhC0y: $query = "SELECT id, CRM, Nombre, Posicion, Visible,Contraido FROM dialvox_crm_categoria WHERE id = '" . limpia($id) . "'"; goto fyN6l; fyN6l: $result = sv_mysqli_query($con, $query); goto KWPW3; N4X8Z: $retorno = new Categoria($row["id"], CRMDatos::getCRMById($row["CRM"]), $row["Nombre"], $row["Posicion"], $row["Contraido"], $row["Visible"]); goto Uc8sp; htxtT: return $retorno; goto HIkAG; B4TmD: sv_mysqli_close($con); goto htxtT; KWPW3: if (!($row = sv_mysqli_fetch_array($result))) { goto LfWm9; } goto N4X8Z; Ty58l: $con = getConnection(); goto ZhC0y; HIkAG: } public static function addCategoria(Categoria $categoria) : int { goto JwYKG; JwYKG: $retorno = 0; goto oIAiz; ayN54: $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 gb7Ys; w4g2P: KsotA: goto NYNpj; gb7Ys: if (!($result = sv_mysqli_query($con, $query))) { goto KsotA; } goto QBd7h; oIAiz: $con = getConnection(); goto ayN54; NYNpj: sv_mysqli_close($con); goto lh8t3; lh8t3: return $retorno; goto XgGBl; QBd7h: $retorno = mysqli_insert_id($con); goto w4g2P; XgGBl: } public static function updateCategoria(Categoria $categoria) : int { goto jVHbE; PEvIn: sv_mysqli_close($con); goto bxn0u; OSTaJ: OxnaB: goto PEvIn; bxn0u: return $retorno; goto vTt4D; lP4kS: $con = getConnection(); goto WATgT; WATgT: $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 rnq0q; jVHbE: $retorno = 0; goto lP4kS; rnq0q: if (!($result = sv_mysqli_query($con, $query))) { goto OxnaB; } goto ZEksj; ZEksj: $retorno = 1; goto OSTaJ; vTt4D: } public static function deleteCategoria(Categoria $categoria) : int { goto bki6C; P9TTv: return $retorno; goto Qj51D; d2w1j: if (!($result = sv_mysqli_query($con, $query))) { goto lCjN0; } goto mJgxX; jFyBx: sv_mysqli_close($con); goto P9TTv; bki6C: $retorno = 0; goto zDxHe; mJgxX: $retorno = 1; goto mMEMx; Q04qT: $query = "UPDATE dialvox_crm_categoria SET Visible = FALSE WHERE id = '" . limpia($categoria->getId()) . "'"; goto d2w1j; mMEMx: lCjN0: goto jFyBx; zDxHe: $con = getConnection(); goto Q04qT; Qj51D: } public static function getCategoriasByCRM(CRM $crm) : array { goto aJFsJ; qsVJX: Bjukm: goto WfliC; kcP_K: if (!($result = sv_mysqli_query($con, $query))) { goto Bjukm; } goto phMzA; k6Nwf: $con = getConnection(); goto cQwom; WfliC: sv_mysqli_close($con); goto vwGVa; D3JZl: goto uhC9O; goto AlvOe; AlvOe: qhR_3: goto qsVJX; cQwom: $query = "SELECT id FROM dialvox_crm_categoria WHERE CRM = '" . limpia($crm->getId()) . "' AND Visible = TRUE ORDER BY Posicion"; goto kcP_K; phMzA: uhC9O: goto VpXNC; VpXNC: if (!($row = sv_mysqli_fetch_array($result))) { goto qhR_3; } goto gCp0v; aJFsJ: $retorno = array(); goto k6Nwf; gCp0v: $retorno[] = self::getCategoriaById($row["id"]); goto D3JZl; vwGVa: return $retorno; goto q_j_t; q_j_t: } public static function listCategoriasByCRM(CRM $crm) : array { goto N_QDZ; G_mNX: NBq2O: goto gqSs8; gqSs8: sv_mysqli_close($con); goto gyeW5; T3eaM: $retorno[] = new Categoria($row["id"], $crm, $row["Nombre"], -1, false, true); goto WnkJ7; bu9T8: if (!($row = sv_mysqli_fetch_array($result))) { goto mEcI4; } goto T3eaM; N_QDZ: $retorno = array(); goto agRJQ; WnkJ7: goto I80j1; goto B63t2; agRJQ: $con = getConnection(); goto ynefd; XEf9b: if (!($result = sv_mysqli_query($con, $query))) { goto NBq2O; } goto GPSHv; GPSHv: I80j1: goto bu9T8; gyeW5: return $retorno; goto Q3Hhc; ynefd: $query = "SELECT id,Nombre FROM dialvox_crm_categoria WHERE CRM = '" . limpia($crm->getId()) . "' AND Visible = TRUE"; goto XEf9b; B63t2: mEcI4: goto G_mNX; Q3Hhc: } public static function countCategoriasByCRM(CRM $crm) : int { $retorno = 0; return $retorno; } }