Example #1
0
 function LoadRow()
 {
     global $conn, $Security, $tbl_user_level;
     $sFilter = $tbl_user_level->KeyFilter();
     // Call Row Selecting event
     $tbl_user_level->Row_Selecting($sFilter);
     // Load SQL based on filter
     $tbl_user_level->CurrentFilter = $sFilter;
     $sSql = $tbl_user_level->SQL();
     $res = FALSE;
     $rs = ew_LoadRecordset($sSql);
     if ($rs && !$rs->EOF) {
         $res = TRUE;
         $this->LoadRowValues($rs);
         // Load row values
         // Call Row Selected event
         $tbl_user_level->Row_Selected($rs);
         $rs->Close();
     }
     return $res;
 }
Example #2
0
 function LoadRow()
 {
     global $Security, $Language;
     $sFilter = $this->KeyFilter();
     // Call Row Selecting event
     $this->Row_Selecting($sFilter);
     // Load SQL based on filter
     $this->CurrentFilter = $sFilter;
     $sSql = $this->SQL();
     $conn =& $this->Connection();
     $res = FALSE;
     $rs = ew_LoadRecordset($sSql, $conn);
     if ($rs && !$rs->EOF) {
         $res = TRUE;
         $this->LoadRowValues($rs);
         // Load row values
         $rs->Close();
     }
     return $res;
 }
 function LoadOldRecord()
 {
     global $t_promotions_vins;
     // Load key values from Session
     $bValidKey = TRUE;
     if (strval($t_promotions_vins->getKey("promotion")) != "") {
         $t_promotions_vins->promotion->CurrentValue = $t_promotions_vins->getKey("promotion");
     } else {
         $bValidKey = FALSE;
     }
     if (strval($t_promotions_vins->getKey("produit_vin")) != "") {
         $t_promotions_vins->produit_vin->CurrentValue = $t_promotions_vins->getKey("produit_vin");
     } else {
         $bValidKey = FALSE;
     }
     // Load old recordset
     if ($bValidKey) {
         $t_promotions_vins->CurrentFilter = $t_promotions_vins->KeyFilter();
         $sSql = $t_promotions_vins->SQL();
         $this->OldRecordset = ew_LoadRecordset($sSql);
         $this->LoadRowValues($this->OldRecordset);
         // Load row values
     }
     return TRUE;
 }
 function LoadOldRecord()
 {
     // Load key values from Session
     $bValidKey = TRUE;
     $arKeys[] = $this->RowOldKey;
     $cnt = count($arKeys);
     if ($cnt >= 1) {
         if (strval($arKeys[0]) != "") {
             $this->idcuenta->CurrentValue = strval($arKeys[0]);
         } else {
             $bValidKey = FALSE;
         }
     } else {
         $bValidKey = FALSE;
     }
     // Load old recordset
     if ($bValidKey) {
         $this->CurrentFilter = $this->KeyFilter();
         $sSql = $this->SQL();
         $this->OldRecordset = ew_LoadRecordset($sSql);
         $this->LoadRowValues($this->OldRecordset);
         // Load row values
     } else {
         $this->OldRecordset = NULL;
     }
     return $bValidKey;
 }
 function LoadOldRecord()
 {
     // Load key values from Session
     $bValidKey = TRUE;
     if (strval($this->getKey("UPLOAD_FILE_ID")) != "") {
         $this->UPLOAD_FILE_ID->CurrentValue = $this->getKey("UPLOAD_FILE_ID");
     } else {
         $bValidKey = FALSE;
     }
     // Load old recordset
     if ($bValidKey) {
         $this->CurrentFilter = $this->KeyFilter();
         $sSql = $this->SQL();
         $conn =& $this->Connection();
         $this->OldRecordset = ew_LoadRecordset($sSql, $conn);
         $this->LoadRowValues($this->OldRecordset);
         // Load row values
     } else {
         $this->OldRecordset = NULL;
     }
     return $bValidKey;
 }
 function LoadOldRecord()
 {
     // Load key values from Session
     $bValidKey = TRUE;
     // Load old recordset
     if ($bValidKey) {
         $this->CurrentFilter = $this->KeyFilter();
         $sSql = $this->SQL();
         $this->OldRecordset = ew_LoadRecordset($sSql);
         $this->LoadRowValues($this->OldRecordset);
         // Load row values
     } else {
         $this->OldRecordset = NULL;
     }
     return $bValidKey;
 }
Example #7
0
function ew_ExecuteJson($SQL, $FirstOnly = TRUE, $c = NULL)
{
    $rs = ew_LoadRecordset($SQL, $c);
    if ($rs && !$rs->EOF && $rs->FieldCount() > 0) {
        $res = $FirstOnly ? array($rs->fields) : $rs->GetRows();
        $rs->Close();
        return json_encode($res);
    }
    return "false";
}
 function GetAutoFill($id, $val)
 {
     $rsarr = array();
     $rowcnt = 0;
     if (preg_match('/^x(\\d)*_socio_nro$/', $id)) {
         $sSqlWrk = "SELECT `cuit_cuil` AS FIELD0, `propietario` AS FIELD1, `comercio` AS FIELD2 FROM `socios`";
         $sWhereWrk = "(`socio_nro` = " . ew_AdjustSql($val) . ")";
         if (!$GLOBALS["v_total_estado_cuenta_x_anio_mes"]->UserIDAllow("info")) {
             $sWhereWrk = $GLOBALS["socios"]->AddUserIDFilter($sWhereWrk);
         }
         // Call Lookup selecting
         $this->Lookup_Selecting($this->socio_nro, $sWhereWrk);
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $sSqlWrk .= " ORDER BY `comercio` DESC";
         if ($rs = ew_LoadRecordset($sSqlWrk)) {
             while ($rs && !$rs->EOF) {
                 $ar = array();
                 $this->cuit_cuil->setDbValue($rs->fields[0]);
                 $this->propietario->setDbValue($rs->fields[1]);
                 $this->comercio->setDbValue($rs->fields[2]);
                 $this->RowType == EW_ROWTYPE_EDIT;
                 $this->RenderEditRow();
                 $ar[] = $this->cuit_cuil->AutoFillOriginalValue ? $this->cuit_cuil->CurrentValue : $this->cuit_cuil->EditValue;
                 $ar[] = $this->propietario->CurrentValue;
                 $ar[] = $this->comercio->CurrentValue;
                 $rowcnt += 1;
                 $rsarr[] = $ar;
                 $rs->MoveNext();
             }
             $rs->Close();
         }
     }
     // Output
     if (is_array($rsarr) && $rowcnt > 0) {
         $fldcnt = count($rsarr[0]);
         for ($i = 0; $i < $rowcnt; $i++) {
             for ($j = 0; $j < $fldcnt; $j++) {
                 $str = strval($rsarr[$i][$j]);
                 $str = ew_ConvertToUtf8($str);
                 if (isset($post["keepCRLF"])) {
                     $str = str_replace(array("\r", "\n"), array("\\r", "\\n"), $str);
                 } else {
                     $str = str_replace(array("\r", "\n"), array(" ", " "), $str);
                 }
                 $rsarr[$i][$j] = $str;
             }
         }
         return ew_ArrayToJson($rsarr);
     } else {
         return FALSE;
     }
 }
 function LoadOldRecord()
 {
     // Load key values from Session
     $bValidKey = TRUE;
     $arKeys[] = explode($GLOBALS["EW_COMPOSITE_KEY_SEPARATOR"], $this->RowOldKey);
     $cnt = count($arKeys);
     if ($cnt >= 3) {
         if (strval($arKeys[0]) != "") {
             $this->codigo_bodega->CurrentValue = strval($arKeys[0]);
         } else {
             $bValidKey = FALSE;
         }
         if (strval($arKeys[1]) != "") {
             $this->Estanteria_Id->CurrentValue = strval($arKeys[1]);
         } else {
             $bValidKey = FALSE;
         }
         if (strval($arKeys[2]) != "") {
             $this->Seccion_id->CurrentValue = strval($arKeys[2]);
         } else {
             $bValidKey = FALSE;
         }
     } else {
         $bValidKey = FALSE;
     }
     // Load old recordset
     if ($bValidKey) {
         $this->CurrentFilter = $this->KeyFilter();
         $sSql = $this->SQL();
         $this->OldRecordset = ew_LoadRecordset($sSql);
         $this->LoadRowValues($this->OldRecordset);
         // Load row values
     } else {
         $this->OldRecordset = NULL;
     }
     return $bValidKey;
 }
Example #10
0
 function ew_ExecuteHtml($SQL, $options = NULL, $c = NULL)
 {
     $TableClass = "table table-bordered table-striped ewDbTable";
     // Table CSS class name
     $ar = is_array($options) ? $options : array();
     $horizontal = array_key_exists("horizontal", $ar) && $ar["horizontal"];
     $rs = ew_LoadRecordset($SQL, $c);
     if (!$rs || $rs->EOF || $rs->FieldCount() < 1) {
         return "";
     }
     $html = "";
     $class = array_key_exists("tableclass", $ar) && $ar["tableclass"] ? $ar["tableclass"] : $TableClass;
     if ($rs->RecordCount() > 1 || $horizontal) {
         // Horizontal table
         $cnt = $rs->FieldCount();
         $html = "<table class=\"" . $class . "\">";
         $html .= "<thead><tr>";
         $row =& $rs->fields;
         foreach ($row as $key => $value) {
             if (!is_numeric($key)) {
                 $html .= "<th>" . ew_GetFieldCaption($key, $ar) . "</th>";
             }
         }
         $html .= "</tr></thead>";
         $html .= "<tbody>";
         $rowcnt = 0;
         while (!$rs->EOF) {
             $html .= "<tr>";
             $row =& $rs->fields;
             foreach ($row as $key => $value) {
                 if (!is_numeric($key)) {
                     $html .= "<td>" . $value . "</td>";
                 }
             }
             $html .= "</tr>";
             $rs->MoveNext();
         }
         $html .= "</tbody></table>";
     } else {
         // Single row, vertical table
         $html = "<table class=\"" . $class . "\"><tbody>";
         $row =& $rs->fields;
         foreach ($row as $key => $value) {
             if (!is_numeric($key)) {
                 $html .= "<tr>";
                 $html .= "<td>" . ew_GetFieldCaption($key, $ar) . "</td>";
                 $html .= "<td>" . $value . "</td></tr>";
             }
         }
         $html .= "</tbody></table>";
     }
     return $html;
 }
 function LoadOldRecord()
 {
     global $t_super_categories;
     // Load key values from Session
     $bValidKey = TRUE;
     if (strval($t_super_categories->getKey("id")) != "") {
         $t_super_categories->id->CurrentValue = $t_super_categories->getKey("id");
     } else {
         $bValidKey = FALSE;
     }
     // Load old recordset
     if ($bValidKey) {
         $t_super_categories->CurrentFilter = $t_super_categories->KeyFilter();
         $sSql = $t_super_categories->SQL();
         $this->OldRecordset = ew_LoadRecordset($sSql);
         $this->LoadRowValues($this->OldRecordset);
         // Load row values
     }
     return TRUE;
 }
 function LoadRow()
 {
     global $conn, $Security, $Language;
     $sFilter = $this->KeyFilter();
     // Call Row Selecting event
     $this->Row_Selecting($sFilter);
     // Load SQL based on filter
     $this->CurrentFilter = $sFilter;
     $sSql = $this->SQL();
     $res = FALSE;
     $rs = ew_LoadRecordset($sSql);
     if ($rs && !$rs->EOF) {
         $res = TRUE;
         $this->LoadRowValues($rs);
         // Load row values
         if (!$this->EventCancelled) {
             $this->HashValue = $this->GetRowHash($rs);
         }
         // Get hash value for record
         $rs->Close();
     }
     return $res;
 }
Example #13
0
 function GetAutoFill($id, $val)
 {
     $rsarr = array();
     $rowcnt = 0;
     if (preg_match('/^x(\\d)*_id_cliente$/', $id)) {
         $sSqlWrk = "SELECT `direccion` AS FIELD0, `direccion` AS FIELD1, `id_localidad` AS FIELD2, `id_localidad` AS FIELD3 FROM `clientes`";
         $sWhereWrk = "(`codigo` = " . ew_AdjustSql($val) . ")";
         // Call Lookup selecting
         $this->Lookup_Selecting($this->id_cliente, $sWhereWrk);
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $sSqlWrk .= " ORDER BY `razon_social` ASC";
         if ($rs = ew_LoadRecordset($sSqlWrk)) {
             while ($rs && !$rs->EOF) {
                 $ar = array();
                 $this->Origen->setDbValue($rs->fields[0]);
                 $this->Destino->setDbValue($rs->fields[1]);
                 $this->id_localidad_origen->setDbValue($rs->fields[2]);
                 $this->id_localidad_destino->setDbValue($rs->fields[3]);
                 $this->RowType == EW_ROWTYPE_EDIT;
                 $this->RenderEditRow();
                 $ar[] = $this->Origen->AutoFillOriginalValue ? $this->Origen->CurrentValue : $this->Origen->EditValue;
                 $ar[] = $this->Destino->AutoFillOriginalValue ? $this->Destino->CurrentValue : $this->Destino->EditValue;
                 $ar[] = $this->id_localidad_origen->CurrentValue;
                 $ar[] = $this->id_localidad_destino->CurrentValue;
                 $rowcnt += 1;
                 $rsarr[] = $ar;
                 $rs->MoveNext();
             }
             $rs->Close();
         }
     }
     if (preg_match('/^x(\\d)*_id_tipo_carga$/', $id)) {
         $sSqlWrk = "SELECT `precio_base` AS FIELD0, `porcentaje_comision` AS FIELD1 FROM `tipo_cargas`";
         $sWhereWrk = "(`codigo` = " . ew_AdjustSql($val) . ")";
         // Call Lookup selecting
         $this->Lookup_Selecting($this->id_tipo_carga, $sWhereWrk);
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $sSqlWrk .= " ORDER BY `Tipo_carga` ASC";
         if ($rs = ew_LoadRecordset($sSqlWrk)) {
             while ($rs && !$rs->EOF) {
                 $ar = array();
                 $this->tarifa->setDbValue($rs->fields[0]);
                 $this->porcentaje->setDbValue($rs->fields[1]);
                 $this->RowType == EW_ROWTYPE_EDIT;
                 $this->RenderEditRow();
                 $ar[] = $this->tarifa->AutoFillOriginalValue ? $this->tarifa->CurrentValue : $this->tarifa->EditValue;
                 $ar[] = $this->porcentaje->AutoFillOriginalValue ? $this->porcentaje->CurrentValue : $this->porcentaje->EditValue;
                 $rowcnt += 1;
                 $rsarr[] = $ar;
                 $rs->MoveNext();
             }
             $rs->Close();
         }
     }
     // Output
     if (is_array($rsarr) && $rowcnt > 0) {
         $fldcnt = count($rsarr[0]);
         for ($i = 0; $i < $rowcnt; $i++) {
             for ($j = 0; $j < $fldcnt; $j++) {
                 $str = strval($rsarr[$i][$j]);
                 $str = ew_ConvertToUtf8($str);
                 if (isset($post["keepCRLF"])) {
                     $str = str_replace(array("\r", "\n"), array("\\r", "\\n"), $str);
                 } else {
                     $str = str_replace(array("\r", "\n"), array(" ", " "), $str);
                 }
                 $rsarr[$i][$j] = $str;
             }
         }
         return ew_ArrayToJson($rsarr);
     } else {
         return FALSE;
     }
 }
 function LoadOldRecord()
 {
     // Load key values from Session
     $bValidKey = TRUE;
     if (strval($this->getKey("codigo")) != "") {
         $this->codigo->CurrentValue = $this->getKey("codigo");
     } else {
         $bValidKey = FALSE;
     }
     // Load old recordset
     if ($bValidKey) {
         $this->CurrentFilter = $this->KeyFilter();
         $sSql = $this->SQL();
         $this->OldRecordset = ew_LoadRecordset($sSql);
         $this->LoadRowValues($this->OldRecordset);
         // Load row values
     } else {
         $this->OldRecordset = NULL;
     }
     return $bValidKey;
 }
Example #15
0
function ew_ExecuteRow($SQL)
{
    $res = FALSE;
    $rs = ew_LoadRecordset($SQL);
    if ($rs && !$rs->EOF) {
        $res = $rs->fields;
        $rs->Close();
    }
    return $res;
}
Example #16
0
 function LoadRow()
 {
     global $conn, $Security, $Language;
     $sFilter = $this->KeyFilter();
     // Call Row Selecting event
     $this->Row_Selecting($sFilter);
     // Load SQL based on filter
     $this->CurrentFilter = $sFilter;
     $sSql = $this->SQL();
     $res = FALSE;
     $rs = ew_LoadRecordset($sSql);
     if ($rs && !$rs->EOF) {
         $res = TRUE;
         $this->LoadRowValues($rs);
         // Load row values
         $rs->Close();
     }
     // Check if valid user id
     if ($res) {
         $res = $this->ShowOptionLink('edit');
         if (!$res) {
             $sUserIdMsg = $Language->Phrase("NoPermission");
             $this->setFailureMessage($sUserIdMsg);
         }
     }
     return $res;
 }
 function GetAutoFill($id, $val)
 {
     $rsarr = array();
     $rowcnt = 0;
     if (preg_match('/^x(\\d)*_id_tramite$/', $id)) {
         $sSqlWrk = "SELECT `Titulo` AS FIELD0 FROM `tramites`";
         $sWhereWrk = "(`codigo` = " . ew_AdjustSql($val) . ")";
         $lookuptblfilter = "`estado`<>'F'";
         if (strval($lookuptblfilter) != "") {
             ew_AddFilter($sWhereWrk, $lookuptblfilter);
         }
         // Call Lookup selecting
         $this->Lookup_Selecting($this->id_tramite, $sWhereWrk);
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $sSqlWrk .= " ORDER BY `fecha` ASC";
         if ($rs = ew_LoadRecordset($sSqlWrk)) {
             while ($rs && !$rs->EOF) {
                 $ar = array();
                 $this->titulo->setDbValue($rs->fields[0]);
                 $this->RowType == EW_ROWTYPE_EDIT;
                 $this->RenderEditRow();
                 $ar[] = $this->titulo->AutoFillOriginalValue ? $this->titulo->CurrentValue : $this->titulo->EditValue;
                 $rowcnt += 1;
                 $rsarr[] = $ar;
                 $rs->MoveNext();
             }
             $rs->Close();
         }
     }
     // Output
     if (is_array($rsarr) && $rowcnt > 0) {
         $fldcnt = count($rsarr[0]);
         for ($i = 0; $i < $rowcnt; $i++) {
             for ($j = 0; $j < $fldcnt; $j++) {
                 $str = strval($rsarr[$i][$j]);
                 $str = ew_ConvertToUtf8($str);
                 if (isset($post["keepCRLF"])) {
                     $str = str_replace(array("\r", "\n"), array("\\r", "\\n"), $str);
                 } else {
                     $str = str_replace(array("\r", "\n"), array(" ", " "), $str);
                 }
                 $rsarr[$i][$j] = $str;
             }
         }
         return ew_ArrayToJson($rsarr);
     } else {
         return FALSE;
     }
 }