$xObj = new cSAFETabla($tabla); if ($xObj->obj() == null) { $rs[MSG_NO_PARAM_VALID] = "ERROR\t para la Tabla {$tabla} y clave {$clave}\r\n"; } else { $obj = $xObj->obj(); if ($action == SYS_NINGUNO) { if ($clave != false) { $obj->setData($obj->query()->initByID($clave)); } $rs = $obj->query()->getCampos(); $cadena = json_encode($rs); } else { //$obj = new cSocios_aeconomica(); $indice = $obj->getKey(); $etiq = $xObj->getCampoDescripcion(); if ($etiq == "") { $campos = $obj->query()->getCampos(); $cnt = 0; foreach ($campos as $props) { $etiq = $cnt == 1 ? $props["N"] : $etiq; $cnt++; } } $sql = "SELECT `{$tabla}`.`{$indice}` AS `indice`, `{$tabla}`.`{$etiq}` AS `etiqueta` FROM {$tabla} WHERE (`{$tabla}`.`{$indice}` LIKE '%{$clave}%' OR `{$tabla}`.`{$etiq}` LIKE '%{$clave}%' ) LIMIT 0,100"; //setLog($sql); $xSVC = new MQLService($action, $sql); $cadena = $xSVC->getJSON($out); } } } echo $cadena;
$arg2 = isset($DDATA["arg2"]) ? $DDATA["arg2"] : PERSONAS_ACTIVIDAD_ECONOMICA_CLASE; //$relacionado = isset($DDATA["relacionado"]) ? $DDATA["relacionado"] : SYS_NINGUNO; //ID $lim = isset($DDATA["lim"]) ? $DDATA["lim"] : 100; $arg = substr($arg, 0, 20); $where = ""; $superior = ""; $clase = ""; switch ($action) { case SVC_LIST: $where = " AND (\n \t\t\t(`personas_actividad_economica_tipos`.`nombre_de_la_actividad` LIKE '%{$arg}%')\n /* OR\n (`personas_actividad_economica_tipos`.`descripcion_detallada` LIKE '%{$arg}%')\n \n (`personas_actividad_economica_tipos`.`productos` LIKE '%{$arg}%')*/\n\t\t\t\t) LIMIT 0,{$lim}"; $clase = $arg2; break; case SVC_GET: $where = " AND ( `personas_actividad_economica_tipos`.`clave_de_actividad` = {$arg} ) LIMIT 0,1"; break; } //GET PUT DELETE LIST $xT = new cSQLListas(); //$xT->setOperador("LIKE"); $sql = $xT->getListadoDePersonasActividadesEconomicasTipos("", $clase, $superior, $where); //echo $sql; $xSVC = new MQLService($action, $sql); echo $xSVC->getJSON(); //$xLog = new cSystemLog(); //$xLog->setRotate(); //$xLog->setSave($sql); //$xT->clave_de_actividad() //print json_encode($jTableResult); /* echo "<?xml version =\"1.0\" ?>\n<data>\n" . $txt . "</data>"; */
$persona = parametro("socio", $persona, MQL_INT); $persona = parametro("idsocio", $persona, MQL_INT); $relacionado = parametro("relacionado", DEFAULT_SOCIO, MQL_INT); $tipo = parametro("tipo", 0, MQL_INT); $parentesco = parametro("parentesco", 0, MQL_INT); $depende = parametro("depende", false, MQL_BOOL); $documento = parametro("documento", false, MQL_INT); $error = false; $format = parametro("out", "", MQL_STRING); header('Content-type: application/json'); if ($persona > DEFAULT_SOCIO) { $xPer = new cSocio($persona); if ($xPer->init() == true) { //setLog($lis->getListadoDeRelaciones($persona)); $svc = new MQLService("list", $lis->getListadoDeRelaciones($persona, $documento)); echo $svc->getJSON($format); } else { $error = true; $txt .= "ERROR\tNo existe la persona {$persona}\r\n"; } if (MODO_DEBUG == true) { $txt .= $xPer->getMessages(); } } if ($error == true) { $rs["error"] = true; $rs["msg"] = $txt; echo json_encode($rs); } //setLog(json_encode($rs)); //setLog($sql);
/** * @author Balam Gonzalez Luis Humberto * @version 0.0.01 * @package */ //===================================================================================================== include_once "../core/go.login.inc.php"; include_once "../core/core.error.inc.php"; include_once "../core/core.html.inc.php"; include_once "../core/core.init.inc.php"; include_once "../core/core.db.inc.php"; $theFile = __FILE__; $permiso = getSIPAKALPermissions($theFile); if ($permiso === false) { header("location:../404.php?i=999"); } $_SESSION["current_file"] = addslashes($theFile); //===================================================================================================== $xHP = new cHPage("", HP_FORM); $sql = "SELECT\n\t`general_menu`.`idgeneral_menu`,\n\t/*`general_menu`.`menu_parent`,*/\n\t`general_menu`.`menu_title`,\n\t'' AS 'translate'\nFROM\n\t`general_menu` `general_menu` \nWHERE\n\t(`general_menu`.`menu_title` !='') "; //$OB = new MQL(); //$rs = $OB->getRecordset($sql); //$sel = $OB-> //$ob = new MQLSelect($tabla, $datos, $primaryK); //$men = new cGeneral_menu(); header('Content-type: application/json'); $svc = new MQLService("LIST", $sql); echo $svc->getJSON(); //$q = $men->query()->select(); //$q->exec("(`general_menu`.`menu_title` !='')");
echo $svc->getJSON($out); exit; } } else { $wher = $where == false ? "" : $where; $sql = base64_decode($query) . " " . base64_decode($where); $svc = new MQLService("list", $sql); echo $svc->getJSON($out); exit; } } if ($tabla != false and $clave != false) { $xObj = new cSAFETabla($tabla); if ($xObj->obj() == null) { $err = true; } else { $obj = $xObj->obj(); //$obj = new cSocios_general(); $sel = $obj->query()->select(); $sql = $sel->get($obj->getKey() . " = '{$clave}' "); $svc = new MQLService("list", $sql); //echo $sql; echo $svc->getJSON($out); exit; } } if ($err == true) { $rs[MSG_NO_PARAM_VALID] = "ERROR\t para la Tabla {$tabla} y clave {$clave}\r\n"; $rs["error"] = true; } echo json_encode($rs);