function RenderEditRow()
 {
     global $conn, $Security, $gsLanguage, $Language;
     // Call Row Rendering event
     $this->Row_Rendering();
     // idempleado
     $this->idempleado->EditAttrs["class"] = "form-control";
     $this->idempleado->EditCustomAttributes = "";
     $this->idempleado->EditValue = $this->idempleado->CurrentValue;
     $this->idempleado->ViewCustomAttributes = "";
     // nombre
     $this->nombre->EditAttrs["class"] = "form-control";
     $this->nombre->EditCustomAttributes = "";
     $this->nombre->EditValue = ew_HtmlEncode($this->nombre->CurrentValue);
     $this->nombre->PlaceHolder = ew_RemoveHtml($this->nombre->FldCaption());
     // apellido
     $this->apellido->EditAttrs["class"] = "form-control";
     $this->apellido->EditCustomAttributes = "";
     $this->apellido->EditValue = ew_HtmlEncode($this->apellido->CurrentValue);
     $this->apellido->PlaceHolder = ew_RemoveHtml($this->apellido->FldCaption());
     // cui
     $this->cui->EditAttrs["class"] = "form-control";
     $this->cui->EditCustomAttributes = "";
     $this->cui->EditValue = ew_HtmlEncode($this->cui->CurrentValue);
     $this->cui->PlaceHolder = ew_RemoveHtml($this->cui->FldCaption());
     // telefono
     $this->telefono->EditAttrs["class"] = "form-control";
     $this->telefono->EditCustomAttributes = "";
     $this->telefono->EditValue = ew_HtmlEncode($this->telefono->CurrentValue);
     $this->telefono->PlaceHolder = ew_RemoveHtml($this->telefono->FldCaption());
     // direccion
     $this->direccion->EditAttrs["class"] = "form-control";
     $this->direccion->EditCustomAttributes = "";
     $this->direccion->EditValue = ew_HtmlEncode($this->direccion->CurrentValue);
     $this->direccion->PlaceHolder = ew_RemoveHtml($this->direccion->FldCaption());
     // estado
     $this->estado->EditCustomAttributes = "";
     $arwrk = array();
     $arwrk[] = array($this->estado->FldTagValue(1), $this->estado->FldTagCaption(1) != "" ? $this->estado->FldTagCaption(1) : $this->estado->FldTagValue(1));
     $arwrk[] = array($this->estado->FldTagValue(2), $this->estado->FldTagCaption(2) != "" ? $this->estado->FldTagCaption(2) : $this->estado->FldTagValue(2));
     $this->estado->EditValue = $arwrk;
     // idhospital
     $this->idhospital->EditAttrs["class"] = "form-control";
     $this->idhospital->EditCustomAttributes = "";
     if ($this->idhospital->getSessionValue() != "") {
         $this->idhospital->CurrentValue = $this->idhospital->getSessionValue();
         if (strval($this->idhospital->CurrentValue) != "") {
             $sFilterWrk = "`idhospital`" . ew_SearchString("=", $this->idhospital->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `idhospital`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `hospital`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->idhospital, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->idhospital->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->idhospital->ViewValue = $this->idhospital->CurrentValue;
             }
         } else {
             $this->idhospital->ViewValue = NULL;
         }
         $this->idhospital->ViewCustomAttributes = "";
     } else {
     }
     // Call Row Rendered event
     $this->Row_Rendered();
 }
Example #2
0
 function Page_Main()
 {
     $GLOBALS["Page"] =& $this;
     $post = ew_StripSlashes($_POST);
     if (count($post) == 0) {
         die("Missing post data.");
     }
     //$sql = $qs->getValue("s");
     $sql = @$post["s"];
     $sql = ew_Decrypt($sql);
     if ($sql == "") {
         die("Missing SQL.");
     }
     if (strpos($sql, "{filter}") > 0) {
         $filters = "";
         for ($i = 0; $i < 5; $i++) {
             // Get the filter values (for "IN")
             $filter = ew_Decrypt(@$post["f" . $i]);
             if ($filter != "") {
                 $value = @$post["v" . $i];
                 if ($value == "") {
                     if ($i > 0) {
                         // Empty parent field
                         //continue; // Allow
                         ew_AddFilter($filters, "1=0");
                     }
                     // Disallow
                     continue;
                 }
                 $arValue = explode(",", $value);
                 $fldtype = intval(@$post["t" . $i]);
                 for ($j = 0, $cnt = count($arValue); $j < $cnt; $j++) {
                     $arValue[$j] = ew_QuotedValue($arValue[$j], ew_FieldDataType($fldtype));
                 }
                 $filter = str_replace("{filter_value}", implode(",", $arValue), $filter);
                 ew_AddFilter($filters, $filter);
             }
         }
         $sql = str_replace("{filter}", $filters != "" ? $filters : "1=1", $sql);
     }
     // Get the query value (for "LIKE" or "=")
     $value = ew_AdjustSql(@$post["q"]);
     if ($value != "") {
         $sql = preg_replace('/LIKE \'(%)?\\{query_value\\}%\'/', ew_Like('\'$1{query_value}%\''), $sql);
         $sql = str_replace("{query_value}", $value, $sql);
     }
     // Replace {query_value_n}
     preg_match_all('/\\{query_value_(\\d+)\\}/', $sql, $out);
     $cnt = count($out[0]);
     for ($i = 0; $i < $cnt; $i++) {
         $j = $out[1][$i];
         $v = ew_AdjustSql(@$post["q" . $j]);
         $sql = str_replace("{query_value_" . $j . "}", $v, $sql);
     }
     $this->GetLookupValues($sql);
 }
Example #3
0
 function Page_Main()
 {
     $post = ew_StripSlashes($_POST);
     if (count($post) == 0) {
         die("Missing post data.");
     }
     //$sql = $qs->getValue("s");
     $sql = $post["s"];
     $sql = TEAdecrypt($sql, EW_RANDOM_KEY);
     if ($sql == "") {
         die("Missing SQL.");
     }
     if (strpos($sql, "{filter}") > 0) {
         $filters = "";
         for ($i = 0; $i < 5; $i++) {
             // Get the filter values (for "IN")
             $filter = TEAdecrypt($post["f" . $i], EW_RANDOM_KEY);
             if ($filter != "") {
                 $value = $post["v" . $i];
                 if ($value == "") {
                     if ($i > 0) {
                         // Empty parent field
                         //continue; // Allow
                         ew_AddFilter($filters, "1=0");
                     }
                     // Disallow
                     continue;
                 }
                 $arValue = explode(",", $value);
                 $fldtype = intval($post["t" . $i]);
                 for ($j = 0, $cnt = count($arValue); $j < $cnt; $j++) {
                     $arValue[$j] = ew_QuotedValue($arValue[$j], ew_FieldDataType($fldtype));
                 }
                 $filter = str_replace("{filter_value}", implode(",", $arValue), $filter);
                 ew_AddFilter($filters, $filter);
             }
         }
         $sql = str_replace("{filter}", $filters != "" ? $filters : "1=1", $sql);
     }
     // Get the query value (for "LIKE" or "=")
     $value = ew_AdjustSql(@$post["q"]);
     if ($value != "") {
         $sql = preg_replace('/LIKE \'(%)?\\{query_value\\}%\'/', ew_Like('\'$1{query_value}%\''), $sql);
         $sql = str_replace("{query_value}", $value, $sql);
     }
     // Check custom function
     $fn = @$post["fn"];
     if ($fn != "" && function_exists($fn)) {
         // Custom function(&$sql)
         $sql = $fn($sql);
     }
     $this->GetLookupValues($sql);
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // id
     // lesson_id
     // video_link
     // active
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // id
         $this->id->ViewValue = $this->id->CurrentValue;
         $this->id->ViewCustomAttributes = "";
         // lesson_id
         if (strval($this->lesson_id->CurrentValue) != "") {
             $sFilterWrk = "`lesson_id`" . ew_SearchString("=", $this->lesson_id->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `lesson_id`, `lesson_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tbl_lesson`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->lesson_id->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->lesson_id->ViewValue = $this->lesson_id->CurrentValue;
             }
         } else {
             $this->lesson_id->ViewValue = NULL;
         }
         $this->lesson_id->ViewCustomAttributes = "";
         // video_link
         $this->video_link->ViewValue = $this->video_link->CurrentValue;
         $this->video_link->ViewCustomAttributes = "";
         // active
         $this->active->ViewValue = $this->active->CurrentValue;
         $this->active->ViewCustomAttributes = "";
         // id
         $this->id->LinkCustomAttributes = "";
         $this->id->HrefValue = "";
         $this->id->TooltipValue = "";
         // lesson_id
         $this->lesson_id->LinkCustomAttributes = "";
         $this->lesson_id->HrefValue = "";
         $this->lesson_id->TooltipValue = "";
         // video_link
         $this->video_link->LinkCustomAttributes = "";
         $this->video_link->HrefValue = "";
         $this->video_link->TooltipValue = "";
         // active
         $this->active->LinkCustomAttributes = "";
         $this->active->HrefValue = "";
         $this->active->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // id
         $this->id->EditCustomAttributes = "";
         $this->id->EditValue = $this->id->CurrentValue;
         $this->id->ViewCustomAttributes = "";
         // lesson_id
         $this->lesson_id->EditCustomAttributes = "";
         $sFilterWrk = "";
         $sSqlWrk = "SELECT `lesson_id`, `lesson_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `tbl_lesson`";
         $sWhereWrk = "";
         if ($sFilterWrk != "") {
             ew_AddFilter($sWhereWrk, $sFilterWrk);
         }
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = $conn->Execute($sSqlWrk);
         $arwrk = $rswrk ? $rswrk->GetRows() : array();
         if ($rswrk) {
             $rswrk->Close();
         }
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
         $this->lesson_id->EditValue = $arwrk;
         // video_link
         $this->video_link->EditCustomAttributes = "";
         $this->video_link->EditValue = ew_HtmlEncode($this->video_link->CurrentValue);
         // active
         $this->active->EditCustomAttributes = "";
         $this->active->EditValue = ew_HtmlEncode($this->active->CurrentValue);
         // Edit refer script
         // id
         $this->id->HrefValue = "";
         // lesson_id
         $this->lesson_id->HrefValue = "";
         // video_link
         $this->video_link->HrefValue = "";
         // active
         $this->active->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // accountId
     // permissionId
     // granted
     // realmId
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // accountId
         if (strval($this->accountId->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->accountId->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `username` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `account`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->accountId->ViewValue = $rswrk->fields('DispFld');
                 $this->accountId->ViewValue .= ew_ValueSeparator(1, $this->accountId) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->accountId->ViewValue = $this->accountId->CurrentValue;
             }
         } else {
             $this->accountId->ViewValue = NULL;
         }
         $this->accountId->ViewCustomAttributes = "";
         // permissionId
         if ($this->permissionId->VirtualValue != "") {
             $this->permissionId->ViewValue = $this->permissionId->VirtualValue;
         } else {
             if (strval($this->permissionId->CurrentValue) != "") {
                 $sFilterWrk = "`id`" . ew_SearchString("=", $this->permissionId->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `rbac_permissions`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->permissionId->ViewValue = $rswrk->fields('DispFld');
                     $this->permissionId->ViewValue .= ew_ValueSeparator(1, $this->permissionId) . $rswrk->fields('Disp2Fld');
                     $rswrk->Close();
                 } else {
                     $this->permissionId->ViewValue = $this->permissionId->CurrentValue;
                 }
             } else {
                 $this->permissionId->ViewValue = NULL;
             }
         }
         $this->permissionId->ViewCustomAttributes = "";
         // granted
         if (strval($this->granted->CurrentValue) != "") {
             switch ($this->granted->CurrentValue) {
                 case $this->granted->FldTagValue(1):
                     $this->granted->ViewValue = $this->granted->FldTagCaption(1) != "" ? $this->granted->FldTagCaption(1) : $this->granted->CurrentValue;
                     break;
                 case $this->granted->FldTagValue(2):
                     $this->granted->ViewValue = $this->granted->FldTagCaption(2) != "" ? $this->granted->FldTagCaption(2) : $this->granted->CurrentValue;
                     break;
                 default:
                     $this->granted->ViewValue = $this->granted->CurrentValue;
             }
         } else {
             $this->granted->ViewValue = NULL;
         }
         $this->granted->ViewCustomAttributes = "";
         // realmId
         if (strval($this->realmId->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->realmId->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `realmlist`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->realmId->ViewValue = $rswrk->fields('DispFld');
                 $this->realmId->ViewValue .= ew_ValueSeparator(1, $this->realmId) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->realmId->ViewValue = $this->realmId->CurrentValue;
             }
         } else {
             $this->realmId->ViewValue = NULL;
         }
         $this->realmId->ViewCustomAttributes = "";
         // accountId
         $this->accountId->LinkCustomAttributes = "";
         $this->accountId->HrefValue = "";
         $this->accountId->TooltipValue = "";
         // permissionId
         $this->permissionId->LinkCustomAttributes = "";
         $this->permissionId->HrefValue = "";
         $this->permissionId->TooltipValue = "";
         // granted
         $this->granted->LinkCustomAttributes = "";
         $this->granted->HrefValue = "";
         $this->granted->TooltipValue = "";
         // realmId
         $this->realmId->LinkCustomAttributes = "";
         $this->realmId->HrefValue = "";
         $this->realmId->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // accountId
         $this->accountId->EditCustomAttributes = "";
         if (strval($this->accountId->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->accountId->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `username` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `account`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->accountId->EditValue = $rswrk->fields('DispFld');
                 $this->accountId->EditValue .= ew_ValueSeparator(1, $this->accountId) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->accountId->EditValue = $this->accountId->CurrentValue;
             }
         } else {
             $this->accountId->EditValue = NULL;
         }
         $this->accountId->ViewCustomAttributes = "";
         // permissionId
         $this->permissionId->EditCustomAttributes = "";
         if ($this->permissionId->VirtualValue != "") {
             $this->permissionId->ViewValue = $this->permissionId->VirtualValue;
         } else {
             if (strval($this->permissionId->CurrentValue) != "") {
                 $sFilterWrk = "`id`" . ew_SearchString("=", $this->permissionId->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `rbac_permissions`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->permissionId->EditValue = $rswrk->fields('DispFld');
                     $this->permissionId->EditValue .= ew_ValueSeparator(1, $this->permissionId) . $rswrk->fields('Disp2Fld');
                     $rswrk->Close();
                 } else {
                     $this->permissionId->EditValue = $this->permissionId->CurrentValue;
                 }
             } else {
                 $this->permissionId->EditValue = NULL;
             }
         }
         $this->permissionId->ViewCustomAttributes = "";
         // granted
         $this->granted->EditCustomAttributes = "";
         $arwrk = array();
         $arwrk[] = array($this->granted->FldTagValue(1), $this->granted->FldTagCaption(1) != "" ? $this->granted->FldTagCaption(1) : $this->granted->FldTagValue(1));
         $arwrk[] = array($this->granted->FldTagValue(2), $this->granted->FldTagCaption(2) != "" ? $this->granted->FldTagCaption(2) : $this->granted->FldTagValue(2));
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect")));
         $this->granted->EditValue = $arwrk;
         // realmId
         $this->realmId->EditCustomAttributes = "";
         if (strval($this->realmId->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->realmId->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `realmlist`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->realmId->EditValue = $rswrk->fields('DispFld');
                 $this->realmId->EditValue .= ew_ValueSeparator(1, $this->realmId) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->realmId->EditValue = $this->realmId->CurrentValue;
             }
         } else {
             $this->realmId->EditValue = NULL;
         }
         $this->realmId->ViewCustomAttributes = "";
         // Edit refer script
         // accountId
         $this->accountId->HrefValue = "";
         // permissionId
         $this->permissionId->HrefValue = "";
         // granted
         $this->granted->HrefValue = "";
         // realmId
         $this->realmId->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #6
0
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     $this->AddUrl = $this->GetAddUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     $this->ListUrl = $this->GetListUrl();
     $this->SetupOtherOptions();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // scat_id
     // category_id
     // scat_name
     // scat_description
     // scat_picture
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // scat_id
         $this->scat_id->ViewValue = $this->scat_id->CurrentValue;
         $this->scat_id->ViewCustomAttributes = "";
         // category_id
         if (strval($this->category_id->CurrentValue) != "") {
             $sFilterWrk = "`category_id`" . ew_SearchString("=", $this->category_id->CurrentValue, EW_DATATYPE_NUMBER, "");
             $sSqlWrk = "SELECT `category_id`, `category_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `category`";
             $sWhereWrk = "";
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->category_id, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->category_id->ViewValue = $this->category_id->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->category_id->ViewValue = $this->category_id->CurrentValue;
             }
         } else {
             $this->category_id->ViewValue = NULL;
         }
         $this->category_id->ViewCustomAttributes = "";
         // scat_name
         $this->scat_name->ViewValue = $this->scat_name->CurrentValue;
         $this->scat_name->ViewCustomAttributes = "";
         // scat_description
         $this->scat_description->ViewValue = $this->scat_description->CurrentValue;
         $this->scat_description->ViewCustomAttributes = "";
         // scat_picture
         if (!ew_Empty($this->scat_picture->Upload->DbValue)) {
             $this->scat_picture->ViewValue = $this->scat_picture->Upload->DbValue;
         } else {
             $this->scat_picture->ViewValue = "";
         }
         $this->scat_picture->ViewCustomAttributes = "";
         // scat_id
         $this->scat_id->LinkCustomAttributes = "";
         $this->scat_id->HrefValue = "";
         $this->scat_id->TooltipValue = "";
         // category_id
         $this->category_id->LinkCustomAttributes = "";
         $this->category_id->HrefValue = "";
         $this->category_id->TooltipValue = "";
         // scat_name
         $this->scat_name->LinkCustomAttributes = "";
         $this->scat_name->HrefValue = "";
         $this->scat_name->TooltipValue = "";
         // scat_description
         $this->scat_description->LinkCustomAttributes = "";
         $this->scat_description->HrefValue = "";
         $this->scat_description->TooltipValue = "";
         // scat_picture
         $this->scat_picture->LinkCustomAttributes = "";
         $this->scat_picture->HrefValue = "";
         $this->scat_picture->HrefValue2 = $this->scat_picture->UploadPath . $this->scat_picture->Upload->DbValue;
         $this->scat_picture->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
                            ?>
</option>
<?php 
                        }
                    }
                    if (@$emptywrk) {
                        $gastos_mantenimientos->id_tipo_gasto->OldValue = "";
                    }
                    ?>
</select>
<?php 
                    $sSqlWrk = "SELECT `codigo`, `tipo_gasto` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipo_gastos`";
                    $sWhereWrk = "";
                    $lookuptblfilter = "`clase`='M'";
                    if (strval($lookuptblfilter) != "") {
                        ew_AddFilter($sWhereWrk, $lookuptblfilter);
                    }
                    // Call Lookup selecting
                    $gastos_mantenimientos->Lookup_Selecting($gastos_mantenimientos->id_tipo_gasto, $sWhereWrk);
                    if ($sWhereWrk != "") {
                        $sSqlWrk .= " WHERE " . $sWhereWrk;
                    }
                    $sSqlWrk .= " ORDER BY `tipo_gasto` ASC";
                    ?>
<input type="hidden" name="s_x<?php 
                    echo $gastos_mantenimientos_grid->RowIndex;
                    ?>
_id_tipo_gasto" id="s_x<?php 
                    echo $gastos_mantenimientos_grid->RowIndex;
                    ?>
_id_tipo_gasto" value="s=<?php 
Example #8
0
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     // Convert decimal values if posted back
     if ($this->iva->FormValue == $this->iva->CurrentValue && is_numeric(ew_StrToFloat($this->iva->CurrentValue))) {
         $this->iva->CurrentValue = ew_StrToFloat($this->iva->CurrentValue);
     }
     // Convert decimal values if posted back
     if ($this->Importe->FormValue == $this->Importe->CurrentValue && is_numeric(ew_StrToFloat($this->Importe->CurrentValue))) {
         $this->Importe->CurrentValue = ew_StrToFloat($this->Importe->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // codigo
     // fecha
     // detalles
     // iva
     // Importe
     // id_tipo_gasto
     // id_hoja_ruta
     $this->id_hoja_ruta->CellCssStyle = "white-space: nowrap;";
     // id_hoja_mantenimiento
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // codigo
         $this->codigo->ViewValue = $this->codigo->CurrentValue;
         $this->codigo->ViewCustomAttributes = "";
         // fecha
         $this->fecha->ViewValue = $this->fecha->CurrentValue;
         $this->fecha->ViewValue = ew_FormatDateTime($this->fecha->ViewValue, 7);
         $this->fecha->ViewCustomAttributes = "";
         // detalles
         $this->detalles->ViewValue = $this->detalles->CurrentValue;
         $this->detalles->ViewCustomAttributes = "";
         // iva
         $this->iva->ViewValue = $this->iva->CurrentValue;
         $this->iva->ViewCustomAttributes = "";
         // Importe
         $this->Importe->ViewValue = $this->Importe->CurrentValue;
         $this->Importe->ViewCustomAttributes = "";
         // id_tipo_gasto
         if ($this->id_tipo_gasto->VirtualValue != "") {
             $this->id_tipo_gasto->ViewValue = $this->id_tipo_gasto->VirtualValue;
         } else {
             $this->id_tipo_gasto->ViewValue = $this->id_tipo_gasto->CurrentValue;
             if (strval($this->id_tipo_gasto->CurrentValue) != "") {
                 $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_tipo_gasto->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `codigo`, `tipo_gasto` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipo_gastos`";
                 $sWhereWrk = "";
                 $lookuptblfilter = "`clase`='M'";
                 if (strval($lookuptblfilter) != "") {
                     ew_AddFilter($sWhereWrk, $lookuptblfilter);
                 }
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->id_tipo_gasto, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $sSqlWrk .= " ORDER BY `tipo_gasto` ASC";
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->id_tipo_gasto->ViewValue = $rswrk->fields('DispFld');
                     $rswrk->Close();
                 } else {
                     $this->id_tipo_gasto->ViewValue = $this->id_tipo_gasto->CurrentValue;
                 }
             } else {
                 $this->id_tipo_gasto->ViewValue = NULL;
             }
         }
         $this->id_tipo_gasto->ViewCustomAttributes = "";
         // id_hoja_mantenimiento
         $this->id_hoja_mantenimiento->ViewValue = $this->id_hoja_mantenimiento->CurrentValue;
         $this->id_hoja_mantenimiento->ViewCustomAttributes = "";
         // codigo
         $this->codigo->LinkCustomAttributes = "";
         $this->codigo->HrefValue = "";
         $this->codigo->TooltipValue = "";
         // fecha
         $this->fecha->LinkCustomAttributes = "";
         $this->fecha->HrefValue = "";
         $this->fecha->TooltipValue = "";
         // detalles
         $this->detalles->LinkCustomAttributes = "";
         $this->detalles->HrefValue = "";
         $this->detalles->TooltipValue = "";
         // iva
         $this->iva->LinkCustomAttributes = "";
         $this->iva->HrefValue = "";
         $this->iva->TooltipValue = "";
         // Importe
         $this->Importe->LinkCustomAttributes = "";
         $this->Importe->HrefValue = "";
         $this->Importe->TooltipValue = "";
         // id_tipo_gasto
         $this->id_tipo_gasto->LinkCustomAttributes = "";
         $this->id_tipo_gasto->HrefValue = "";
         $this->id_tipo_gasto->TooltipValue = "";
         // id_hoja_mantenimiento
         $this->id_hoja_mantenimiento->LinkCustomAttributes = "";
         $this->id_hoja_mantenimiento->HrefValue = "";
         $this->id_hoja_mantenimiento->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_ADD) {
         // Add row
         // codigo
         // fecha
         $this->fecha->EditAttrs["class"] = "form-control";
         $this->fecha->EditCustomAttributes = "";
         $this->fecha->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->fecha->CurrentValue, 7));
         $this->fecha->PlaceHolder = ew_RemoveHtml($this->fecha->FldCaption());
         // detalles
         $this->detalles->EditAttrs["class"] = "form-control";
         $this->detalles->EditCustomAttributes = "";
         $this->detalles->EditValue = ew_HtmlEncode($this->detalles->CurrentValue);
         $this->detalles->PlaceHolder = ew_RemoveHtml($this->detalles->FldCaption());
         // iva
         $this->iva->EditAttrs["class"] = "form-control";
         $this->iva->EditCustomAttributes = "";
         $this->iva->EditValue = ew_HtmlEncode($this->iva->CurrentValue);
         $this->iva->PlaceHolder = ew_RemoveHtml($this->iva->FldCaption());
         if (strval($this->iva->EditValue) != "" && is_numeric($this->iva->EditValue)) {
             $this->iva->EditValue = ew_FormatNumber($this->iva->EditValue, -2, -1, -2, 0);
             $this->iva->OldValue = $this->iva->EditValue;
         }
         // Importe
         $this->Importe->EditAttrs["class"] = "form-control";
         $this->Importe->EditCustomAttributes = "";
         $this->Importe->EditValue = ew_HtmlEncode($this->Importe->CurrentValue);
         $this->Importe->PlaceHolder = ew_RemoveHtml($this->Importe->FldCaption());
         if (strval($this->Importe->EditValue) != "" && is_numeric($this->Importe->EditValue)) {
             $this->Importe->EditValue = ew_FormatNumber($this->Importe->EditValue, -2, -1, -2, 0);
             $this->Importe->OldValue = $this->Importe->EditValue;
         }
         // id_tipo_gasto
         $this->id_tipo_gasto->EditAttrs["class"] = "form-control";
         $this->id_tipo_gasto->EditCustomAttributes = "";
         $this->id_tipo_gasto->EditValue = ew_HtmlEncode($this->id_tipo_gasto->CurrentValue);
         if (strval($this->id_tipo_gasto->CurrentValue) != "") {
             $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_tipo_gasto->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `codigo`, `tipo_gasto` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipo_gastos`";
             $sWhereWrk = "";
             $lookuptblfilter = "`clase`='M'";
             if (strval($lookuptblfilter) != "") {
                 ew_AddFilter($sWhereWrk, $lookuptblfilter);
             }
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_tipo_gasto, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $sSqlWrk .= " ORDER BY `tipo_gasto` ASC";
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->id_tipo_gasto->EditValue = ew_HtmlEncode($rswrk->fields('DispFld'));
                 $rswrk->Close();
             } else {
                 $this->id_tipo_gasto->EditValue = ew_HtmlEncode($this->id_tipo_gasto->CurrentValue);
             }
         } else {
             $this->id_tipo_gasto->EditValue = NULL;
         }
         $this->id_tipo_gasto->PlaceHolder = ew_RemoveHtml($this->id_tipo_gasto->FldCaption());
         // id_hoja_mantenimiento
         $this->id_hoja_mantenimiento->EditAttrs["class"] = "form-control";
         $this->id_hoja_mantenimiento->EditCustomAttributes = "";
         if ($this->id_hoja_mantenimiento->getSessionValue() != "") {
             $this->id_hoja_mantenimiento->CurrentValue = $this->id_hoja_mantenimiento->getSessionValue();
             $this->id_hoja_mantenimiento->OldValue = $this->id_hoja_mantenimiento->CurrentValue;
             $this->id_hoja_mantenimiento->ViewValue = $this->id_hoja_mantenimiento->CurrentValue;
             $this->id_hoja_mantenimiento->ViewCustomAttributes = "";
         } else {
             $this->id_hoja_mantenimiento->EditValue = ew_HtmlEncode($this->id_hoja_mantenimiento->CurrentValue);
             $this->id_hoja_mantenimiento->PlaceHolder = ew_RemoveHtml($this->id_hoja_mantenimiento->FldCaption());
         }
         // Edit refer script
         // codigo
         $this->codigo->HrefValue = "";
         // fecha
         $this->fecha->HrefValue = "";
         // detalles
         $this->detalles->HrefValue = "";
         // iva
         $this->iva->HrefValue = "";
         // Importe
         $this->Importe->HrefValue = "";
         // id_tipo_gasto
         $this->id_tipo_gasto->HrefValue = "";
         // id_hoja_mantenimiento
         $this->id_hoja_mantenimiento->HrefValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // codigo
         $this->codigo->EditAttrs["class"] = "form-control";
         $this->codigo->EditCustomAttributes = "";
         $this->codigo->EditValue = $this->codigo->CurrentValue;
         $this->codigo->ViewCustomAttributes = "";
         // fecha
         $this->fecha->EditAttrs["class"] = "form-control";
         $this->fecha->EditCustomAttributes = "";
         $this->fecha->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->fecha->CurrentValue, 7));
         $this->fecha->PlaceHolder = ew_RemoveHtml($this->fecha->FldCaption());
         // detalles
         $this->detalles->EditAttrs["class"] = "form-control";
         $this->detalles->EditCustomAttributes = "";
         $this->detalles->EditValue = ew_HtmlEncode($this->detalles->CurrentValue);
         $this->detalles->PlaceHolder = ew_RemoveHtml($this->detalles->FldCaption());
         // iva
         $this->iva->EditAttrs["class"] = "form-control";
         $this->iva->EditCustomAttributes = "";
         $this->iva->EditValue = ew_HtmlEncode($this->iva->CurrentValue);
         $this->iva->PlaceHolder = ew_RemoveHtml($this->iva->FldCaption());
         if (strval($this->iva->EditValue) != "" && is_numeric($this->iva->EditValue)) {
             $this->iva->EditValue = ew_FormatNumber($this->iva->EditValue, -2, -1, -2, 0);
             $this->iva->OldValue = $this->iva->EditValue;
         }
         // Importe
         $this->Importe->EditAttrs["class"] = "form-control";
         $this->Importe->EditCustomAttributes = "";
         $this->Importe->EditValue = ew_HtmlEncode($this->Importe->CurrentValue);
         $this->Importe->PlaceHolder = ew_RemoveHtml($this->Importe->FldCaption());
         if (strval($this->Importe->EditValue) != "" && is_numeric($this->Importe->EditValue)) {
             $this->Importe->EditValue = ew_FormatNumber($this->Importe->EditValue, -2, -1, -2, 0);
             $this->Importe->OldValue = $this->Importe->EditValue;
         }
         // id_tipo_gasto
         $this->id_tipo_gasto->EditAttrs["class"] = "form-control";
         $this->id_tipo_gasto->EditCustomAttributes = "";
         $this->id_tipo_gasto->EditValue = ew_HtmlEncode($this->id_tipo_gasto->CurrentValue);
         if (strval($this->id_tipo_gasto->CurrentValue) != "") {
             $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_tipo_gasto->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `codigo`, `tipo_gasto` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tipo_gastos`";
             $sWhereWrk = "";
             $lookuptblfilter = "`clase`='M'";
             if (strval($lookuptblfilter) != "") {
                 ew_AddFilter($sWhereWrk, $lookuptblfilter);
             }
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_tipo_gasto, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $sSqlWrk .= " ORDER BY `tipo_gasto` ASC";
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->id_tipo_gasto->EditValue = ew_HtmlEncode($rswrk->fields('DispFld'));
                 $rswrk->Close();
             } else {
                 $this->id_tipo_gasto->EditValue = ew_HtmlEncode($this->id_tipo_gasto->CurrentValue);
             }
         } else {
             $this->id_tipo_gasto->EditValue = NULL;
         }
         $this->id_tipo_gasto->PlaceHolder = ew_RemoveHtml($this->id_tipo_gasto->FldCaption());
         // id_hoja_mantenimiento
         $this->id_hoja_mantenimiento->EditAttrs["class"] = "form-control";
         $this->id_hoja_mantenimiento->EditCustomAttributes = "";
         if ($this->id_hoja_mantenimiento->getSessionValue() != "") {
             $this->id_hoja_mantenimiento->CurrentValue = $this->id_hoja_mantenimiento->getSessionValue();
             $this->id_hoja_mantenimiento->OldValue = $this->id_hoja_mantenimiento->CurrentValue;
             $this->id_hoja_mantenimiento->ViewValue = $this->id_hoja_mantenimiento->CurrentValue;
             $this->id_hoja_mantenimiento->ViewCustomAttributes = "";
         } else {
             $this->id_hoja_mantenimiento->EditValue = ew_HtmlEncode($this->id_hoja_mantenimiento->CurrentValue);
             $this->id_hoja_mantenimiento->PlaceHolder = ew_RemoveHtml($this->id_hoja_mantenimiento->FldCaption());
         }
         // Edit refer script
         // codigo
         $this->codigo->HrefValue = "";
         // fecha
         $this->fecha->HrefValue = "";
         // detalles
         $this->detalles->HrefValue = "";
         // iva
         $this->iva->HrefValue = "";
         // Importe
         $this->Importe->HrefValue = "";
         // id_tipo_gasto
         $this->id_tipo_gasto->HrefValue = "";
         // id_hoja_mantenimiento
         $this->id_hoja_mantenimiento->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function DeleteSQL(&$rs, $where = "", $curfilter = TRUE)
 {
     $sql = "DELETE FROM " . $this->UpdateTable . " WHERE ";
     if (is_array($where)) {
         $where = $this->ArrayToFilter($where);
     }
     if ($rs) {
         if (array_key_exists('CARD_TYPE_ID', $rs)) {
             ew_AddFilter($where, ew_QuotedName('CARD_TYPE_ID', $this->DBID) . '=' . ew_QuotedValue($rs['CARD_TYPE_ID'], $this->CARD_TYPE_ID->FldDataType, $this->DBID));
         }
     }
     $filter = $curfilter ? $this->CurrentFilter : "";
     ew_AddFilter($filter, $where);
     if ($filter != "") {
         $sql .= $filter;
     } else {
         $sql .= "0=1";
     }
     // Avoid delete
     return $sql;
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->AddUrl = $this->GetAddUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     $this->ListUrl = $this->GetListUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // realmid
     // acctid
     // numchars
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // realmid
         if (strval($this->realmid->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->realmid->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `realmlist`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->realmid->ViewValue = $rswrk->fields('DispFld');
                 $this->realmid->ViewValue .= ew_ValueSeparator(1, $this->realmid) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->realmid->ViewValue = $this->realmid->CurrentValue;
             }
         } else {
             $this->realmid->ViewValue = NULL;
         }
         $this->realmid->ViewCustomAttributes = "";
         // acctid
         if (strval($this->acctid->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->acctid->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `username` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `account`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->acctid->ViewValue = $rswrk->fields('DispFld');
                 $this->acctid->ViewValue .= ew_ValueSeparator(1, $this->acctid) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->acctid->ViewValue = $this->acctid->CurrentValue;
             }
         } else {
             $this->acctid->ViewValue = NULL;
         }
         $this->acctid->ViewCustomAttributes = "";
         // numchars
         $this->numchars->ViewValue = $this->numchars->CurrentValue;
         $this->numchars->ViewCustomAttributes = "";
         // realmid
         $this->realmid->LinkCustomAttributes = "";
         $this->realmid->HrefValue = "";
         $this->realmid->TooltipValue = "";
         // acctid
         $this->acctid->LinkCustomAttributes = "";
         $this->acctid->HrefValue = "";
         $this->acctid->TooltipValue = "";
         // numchars
         $this->numchars->LinkCustomAttributes = "";
         $this->numchars->HrefValue = "";
         $this->numchars->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // EvaluateAnswerID
     // EvAnswer
     // lastModified
     // Date
     // ID
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // EvaluateAnswerID
         $this->EvaluateAnswerID->ViewValue = $this->EvaluateAnswerID->CurrentValue;
         $this->EvaluateAnswerID->ViewCustomAttributes = "";
         // lastModified
         $this->lastModified->ViewValue = $this->lastModified->CurrentValue;
         $this->lastModified->ViewValue = ew_FormatDateTime($this->lastModified->ViewValue, 5);
         $this->lastModified->ViewCustomAttributes = "";
         // Date
         $this->Date->ViewValue = $this->Date->CurrentValue;
         $this->Date->ViewValue = ew_FormatDateTime($this->Date->ViewValue, 5);
         $this->Date->ViewCustomAttributes = "";
         // ID
         if (strval($this->ID->CurrentValue) != "") {
             $sFilterWrk = "`ID`" . ew_SearchString("=", $this->ID->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `ID`, `Email` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `Users`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->ID, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->ID->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->ID->ViewValue = $this->ID->CurrentValue;
             }
         } else {
             $this->ID->ViewValue = NULL;
         }
         $this->ID->ViewCustomAttributes = "";
         // EvaluateAnswerID
         $this->EvaluateAnswerID->LinkCustomAttributes = "";
         $this->EvaluateAnswerID->HrefValue = "";
         $this->EvaluateAnswerID->TooltipValue = "";
         // lastModified
         $this->lastModified->LinkCustomAttributes = "";
         $this->lastModified->HrefValue = "";
         $this->lastModified->TooltipValue = "";
         // Date
         $this->Date->LinkCustomAttributes = "";
         $this->Date->HrefValue = "";
         $this->Date->TooltipValue = "";
         // ID
         $this->ID->LinkCustomAttributes = "";
         $this->ID->HrefValue = "";
         $this->ID->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #12
0
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     // Convert decimal values if posted back
     if ($this->monto->FormValue == $this->monto->CurrentValue && is_numeric(ew_StrToFloat($this->monto->CurrentValue))) {
         $this->monto->CurrentValue = ew_StrToFloat($this->monto->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // id
     // mes
     // anio
     // fecha
     // monto
     // id_usuario
     // id_socio
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // id
         $this->id->ViewCustomAttributes = "";
         // mes
         $this->mes->ViewValue = $this->mes->CurrentValue;
         $this->mes->ViewCustomAttributes = "";
         // anio
         $this->anio->ViewValue = $this->anio->CurrentValue;
         $this->anio->ViewCustomAttributes = "";
         // fecha
         $this->fecha->ViewValue = $this->fecha->CurrentValue;
         $this->fecha->ViewValue = ew_FormatDateTime($this->fecha->ViewValue, 7);
         $this->fecha->ViewCustomAttributes = "";
         // monto
         $this->monto->ViewValue = $this->monto->CurrentValue;
         $this->monto->ViewValue = ew_FormatCurrency($this->monto->ViewValue, 0, -2, -2, -2);
         $this->monto->ViewCustomAttributes = "";
         // id_socio
         if (strval($this->id_socio->CurrentValue) != "") {
             $sFilterWrk = "`socio_nro`" . ew_SearchString("=", $this->id_socio->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `socio_nro`, `propietario` AS `DispFld`, `comercio` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `socios`";
             $sWhereWrk = "";
             $lookuptblfilter = "`activo`='S'";
             if (strval($lookuptblfilter) != "") {
                 ew_AddFilter($sWhereWrk, $lookuptblfilter);
             }
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_socio, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $sSqlWrk .= " ORDER BY `propietario` DESC";
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->id_socio->ViewValue = $rswrk->fields('DispFld');
                 $this->id_socio->ViewValue .= ew_ValueSeparator(1, $this->id_socio) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->id_socio->ViewValue = $this->id_socio->CurrentValue;
             }
         } else {
             $this->id_socio->ViewValue = NULL;
         }
         $this->id_socio->ViewCustomAttributes = "";
         // mes
         $this->mes->LinkCustomAttributes = "";
         $this->mes->HrefValue = "";
         $this->mes->TooltipValue = "";
         // anio
         $this->anio->LinkCustomAttributes = "";
         $this->anio->HrefValue = "";
         $this->anio->TooltipValue = "";
         // fecha
         $this->fecha->LinkCustomAttributes = "";
         $this->fecha->HrefValue = "";
         $this->fecha->TooltipValue = "";
         // monto
         $this->monto->LinkCustomAttributes = "";
         $this->monto->HrefValue = "";
         $this->monto->TooltipValue = "";
         // id_socio
         $this->id_socio->LinkCustomAttributes = "";
         $this->id_socio->HrefValue = "";
         $this->id_socio->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_ADD) {
         // Add row
         // mes
         $this->mes->EditAttrs["class"] = "form-control";
         $this->mes->EditCustomAttributes = "";
         $this->mes->EditValue = ew_HtmlEncode($this->mes->CurrentValue);
         $this->mes->PlaceHolder = ew_RemoveHtml($this->mes->FldCaption());
         // anio
         $this->anio->EditAttrs["class"] = "form-control";
         $this->anio->EditCustomAttributes = "";
         $this->anio->EditValue = ew_HtmlEncode($this->anio->CurrentValue);
         $this->anio->PlaceHolder = ew_RemoveHtml($this->anio->FldCaption());
         // fecha
         $this->fecha->EditAttrs["class"] = "form-control";
         $this->fecha->EditCustomAttributes = "";
         $this->fecha->EditValue = ew_HtmlEncode(ew_FormatDateTime($this->fecha->CurrentValue, 7));
         $this->fecha->PlaceHolder = ew_RemoveHtml($this->fecha->FldCaption());
         // monto
         $this->monto->EditAttrs["class"] = "form-control";
         $this->monto->EditCustomAttributes = "";
         $this->monto->EditValue = ew_HtmlEncode($this->monto->CurrentValue);
         $this->monto->PlaceHolder = ew_RemoveHtml($this->monto->FldCaption());
         if (strval($this->monto->EditValue) != "" && is_numeric($this->monto->EditValue)) {
             $this->monto->EditValue = ew_FormatNumber($this->monto->EditValue, -2, -2, -2, -2);
         }
         // id_socio
         $this->id_socio->EditAttrs["class"] = "form-control";
         $this->id_socio->EditCustomAttributes = "";
         if ($this->id_socio->getSessionValue() != "") {
             $this->id_socio->CurrentValue = $this->id_socio->getSessionValue();
             if (strval($this->id_socio->CurrentValue) != "") {
                 $sFilterWrk = "`socio_nro`" . ew_SearchString("=", $this->id_socio->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `socio_nro`, `propietario` AS `DispFld`, `comercio` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `socios`";
                 $sWhereWrk = "";
                 $lookuptblfilter = "`activo`='S'";
                 if (strval($lookuptblfilter) != "") {
                     ew_AddFilter($sWhereWrk, $lookuptblfilter);
                 }
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->id_socio, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $sSqlWrk .= " ORDER BY `propietario` DESC";
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->id_socio->ViewValue = $rswrk->fields('DispFld');
                     $this->id_socio->ViewValue .= ew_ValueSeparator(1, $this->id_socio) . $rswrk->fields('Disp2Fld');
                     $rswrk->Close();
                 } else {
                     $this->id_socio->ViewValue = $this->id_socio->CurrentValue;
                 }
             } else {
                 $this->id_socio->ViewValue = NULL;
             }
             $this->id_socio->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->id_socio->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`socio_nro`" . ew_SearchString("=", $this->id_socio->CurrentValue, EW_DATATYPE_NUMBER);
             }
             $sSqlWrk = "SELECT `socio_nro`, `propietario` AS `DispFld`, `comercio` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `socios`";
             $sWhereWrk = "";
             $lookuptblfilter = "`activo`='S'";
             if (strval($lookuptblfilter) != "") {
                 ew_AddFilter($sWhereWrk, $lookuptblfilter);
             }
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if (!$GLOBALS["deudas"]->UserIDAllow("add")) {
                 $sWhereWrk = $GLOBALS["socios"]->AddUserIDFilter($sWhereWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_socio, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $sSqlWrk .= " ORDER BY `propietario` DESC";
             $rswrk = $conn->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->id_socio->EditValue = $arwrk;
         }
         // Edit refer script
         // mes
         $this->mes->HrefValue = "";
         // anio
         $this->anio->HrefValue = "";
         // fecha
         $this->fecha->HrefValue = "";
         // monto
         $this->monto->HrefValue = "";
         // id_socio
         $this->id_socio->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // id_tramite
     // fecha
     // hora
     // titulo
     // descripcion
     // id_usuario
     $this->id_usuario->CellCssStyle = "white-space: nowrap;";
     // archivo
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // id_tramite
         if ($this->id_tramite->VirtualValue != "") {
             $this->id_tramite->ViewValue = $this->id_tramite->VirtualValue;
         } else {
             if (strval($this->id_tramite->CurrentValue) != "") {
                 $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_tramite->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `codigo`, `codigo` AS `DispFld`, `fecha` AS `Disp2Fld`, `Titulo` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tramites`";
                 $sWhereWrk = "";
                 $lookuptblfilter = "`estado`<>'F'";
                 if (strval($lookuptblfilter) != "") {
                     ew_AddFilter($sWhereWrk, $lookuptblfilter);
                 }
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->id_tramite, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $sSqlWrk .= " ORDER BY `fecha` ASC";
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->id_tramite->ViewValue = $rswrk->fields('DispFld');
                     $this->id_tramite->ViewValue .= ew_ValueSeparator(1, $this->id_tramite) . ew_FormatDateTime($rswrk->fields('Disp2Fld'), 7);
                     $this->id_tramite->ViewValue .= ew_ValueSeparator(2, $this->id_tramite) . $rswrk->fields('Disp3Fld');
                     $rswrk->Close();
                 } else {
                     $this->id_tramite->ViewValue = $this->id_tramite->CurrentValue;
                 }
             } else {
                 $this->id_tramite->ViewValue = NULL;
             }
         }
         $this->id_tramite->ViewCustomAttributes = "";
         // fecha
         $this->fecha->ViewValue = $this->fecha->CurrentValue;
         $this->fecha->ViewValue = ew_FormatDateTime($this->fecha->ViewValue, 7);
         $this->fecha->ViewCustomAttributes = "";
         // hora
         $this->hora->ViewValue = $this->hora->CurrentValue;
         $this->hora->ViewCustomAttributes = "";
         // titulo
         $this->titulo->ViewValue = $this->titulo->CurrentValue;
         $this->titulo->ViewCustomAttributes = "";
         // archivo
         if (!ew_Empty($this->archivo->Upload->DbValue)) {
             $this->archivo->ViewValue = $this->archivo->Upload->DbValue;
         } else {
             $this->archivo->ViewValue = "";
         }
         $this->archivo->ViewCustomAttributes = "";
         // id_tramite
         $this->id_tramite->LinkCustomAttributes = "";
         $this->id_tramite->HrefValue = "";
         $this->id_tramite->TooltipValue = "";
         // fecha
         $this->fecha->LinkCustomAttributes = "";
         $this->fecha->HrefValue = "";
         $this->fecha->TooltipValue = "";
         // hora
         $this->hora->LinkCustomAttributes = "";
         $this->hora->HrefValue = "";
         $this->hora->TooltipValue = "";
         // titulo
         $this->titulo->LinkCustomAttributes = "";
         $this->titulo->HrefValue = "";
         $this->titulo->TooltipValue = "";
         // archivo
         $this->archivo->LinkCustomAttributes = "";
         $this->archivo->HrefValue = "";
         $this->archivo->HrefValue2 = $this->archivo->UploadPath . $this->archivo->Upload->DbValue;
         $this->archivo->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_ADD) {
         // Add row
         // id_tramite
         $this->id_tramite->EditAttrs["class"] = "form-control";
         $this->id_tramite->EditCustomAttributes = "";
         if ($this->id_tramite->getSessionValue() != "") {
             $this->id_tramite->CurrentValue = $this->id_tramite->getSessionValue();
             $this->id_tramite->OldValue = $this->id_tramite->CurrentValue;
             if ($this->id_tramite->VirtualValue != "") {
                 $this->id_tramite->ViewValue = $this->id_tramite->VirtualValue;
             } else {
                 if (strval($this->id_tramite->CurrentValue) != "") {
                     $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_tramite->CurrentValue, EW_DATATYPE_NUMBER);
                     $sSqlWrk = "SELECT `codigo`, `codigo` AS `DispFld`, `fecha` AS `Disp2Fld`, `Titulo` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tramites`";
                     $sWhereWrk = "";
                     $lookuptblfilter = "`estado`<>'F'";
                     if (strval($lookuptblfilter) != "") {
                         ew_AddFilter($sWhereWrk, $lookuptblfilter);
                     }
                     if ($sFilterWrk != "") {
                         ew_AddFilter($sWhereWrk, $sFilterWrk);
                     }
                     // Call Lookup selecting
                     $this->Lookup_Selecting($this->id_tramite, $sWhereWrk);
                     if ($sWhereWrk != "") {
                         $sSqlWrk .= " WHERE " . $sWhereWrk;
                     }
                     $sSqlWrk .= " ORDER BY `fecha` ASC";
                     $rswrk = $conn->Execute($sSqlWrk);
                     if ($rswrk && !$rswrk->EOF) {
                         // Lookup values found
                         $this->id_tramite->ViewValue = $rswrk->fields('DispFld');
                         $this->id_tramite->ViewValue .= ew_ValueSeparator(1, $this->id_tramite) . ew_FormatDateTime($rswrk->fields('Disp2Fld'), 7);
                         $this->id_tramite->ViewValue .= ew_ValueSeparator(2, $this->id_tramite) . $rswrk->fields('Disp3Fld');
                         $rswrk->Close();
                     } else {
                         $this->id_tramite->ViewValue = $this->id_tramite->CurrentValue;
                     }
                 } else {
                     $this->id_tramite->ViewValue = NULL;
                 }
             }
             $this->id_tramite->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->id_tramite->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_tramite->CurrentValue, EW_DATATYPE_NUMBER);
             }
             $sSqlWrk = "SELECT `codigo`, `codigo` AS `DispFld`, `fecha` AS `Disp2Fld`, `Titulo` AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `tramites`";
             $sWhereWrk = "";
             $lookuptblfilter = "`estado`<>'F'";
             if (strval($lookuptblfilter) != "") {
                 ew_AddFilter($sWhereWrk, $lookuptblfilter);
             }
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_tramite, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $sSqlWrk .= " ORDER BY `fecha` ASC";
             $rswrk = $conn->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             $rowswrk = count($arwrk);
             for ($rowcntwrk = 0; $rowcntwrk < $rowswrk; $rowcntwrk++) {
                 $arwrk[$rowcntwrk][2] = ew_FormatDateTime($arwrk[$rowcntwrk][2], 7);
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->id_tramite->EditValue = $arwrk;
         }
         // fecha
         // hora
         // titulo
         $this->titulo->EditAttrs["class"] = "form-control";
         $this->titulo->EditCustomAttributes = "";
         $this->titulo->EditValue = ew_HtmlEncode($this->titulo->CurrentValue);
         $this->titulo->PlaceHolder = ew_RemoveHtml($this->titulo->FldCaption());
         // archivo
         $this->archivo->EditAttrs["class"] = "form-control";
         $this->archivo->EditCustomAttributes = "";
         if (!ew_Empty($this->archivo->Upload->DbValue)) {
             $this->archivo->EditValue = $this->archivo->Upload->DbValue;
         } else {
             $this->archivo->EditValue = "";
         }
         if (!ew_Empty($this->archivo->CurrentValue)) {
             $this->archivo->Upload->FileName = $this->archivo->CurrentValue;
         }
         if (is_numeric($this->RowIndex) && !$this->EventCancelled) {
             ew_RenderUploadField($this->archivo, $this->RowIndex);
         }
         // Edit refer script
         // id_tramite
         $this->id_tramite->HrefValue = "";
         // fecha
         $this->fecha->HrefValue = "";
         // hora
         $this->hora->HrefValue = "";
         // titulo
         $this->titulo->HrefValue = "";
         // archivo
         $this->archivo->HrefValue = "";
         $this->archivo->HrefValue2 = $this->archivo->UploadPath . $this->archivo->Upload->DbValue;
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // id_tramite
         $this->id_tramite->EditAttrs["class"] = "form-control";
         $this->id_tramite->EditCustomAttributes = "";
         if ($this->id_tramite->VirtualValue != "") {
             $this->id_tramite->ViewValue = $this->id_tramite->VirtualValue;
         } else {
             if (strval($this->id_tramite->CurrentValue) != "") {
                 $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_tramite->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `codigo`, `codigo` AS `DispFld`, `fecha` AS `Disp2Fld`, `Titulo` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tramites`";
                 $sWhereWrk = "";
                 $lookuptblfilter = "`estado`<>'F'";
                 if (strval($lookuptblfilter) != "") {
                     ew_AddFilter($sWhereWrk, $lookuptblfilter);
                 }
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->id_tramite, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $sSqlWrk .= " ORDER BY `fecha` ASC";
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->id_tramite->EditValue = $rswrk->fields('DispFld');
                     $this->id_tramite->EditValue .= ew_ValueSeparator(1, $this->id_tramite) . ew_FormatDateTime($rswrk->fields('Disp2Fld'), 7);
                     $this->id_tramite->EditValue .= ew_ValueSeparator(2, $this->id_tramite) . $rswrk->fields('Disp3Fld');
                     $rswrk->Close();
                 } else {
                     $this->id_tramite->EditValue = $this->id_tramite->CurrentValue;
                 }
             } else {
                 $this->id_tramite->EditValue = NULL;
             }
         }
         $this->id_tramite->ViewCustomAttributes = "";
         // fecha
         // hora
         // titulo
         $this->titulo->EditAttrs["class"] = "form-control";
         $this->titulo->EditCustomAttributes = "";
         $this->titulo->EditValue = $this->titulo->CurrentValue;
         $this->titulo->ViewCustomAttributes = "";
         // archivo
         $this->archivo->EditAttrs["class"] = "form-control";
         $this->archivo->EditCustomAttributes = "";
         if (!ew_Empty($this->archivo->Upload->DbValue)) {
             $this->archivo->EditValue = $this->archivo->Upload->DbValue;
         } else {
             $this->archivo->EditValue = "";
         }
         $this->archivo->ViewCustomAttributes = "";
         // Edit refer script
         // id_tramite
         $this->id_tramite->HrefValue = "";
         // fecha
         $this->fecha->HrefValue = "";
         // hora
         $this->hora->HrefValue = "";
         // titulo
         $this->titulo->HrefValue = "";
         // archivo
         $this->archivo->HrefValue = "";
         $this->archivo->HrefValue2 = $this->archivo->UploadPath . $this->archivo->Upload->DbValue;
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #14
0
 function AddUserIDFilter($sFilter)
 {
     global $Security;
     $sFilterWrk = "";
     $id = CurrentPageID() == "list" ? $this->CurrentAction : CurrentPageID();
     if (!$this->UserIDAllow($id) && !$Security->IsAdmin()) {
         $sFilterWrk = $Security->UserIDList();
         if ($sFilterWrk != "") {
             $sFilterWrk = '`client_id` IN (' . $sFilterWrk . ')';
         }
     }
     // Call User ID Filtering event
     $this->UserID_Filtering($sFilterWrk);
     ew_AddFilter($sFilter, $sFilterWrk);
     return $sFilter;
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // idmedicina
     // descripcion
     // estado
     // idlaboratorio
     // idhospital
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // idmedicina
         $this->idmedicina->ViewValue = $this->idmedicina->CurrentValue;
         $this->idmedicina->ViewCustomAttributes = "";
         // descripcion
         $this->descripcion->ViewValue = $this->descripcion->CurrentValue;
         $this->descripcion->ViewCustomAttributes = "";
         // estado
         if (strval($this->estado->CurrentValue) != "") {
             switch ($this->estado->CurrentValue) {
                 case $this->estado->FldTagValue(1):
                     $this->estado->ViewValue = $this->estado->FldTagCaption(1) != "" ? $this->estado->FldTagCaption(1) : $this->estado->CurrentValue;
                     break;
                 case $this->estado->FldTagValue(2):
                     $this->estado->ViewValue = $this->estado->FldTagCaption(2) != "" ? $this->estado->FldTagCaption(2) : $this->estado->CurrentValue;
                     break;
                 default:
                     $this->estado->ViewValue = $this->estado->CurrentValue;
             }
         } else {
             $this->estado->ViewValue = NULL;
         }
         $this->estado->ViewCustomAttributes = "";
         // idlaboratorio
         if (strval($this->idlaboratorio->CurrentValue) != "") {
             $sFilterWrk = "`idlaboratorio`" . ew_SearchString("=", $this->idlaboratorio->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `idlaboratorio`, `descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `laboratorio`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->idlaboratorio, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->idlaboratorio->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->idlaboratorio->ViewValue = $this->idlaboratorio->CurrentValue;
             }
         } else {
             $this->idlaboratorio->ViewValue = NULL;
         }
         $this->idlaboratorio->ViewCustomAttributes = "";
         // idhospital
         $this->idhospital->ViewValue = $this->idhospital->CurrentValue;
         $this->idhospital->ViewCustomAttributes = "";
         // idmedicina
         $this->idmedicina->LinkCustomAttributes = "";
         $this->idmedicina->HrefValue = "";
         $this->idmedicina->TooltipValue = "";
         // descripcion
         $this->descripcion->LinkCustomAttributes = "";
         $this->descripcion->HrefValue = "";
         $this->descripcion->TooltipValue = "";
         // estado
         $this->estado->LinkCustomAttributes = "";
         $this->estado->HrefValue = "";
         $this->estado->TooltipValue = "";
         // idlaboratorio
         $this->idlaboratorio->LinkCustomAttributes = "";
         $this->idlaboratorio->HrefValue = "";
         $this->idlaboratorio->TooltipValue = "";
         // idhospital
         $this->idhospital->LinkCustomAttributes = "";
         $this->idhospital->HrefValue = "";
         $this->idhospital->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_SEARCH) {
         // Search row
         // idmedicina
         $this->idmedicina->EditAttrs["class"] = "form-control";
         $this->idmedicina->EditCustomAttributes = "";
         $this->idmedicina->EditValue = ew_HtmlEncode($this->idmedicina->AdvancedSearch->SearchValue);
         $this->idmedicina->PlaceHolder = ew_RemoveHtml($this->idmedicina->FldCaption());
         // descripcion
         $this->descripcion->EditAttrs["class"] = "form-control";
         $this->descripcion->EditCustomAttributes = "";
         $this->descripcion->EditValue = ew_HtmlEncode($this->descripcion->AdvancedSearch->SearchValue);
         $this->descripcion->PlaceHolder = ew_RemoveHtml($this->descripcion->FldCaption());
         // estado
         $this->estado->EditAttrs["class"] = "form-control";
         $this->estado->EditCustomAttributes = "";
         $arwrk = array();
         $arwrk[] = array($this->estado->FldTagValue(1), $this->estado->FldTagCaption(1) != "" ? $this->estado->FldTagCaption(1) : $this->estado->FldTagValue(1));
         $arwrk[] = array($this->estado->FldTagValue(2), $this->estado->FldTagCaption(2) != "" ? $this->estado->FldTagCaption(2) : $this->estado->FldTagValue(2));
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect")));
         $this->estado->EditValue = $arwrk;
         // idlaboratorio
         $this->idlaboratorio->EditAttrs["class"] = "form-control";
         $this->idlaboratorio->EditCustomAttributes = "";
         // idhospital
         $this->idhospital->EditAttrs["class"] = "form-control";
         $this->idhospital->EditCustomAttributes = "";
         $this->idhospital->EditValue = ew_HtmlEncode($this->idhospital->AdvancedSearch->SearchValue);
         $this->idhospital->PlaceHolder = ew_RemoveHtml($this->idhospital->FldCaption());
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function Page_Main()
 {
     global $objForm, $Language, $gsFormError, $gsSearchError, $Security, $t_promotions_vins;
     // Search filters
     $sSrchAdvanced = "";
     // Advanced search filter
     $sSrchBasic = "";
     // Basic search filter
     $sFilter = "";
     if ($this->IsPageRequest()) {
         // Validate request
         // Handle reset command
         $this->ResetCmd();
         // Hide all options
         if ($t_promotions_vins->Export != "" || $t_promotions_vins->CurrentAction == "gridadd" || $t_promotions_vins->CurrentAction == "gridedit") {
             $this->ListOptions->HideAllOptions();
             $this->ExportOptions->HideAllOptions();
         }
         // Set up sorting order
         $this->SetUpSortOrder();
     }
     // Restore display records
     if ($t_promotions_vins->getRecordsPerPage() != "") {
         $this->DisplayRecs = $t_promotions_vins->getRecordsPerPage();
         // Restore from Session
     } else {
         $this->DisplayRecs = 25;
         // Load default
     }
     // Load Sorting Order
     $this->LoadSortOrder();
     // Build filter
     $sFilter = "";
     ew_AddFilter($sFilter, $this->DbDetailFilter);
     ew_AddFilter($sFilter, $this->SearchWhere);
     // Set up filter in session
     $t_promotions_vins->setSessionWhere($sFilter);
     $t_promotions_vins->CurrentFilter = "";
     // Export data only
     if (in_array($t_promotions_vins->Export, array("html", "word", "excel", "xml", "csv", "email", "pdf"))) {
         $this->ExportData();
         if ($t_promotions_vins->Export != "email") {
             $this->Page_Terminate();
         }
         // Terminate response
         exit;
     }
 }
 function RenderListRow()
 {
     global $conn, $Security;
     // Call Row Rendering event
     $this->Row_Rendering();
     // Common render codes
     // subject_type_id
     // subject_group_type
     // active
     // detail
     // subject_group
     // subject_dept
     // subject_faculty
     // subject_type_id
     $this->subject_type_id->ViewValue = $this->subject_type_id->CurrentValue;
     $this->subject_type_id->ViewCustomAttributes = "";
     // subject_group_type
     $this->subject_group_type->ViewValue = $this->subject_group_type->CurrentValue;
     $this->subject_group_type->ViewCustomAttributes = "";
     // active
     $this->active->ViewValue = $this->active->CurrentValue;
     $this->active->ViewCustomAttributes = "";
     // detail
     $this->detail->ViewValue = $this->detail->CurrentValue;
     $this->detail->ViewCustomAttributes = "";
     // subject_group
     if (strval($this->subject_group->CurrentValue) != "") {
         $sFilterWrk = "`id`" . ew_SearchString("=", $this->subject_group->CurrentValue, EW_DATATYPE_NUMBER);
         $sSqlWrk = "SELECT `id`, `subject_group_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tbl_subject_group`";
         $sWhereWrk = "";
         if ($sFilterWrk != "") {
             ew_AddFilter($sWhereWrk, $sFilterWrk);
         }
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = $conn->Execute($sSqlWrk);
         if ($rswrk && !$rswrk->EOF) {
             // Lookup values found
             $this->subject_group->ViewValue = $rswrk->fields('DispFld');
             $rswrk->Close();
         } else {
             $this->subject_group->ViewValue = $this->subject_group->CurrentValue;
         }
     } else {
         $this->subject_group->ViewValue = NULL;
     }
     $this->subject_group->ViewCustomAttributes = "";
     // subject_dept
     if (strval($this->subject_dept->CurrentValue) != "") {
         $sFilterWrk = "`dept_id`" . ew_SearchString("=", $this->subject_dept->CurrentValue, EW_DATATYPE_NUMBER);
         $sSqlWrk = "SELECT `dept_id`, `dept_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tbl_dept`";
         $sWhereWrk = "";
         if ($sFilterWrk != "") {
             ew_AddFilter($sWhereWrk, $sFilterWrk);
         }
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = $conn->Execute($sSqlWrk);
         if ($rswrk && !$rswrk->EOF) {
             // Lookup values found
             $this->subject_dept->ViewValue = $rswrk->fields('DispFld');
             $rswrk->Close();
         } else {
             $this->subject_dept->ViewValue = $this->subject_dept->CurrentValue;
         }
     } else {
         $this->subject_dept->ViewValue = NULL;
     }
     $this->subject_dept->ViewCustomAttributes = "";
     // subject_faculty
     if (strval($this->subject_faculty->CurrentValue) != "") {
         $sFilterWrk = "`faculty_id`" . ew_SearchString("=", $this->subject_faculty->CurrentValue, EW_DATATYPE_NUMBER);
         $sSqlWrk = "SELECT `faculty_id`, `faculty_name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `tbl_faculty`";
         $sWhereWrk = "";
         if ($sFilterWrk != "") {
             ew_AddFilter($sWhereWrk, $sFilterWrk);
         }
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = $conn->Execute($sSqlWrk);
         if ($rswrk && !$rswrk->EOF) {
             // Lookup values found
             $this->subject_faculty->ViewValue = $rswrk->fields('DispFld');
             $rswrk->Close();
         } else {
             $this->subject_faculty->ViewValue = $this->subject_faculty->CurrentValue;
         }
     } else {
         $this->subject_faculty->ViewValue = NULL;
     }
     $this->subject_faculty->ViewCustomAttributes = "";
     // subject_type_id
     $this->subject_type_id->LinkCustomAttributes = "";
     $this->subject_type_id->HrefValue = "";
     $this->subject_type_id->TooltipValue = "";
     // subject_group_type
     $this->subject_group_type->LinkCustomAttributes = "";
     $this->subject_group_type->HrefValue = "";
     $this->subject_group_type->TooltipValue = "";
     // active
     $this->active->LinkCustomAttributes = "";
     $this->active->HrefValue = "";
     $this->active->TooltipValue = "";
     // detail
     $this->detail->LinkCustomAttributes = "";
     $this->detail->HrefValue = "";
     $this->detail->TooltipValue = "";
     // subject_group
     $this->subject_group->LinkCustomAttributes = "";
     $this->subject_group->HrefValue = "";
     $this->subject_group->TooltipValue = "";
     // subject_dept
     $this->subject_dept->LinkCustomAttributes = "";
     $this->subject_dept->HrefValue = "";
     $this->subject_dept->TooltipValue = "";
     // subject_faculty
     $this->subject_faculty->LinkCustomAttributes = "";
     $this->subject_faculty->HrefValue = "";
     $this->subject_faculty->TooltipValue = "";
     // Call Row Rendered event
     $this->Row_Rendered();
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     // Convert decimal values if posted back
     if ($this->costo->FormValue == $this->costo->CurrentValue && is_numeric(ew_StrToFloat($this->costo->CurrentValue))) {
         $this->costo->CurrentValue = ew_StrToFloat($this->costo->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // idservicio_medico_prestado
     // idcuenta
     // idservicio_medico
     // estado
     // costo
     // fecha_inicio
     // fecha_final
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // idservicio_medico_prestado
         $this->idservicio_medico_prestado->ViewValue = $this->idservicio_medico_prestado->CurrentValue;
         $this->idservicio_medico_prestado->ViewCustomAttributes = "";
         // idcuenta
         if (strval($this->idcuenta->CurrentValue) != "") {
             $sFilterWrk = "`idcuenta`" . ew_SearchString("=", $this->idcuenta->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `idcuenta`, `idcuenta` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `cuenta`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->idcuenta, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->idcuenta->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->idcuenta->ViewValue = $this->idcuenta->CurrentValue;
             }
         } else {
             $this->idcuenta->ViewValue = NULL;
         }
         $this->idcuenta->ViewCustomAttributes = "";
         // idservicio_medico
         if (strval($this->idservicio_medico->CurrentValue) != "") {
             $sFilterWrk = "`idservicio_medico`" . ew_SearchString("=", $this->idservicio_medico->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `idservicio_medico`, `descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `servicio_medico`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->idservicio_medico, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->idservicio_medico->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->idservicio_medico->ViewValue = $this->idservicio_medico->CurrentValue;
             }
         } else {
             $this->idservicio_medico->ViewValue = NULL;
         }
         $this->idservicio_medico->ViewCustomAttributes = "";
         // estado
         if (strval($this->estado->CurrentValue) != "") {
             switch ($this->estado->CurrentValue) {
                 case $this->estado->FldTagValue(1):
                     $this->estado->ViewValue = $this->estado->FldTagCaption(1) != "" ? $this->estado->FldTagCaption(1) : $this->estado->CurrentValue;
                     break;
                 case $this->estado->FldTagValue(2):
                     $this->estado->ViewValue = $this->estado->FldTagCaption(2) != "" ? $this->estado->FldTagCaption(2) : $this->estado->CurrentValue;
                     break;
                 case $this->estado->FldTagValue(3):
                     $this->estado->ViewValue = $this->estado->FldTagCaption(3) != "" ? $this->estado->FldTagCaption(3) : $this->estado->CurrentValue;
                     break;
                 default:
                     $this->estado->ViewValue = $this->estado->CurrentValue;
             }
         } else {
             $this->estado->ViewValue = NULL;
         }
         $this->estado->ViewCustomAttributes = "";
         // costo
         $this->costo->ViewValue = $this->costo->CurrentValue;
         $this->costo->ViewCustomAttributes = "";
         // fecha_inicio
         $this->fecha_inicio->ViewValue = $this->fecha_inicio->CurrentValue;
         $this->fecha_inicio->ViewValue = ew_FormatDateTime($this->fecha_inicio->ViewValue, 7);
         $this->fecha_inicio->ViewCustomAttributes = "";
         // fecha_final
         $this->fecha_final->ViewValue = $this->fecha_final->CurrentValue;
         $this->fecha_final->ViewValue = ew_FormatDateTime($this->fecha_final->ViewValue, 7);
         $this->fecha_final->ViewCustomAttributes = "";
         // idcuenta
         $this->idcuenta->LinkCustomAttributes = "";
         $this->idcuenta->HrefValue = "";
         $this->idcuenta->TooltipValue = "";
         // idservicio_medico
         $this->idservicio_medico->LinkCustomAttributes = "";
         $this->idservicio_medico->HrefValue = "";
         $this->idservicio_medico->TooltipValue = "";
         // costo
         $this->costo->LinkCustomAttributes = "";
         $this->costo->HrefValue = "";
         $this->costo->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_ADD) {
         // Add row
         // idcuenta
         $this->idcuenta->EditAttrs["class"] = "form-control";
         $this->idcuenta->EditCustomAttributes = "";
         if ($this->idcuenta->getSessionValue() != "") {
             $this->idcuenta->CurrentValue = $this->idcuenta->getSessionValue();
             if (strval($this->idcuenta->CurrentValue) != "") {
                 $sFilterWrk = "`idcuenta`" . ew_SearchString("=", $this->idcuenta->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `idcuenta`, `idcuenta` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `cuenta`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->idcuenta, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->idcuenta->ViewValue = $rswrk->fields('DispFld');
                     $rswrk->Close();
                 } else {
                     $this->idcuenta->ViewValue = $this->idcuenta->CurrentValue;
                 }
             } else {
                 $this->idcuenta->ViewValue = NULL;
             }
             $this->idcuenta->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->idcuenta->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`idcuenta`" . ew_SearchString("=", $this->idcuenta->CurrentValue, EW_DATATYPE_NUMBER);
             }
             $sSqlWrk = "SELECT `idcuenta`, `idcuenta` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `cuenta`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->idcuenta, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->idcuenta->EditValue = $arwrk;
         }
         // idservicio_medico
         $this->idservicio_medico->EditAttrs["class"] = "form-control";
         $this->idservicio_medico->EditCustomAttributes = "";
         if ($this->idservicio_medico->getSessionValue() != "") {
             $this->idservicio_medico->CurrentValue = $this->idservicio_medico->getSessionValue();
             if (strval($this->idservicio_medico->CurrentValue) != "") {
                 $sFilterWrk = "`idservicio_medico`" . ew_SearchString("=", $this->idservicio_medico->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `idservicio_medico`, `descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `servicio_medico`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->idservicio_medico, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->idservicio_medico->ViewValue = $rswrk->fields('DispFld');
                     $rswrk->Close();
                 } else {
                     $this->idservicio_medico->ViewValue = $this->idservicio_medico->CurrentValue;
                 }
             } else {
                 $this->idservicio_medico->ViewValue = NULL;
             }
             $this->idservicio_medico->ViewCustomAttributes = "";
         } else {
             if (trim(strval($this->idservicio_medico->CurrentValue)) == "") {
                 $sFilterWrk = "0=1";
             } else {
                 $sFilterWrk = "`idservicio_medico`" . ew_SearchString("=", $this->idservicio_medico->CurrentValue, EW_DATATYPE_NUMBER);
             }
             $sSqlWrk = "SELECT `idservicio_medico`, `descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `servicio_medico`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->idservicio_medico, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             $arwrk = $rswrk ? $rswrk->GetRows() : array();
             if ($rswrk) {
                 $rswrk->Close();
             }
             array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
             $this->idservicio_medico->EditValue = $arwrk;
         }
         // costo
         $this->costo->EditAttrs["class"] = "form-control";
         $this->costo->EditCustomAttributes = "";
         $this->costo->EditValue = ew_HtmlEncode($this->costo->CurrentValue);
         $this->costo->PlaceHolder = ew_RemoveHtml($this->costo->FldCaption());
         if (strval($this->costo->EditValue) != "" && is_numeric($this->costo->EditValue)) {
             $this->costo->EditValue = ew_FormatNumber($this->costo->EditValue, -2, -1, -2, 0);
         }
         // Edit refer script
         // idcuenta
         $this->idcuenta->HrefValue = "";
         // idservicio_medico
         $this->idservicio_medico->HrefValue = "";
         // costo
         $this->costo->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // idcuenta
     // idpaciente
     // fecha_inicio
     // fecha_final
     // estado
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // idcuenta
         $this->idcuenta->ViewValue = $this->idcuenta->CurrentValue;
         $this->idcuenta->ViewCustomAttributes = "";
         // idpaciente
         if (strval($this->idpaciente->CurrentValue) != "") {
             $sFilterWrk = "`idpaciente`" . ew_SearchString("=", $this->idpaciente->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `idpaciente`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `paciente`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->idpaciente, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->idpaciente->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->idpaciente->ViewValue = $this->idpaciente->CurrentValue;
             }
         } else {
             $this->idpaciente->ViewValue = NULL;
         }
         $this->idpaciente->ViewCustomAttributes = "";
         // fecha_inicio
         $this->fecha_inicio->ViewValue = $this->fecha_inicio->CurrentValue;
         $this->fecha_inicio->ViewValue = ew_FormatDateTime($this->fecha_inicio->ViewValue, 7);
         $this->fecha_inicio->ViewCustomAttributes = "";
         // fecha_final
         $this->fecha_final->ViewValue = $this->fecha_final->CurrentValue;
         $this->fecha_final->ViewValue = ew_FormatDateTime($this->fecha_final->ViewValue, 7);
         $this->fecha_final->ViewCustomAttributes = "";
         // estado
         if (strval($this->estado->CurrentValue) != "") {
             switch ($this->estado->CurrentValue) {
                 case $this->estado->FldTagValue(1):
                     $this->estado->ViewValue = $this->estado->FldTagCaption(1) != "" ? $this->estado->FldTagCaption(1) : $this->estado->CurrentValue;
                     break;
                 case $this->estado->FldTagValue(2):
                     $this->estado->ViewValue = $this->estado->FldTagCaption(2) != "" ? $this->estado->FldTagCaption(2) : $this->estado->CurrentValue;
                     break;
                 default:
                     $this->estado->ViewValue = $this->estado->CurrentValue;
             }
         } else {
             $this->estado->ViewValue = NULL;
         }
         $this->estado->ViewCustomAttributes = "";
         // idpaciente
         $this->idpaciente->LinkCustomAttributes = "";
         $this->idpaciente->HrefValue = "";
         $this->idpaciente->TooltipValue = "";
         // fecha_inicio
         $this->fecha_inicio->LinkCustomAttributes = "";
         $this->fecha_inicio->HrefValue = "";
         $this->fecha_inicio->TooltipValue = "";
         // fecha_final
         $this->fecha_final->LinkCustomAttributes = "";
         $this->fecha_final->HrefValue = "";
         $this->fecha_final->TooltipValue = "";
         // estado
         $this->estado->LinkCustomAttributes = "";
         $this->estado->HrefValue = "";
         $this->estado->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #20
0
 function RenderListRow()
 {
     global $conn, $Security, $gsLanguage;
     // Call Row Rendering event
     $this->Row_Rendering();
     // Common render codes
     // TopicQuestionID
     // Question
     // TopicID
     // TopicQuestionID
     $this->TopicQuestionID->ViewValue = $this->TopicQuestionID->CurrentValue;
     $this->TopicQuestionID->ViewCustomAttributes = "";
     // Question
     $this->Question->ViewValue = $this->Question->CurrentValue;
     $this->Question->ViewCustomAttributes = "";
     // TopicID
     if (strval($this->TopicID->CurrentValue) != "") {
         $sFilterWrk = "`TopicID`" . ew_SearchString("=", $this->TopicID->CurrentValue, EW_DATATYPE_NUMBER);
         $sSqlWrk = "SELECT `TopicID`, `Name` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `Topics`";
         $sWhereWrk = "";
         if ($sFilterWrk != "") {
             ew_AddFilter($sWhereWrk, $sFilterWrk);
         }
         // Call Lookup selecting
         $this->Lookup_Selecting($this->TopicID, $sWhereWrk);
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = $conn->Execute($sSqlWrk);
         if ($rswrk && !$rswrk->EOF) {
             // Lookup values found
             $this->TopicID->ViewValue = $rswrk->fields('DispFld');
             $rswrk->Close();
         } else {
             $this->TopicID->ViewValue = $this->TopicID->CurrentValue;
         }
     } else {
         $this->TopicID->ViewValue = NULL;
     }
     $this->TopicID->ViewCustomAttributes = "";
     // TopicQuestionID
     $this->TopicQuestionID->LinkCustomAttributes = "";
     $this->TopicQuestionID->HrefValue = "";
     $this->TopicQuestionID->TooltipValue = "";
     // Question
     $this->Question->LinkCustomAttributes = "";
     $this->Question->HrefValue = "";
     $this->Question->TooltipValue = "";
     // TopicID
     $this->TopicID->LinkCustomAttributes = "";
     $this->TopicID->HrefValue = "";
     $this->TopicID->TooltipValue = "";
     // Call Row Rendered event
     $this->Row_Rendered();
 }
 function RenderRow()
 {
     global $Security, $Language, $gsLanguage;
     // Initialize URLs
     // Convert decimal values if posted back
     if ($this->ACCOUNT_NUMBER->FormValue == $this->ACCOUNT_NUMBER->CurrentValue && is_numeric(ew_StrToFloat($this->ACCOUNT_NUMBER->CurrentValue))) {
         $this->ACCOUNT_NUMBER->CurrentValue = ew_StrToFloat($this->ACCOUNT_NUMBER->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // BANK_ACCOUNT_ID
     // CODE
     // DESCRIPTION
     // ACCOUNT_NUMBER
     // BANK_ID
     // ACTIVE
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // CODE
         $this->CODE->ViewValue = $this->CODE->CurrentValue;
         $this->CODE->ViewCustomAttributes = "";
         // DESCRIPTION
         $this->DESCRIPTION->ViewValue = $this->DESCRIPTION->CurrentValue;
         $this->DESCRIPTION->ViewCustomAttributes = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->ViewValue = $this->ACCOUNT_NUMBER->CurrentValue;
         $this->ACCOUNT_NUMBER->ViewCustomAttributes = "";
         // BANK_ID
         if (strval($this->BANK_ID->CurrentValue) != "") {
             $sFilterWrk = "`BANK_ID`" . ew_SearchString("=", $this->BANK_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
             switch (@$gsLanguage) {
                 case "es":
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
                 default:
                     $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `bank`";
                     $sWhereWrk = "";
                     break;
             }
             ew_AddFilter($sWhereWrk, $sFilterWrk);
             $this->Lookup_Selecting($this->BANK_ID, $sWhereWrk);
             // Call Lookup selecting
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = Conn()->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $arwrk = array();
                 $arwrk[1] = $rswrk->fields('DispFld');
                 $this->BANK_ID->ViewValue = $this->BANK_ID->DisplayValue($arwrk);
                 $rswrk->Close();
             } else {
                 $this->BANK_ID->ViewValue = $this->BANK_ID->CurrentValue;
             }
         } else {
             $this->BANK_ID->ViewValue = NULL;
         }
         $this->BANK_ID->ViewCustomAttributes = "";
         // ACTIVE
         if (strval($this->ACTIVE->CurrentValue) != "") {
             $this->ACTIVE->ViewValue = $this->ACTIVE->OptionCaption($this->ACTIVE->CurrentValue);
         } else {
             $this->ACTIVE->ViewValue = NULL;
         }
         $this->ACTIVE->ViewCustomAttributes = "";
         // CODE
         $this->CODE->LinkCustomAttributes = "";
         $this->CODE->HrefValue = "";
         $this->CODE->TooltipValue = "";
         // DESCRIPTION
         $this->DESCRIPTION->LinkCustomAttributes = "";
         $this->DESCRIPTION->HrefValue = "";
         $this->DESCRIPTION->TooltipValue = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->LinkCustomAttributes = "";
         $this->ACCOUNT_NUMBER->HrefValue = "";
         $this->ACCOUNT_NUMBER->TooltipValue = "";
         // BANK_ID
         $this->BANK_ID->LinkCustomAttributes = "";
         $this->BANK_ID->HrefValue = "";
         $this->BANK_ID->TooltipValue = "";
         // ACTIVE
         $this->ACTIVE->LinkCustomAttributes = "";
         $this->ACTIVE->HrefValue = "";
         $this->ACTIVE->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // CODE
         $this->CODE->EditAttrs["class"] = "form-control";
         $this->CODE->EditCustomAttributes = "";
         $this->CODE->EditValue = ew_HtmlEncode($this->CODE->CurrentValue);
         $this->CODE->PlaceHolder = ew_RemoveHtml($this->CODE->FldCaption());
         // DESCRIPTION
         $this->DESCRIPTION->EditAttrs["class"] = "form-control";
         $this->DESCRIPTION->EditCustomAttributes = "";
         $this->DESCRIPTION->EditValue = ew_HtmlEncode($this->DESCRIPTION->CurrentValue);
         $this->DESCRIPTION->PlaceHolder = ew_RemoveHtml($this->DESCRIPTION->FldCaption());
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->EditAttrs["class"] = "form-control";
         $this->ACCOUNT_NUMBER->EditCustomAttributes = "";
         $this->ACCOUNT_NUMBER->EditValue = ew_HtmlEncode($this->ACCOUNT_NUMBER->CurrentValue);
         $this->ACCOUNT_NUMBER->PlaceHolder = ew_RemoveHtml($this->ACCOUNT_NUMBER->FldCaption());
         if (strval($this->ACCOUNT_NUMBER->EditValue) != "" && is_numeric($this->ACCOUNT_NUMBER->EditValue)) {
             $this->ACCOUNT_NUMBER->EditValue = ew_FormatNumber($this->ACCOUNT_NUMBER->EditValue, -2, -1, -2, 0);
         }
         // BANK_ID
         $this->BANK_ID->EditAttrs["class"] = "form-control";
         $this->BANK_ID->EditCustomAttributes = "";
         if (trim(strval($this->BANK_ID->CurrentValue)) == "") {
             $sFilterWrk = "0=1";
         } else {
             $sFilterWrk = "`BANK_ID`" . ew_SearchString("=", $this->BANK_ID->CurrentValue, EW_DATATYPE_NUMBER, "");
         }
         switch (@$gsLanguage) {
             case "es":
                 $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `bank`";
                 $sWhereWrk = "";
                 break;
             default:
                 $sSqlWrk = "SELECT `BANK_ID`, `DESCRIPTION` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `bank`";
                 $sWhereWrk = "";
                 break;
         }
         ew_AddFilter($sWhereWrk, $sFilterWrk);
         $this->Lookup_Selecting($this->BANK_ID, $sWhereWrk);
         // Call Lookup selecting
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = Conn()->Execute($sSqlWrk);
         $arwrk = $rswrk ? $rswrk->GetRows() : array();
         if ($rswrk) {
             $rswrk->Close();
         }
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
         $this->BANK_ID->EditValue = $arwrk;
         // ACTIVE
         $this->ACTIVE->EditAttrs["class"] = "form-control";
         $this->ACTIVE->EditCustomAttributes = "";
         $this->ACTIVE->EditValue = $this->ACTIVE->Options(TRUE);
         // Edit refer script
         // CODE
         $this->CODE->LinkCustomAttributes = "";
         $this->CODE->HrefValue = "";
         // DESCRIPTION
         $this->DESCRIPTION->LinkCustomAttributes = "";
         $this->DESCRIPTION->HrefValue = "";
         // ACCOUNT_NUMBER
         $this->ACCOUNT_NUMBER->LinkCustomAttributes = "";
         $this->ACCOUNT_NUMBER->HrefValue = "";
         // BANK_ID
         $this->BANK_ID->LinkCustomAttributes = "";
         $this->BANK_ID->HrefValue = "";
         // ACTIVE
         $this->ACTIVE->LinkCustomAttributes = "";
         $this->ACTIVE->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function AddDetailUserIDFilter($sFilter, $sCurrentMasterTable)
 {
     $sFilterWrk = $sFilter;
     if ($sCurrentMasterTable == "socios") {
         $mastertable = $GLOBALS["socios"];
         if (!$mastertable->UserIDAllow()) {
             $sSubqueryWrk = $mastertable->GetUserIDSubquery($this->id_socio, $mastertable->socio_nro);
             ew_AddFilter($sFilterWrk, $sSubqueryWrk);
         }
     }
     return $sFilterWrk;
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // accountId
     // permissionId
     // granted
     // realmId
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // accountId
         if (strval($this->accountId->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->accountId->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `username` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `account`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->accountId->ViewValue = $rswrk->fields('DispFld');
                 $this->accountId->ViewValue .= ew_ValueSeparator(1, $this->accountId) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->accountId->ViewValue = $this->accountId->CurrentValue;
             }
         } else {
             $this->accountId->ViewValue = NULL;
         }
         $this->accountId->ViewCustomAttributes = "";
         // permissionId
         if ($this->permissionId->VirtualValue != "") {
             $this->permissionId->ViewValue = $this->permissionId->VirtualValue;
         } else {
             if (strval($this->permissionId->CurrentValue) != "") {
                 $sFilterWrk = "`id`" . ew_SearchString("=", $this->permissionId->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `rbac_permissions`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->permissionId->ViewValue = $rswrk->fields('DispFld');
                     $this->permissionId->ViewValue .= ew_ValueSeparator(1, $this->permissionId) . $rswrk->fields('Disp2Fld');
                     $rswrk->Close();
                 } else {
                     $this->permissionId->ViewValue = $this->permissionId->CurrentValue;
                 }
             } else {
                 $this->permissionId->ViewValue = NULL;
             }
         }
         $this->permissionId->ViewCustomAttributes = "";
         // granted
         if (strval($this->granted->CurrentValue) != "") {
             switch ($this->granted->CurrentValue) {
                 case $this->granted->FldTagValue(1):
                     $this->granted->ViewValue = $this->granted->FldTagCaption(1) != "" ? $this->granted->FldTagCaption(1) : $this->granted->CurrentValue;
                     break;
                 case $this->granted->FldTagValue(2):
                     $this->granted->ViewValue = $this->granted->FldTagCaption(2) != "" ? $this->granted->FldTagCaption(2) : $this->granted->CurrentValue;
                     break;
                 default:
                     $this->granted->ViewValue = $this->granted->CurrentValue;
             }
         } else {
             $this->granted->ViewValue = NULL;
         }
         $this->granted->ViewCustomAttributes = "";
         // realmId
         if (strval($this->realmId->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->realmId->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `id` AS `DispFld`, `name` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `realmlist`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->realmId->ViewValue = $rswrk->fields('DispFld');
                 $this->realmId->ViewValue .= ew_ValueSeparator(1, $this->realmId) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->realmId->ViewValue = $this->realmId->CurrentValue;
             }
         } else {
             $this->realmId->ViewValue = NULL;
         }
         $this->realmId->ViewCustomAttributes = "";
         // accountId
         $this->accountId->LinkCustomAttributes = "";
         $this->accountId->HrefValue = "";
         $this->accountId->TooltipValue = "";
         // permissionId
         $this->permissionId->LinkCustomAttributes = "";
         $this->permissionId->HrefValue = "";
         $this->permissionId->TooltipValue = "";
         // granted
         $this->granted->LinkCustomAttributes = "";
         $this->granted->HrefValue = "";
         $this->granted->TooltipValue = "";
         // realmId
         $this->realmId->LinkCustomAttributes = "";
         $this->realmId->HrefValue = "";
         $this->realmId->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function AddDetailUserIDFilter($sFilter, $sCurrentMasterTable)
 {
     $sFilterWrk = $sFilter;
     if ($sCurrentMasterTable == "hoja_mantenimientos") {
         $mastertable = $GLOBALS["hoja_mantenimientos"];
         if (!$mastertable->UserIDAllow()) {
             $sSubqueryWrk = $mastertable->GetUserIDSubquery($this->id_hoja_mantenimeinto, $mastertable->codigo);
             ew_AddFilter($sFilterWrk, $sSubqueryWrk);
         }
     }
     return $sFilterWrk;
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // nilai_id
     // nis
     // nip
     // semester
     // kelas
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // nilai_id
         $this->nilai_id->ViewValue = $this->nilai_id->CurrentValue;
         $this->nilai_id->ViewCustomAttributes = "";
         // nis
         if (strval($this->nis->CurrentValue) != "") {
             $sFilterWrk = "`id_siswa`" . ew_SearchString("=", $this->nis->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id_siswa`, `nama` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `siswa`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->nis, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->nis->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->nis->ViewValue = $this->nis->CurrentValue;
             }
         } else {
             $this->nis->ViewValue = NULL;
         }
         $this->nis->ViewCustomAttributes = "";
         // nip
         if (strval($this->nip->CurrentValue) != "") {
             $sFilterWrk = "`guru_id`" . ew_SearchString("=", $this->nip->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `guru_id`, `nama` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `guru`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->nip, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->nip->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->nip->ViewValue = $this->nip->CurrentValue;
             }
         } else {
             $this->nip->ViewValue = NULL;
         }
         $this->nip->ViewCustomAttributes = "";
         // semester
         $this->semester->ViewValue = $this->semester->CurrentValue;
         $this->semester->ViewCustomAttributes = "";
         // kelas
         $this->kelas->ViewValue = $this->kelas->CurrentValue;
         $this->kelas->ViewCustomAttributes = "";
         // nis
         $this->nis->LinkCustomAttributes = "";
         $this->nis->HrefValue = "";
         $this->nis->TooltipValue = "";
         // nip
         $this->nip->LinkCustomAttributes = "";
         $this->nip->HrefValue = "";
         $this->nip->TooltipValue = "";
         // semester
         $this->semester->LinkCustomAttributes = "";
         $this->semester->HrefValue = "";
         $this->semester->TooltipValue = "";
         // kelas
         $this->kelas->LinkCustomAttributes = "";
         $this->kelas->HrefValue = "";
         $this->kelas->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #26
0
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // codigo
     // Patente
     // cantidad_rueda
     // nombre
     // modelo
     // id_chofer
     // id_guarda
     // id_marca
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // codigo
         $this->codigo->ViewValue = $this->codigo->CurrentValue;
         $this->codigo->ViewCustomAttributes = "";
         // Patente
         $this->Patente->ViewValue = $this->Patente->CurrentValue;
         $this->Patente->ViewCustomAttributes = "";
         // cantidad_rueda
         $this->cantidad_rueda->ViewValue = $this->cantidad_rueda->CurrentValue;
         $this->cantidad_rueda->ViewCustomAttributes = "";
         // nombre
         $this->nombre->ViewValue = $this->nombre->CurrentValue;
         $this->nombre->ViewCustomAttributes = "";
         // modelo
         $this->modelo->ViewValue = $this->modelo->CurrentValue;
         $this->modelo->ViewCustomAttributes = "";
         // id_chofer
         if ($this->id_chofer->VirtualValue != "") {
             $this->id_chofer->ViewValue = $this->id_chofer->VirtualValue;
         } else {
             if (strval($this->id_chofer->CurrentValue) != "") {
                 $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_chofer->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `codigo`, `codigo` AS `DispFld`, `nombre` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `choferes`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->id_chofer, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $sSqlWrk .= " ORDER BY `nombre` ASC";
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->id_chofer->ViewValue = $rswrk->fields('DispFld');
                     $this->id_chofer->ViewValue .= ew_ValueSeparator(1, $this->id_chofer) . $rswrk->fields('Disp2Fld');
                     $rswrk->Close();
                 } else {
                     $this->id_chofer->ViewValue = $this->id_chofer->CurrentValue;
                 }
             } else {
                 $this->id_chofer->ViewValue = NULL;
             }
         }
         $this->id_chofer->ViewCustomAttributes = "";
         // id_guarda
         if ($this->id_guarda->VirtualValue != "") {
             $this->id_guarda->ViewValue = $this->id_guarda->VirtualValue;
         } else {
             if (strval($this->id_guarda->CurrentValue) != "") {
                 $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_guarda->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `codigo`, `codigo` AS `DispFld`, `nombre` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `choferes`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->id_guarda, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $sSqlWrk .= " ORDER BY `nombre` ASC";
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->id_guarda->ViewValue = $rswrk->fields('DispFld');
                     $this->id_guarda->ViewValue .= ew_ValueSeparator(1, $this->id_guarda) . $rswrk->fields('Disp2Fld');
                     $rswrk->Close();
                 } else {
                     $this->id_guarda->ViewValue = $this->id_guarda->CurrentValue;
                 }
             } else {
                 $this->id_guarda->ViewValue = NULL;
             }
         }
         $this->id_guarda->ViewCustomAttributes = "";
         // id_marca
         if ($this->id_marca->VirtualValue != "") {
             $this->id_marca->ViewValue = $this->id_marca->VirtualValue;
         } else {
             if (strval($this->id_marca->CurrentValue) != "") {
                 $sFilterWrk = "`codigo`" . ew_SearchString("=", $this->id_marca->CurrentValue, EW_DATATYPE_NUMBER);
                 $sSqlWrk = "SELECT `codigo`, `marca` AS `DispFld`, `modelo` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `marcas`";
                 $sWhereWrk = "";
                 if ($sFilterWrk != "") {
                     ew_AddFilter($sWhereWrk, $sFilterWrk);
                 }
                 // Call Lookup selecting
                 $this->Lookup_Selecting($this->id_marca, $sWhereWrk);
                 if ($sWhereWrk != "") {
                     $sSqlWrk .= " WHERE " . $sWhereWrk;
                 }
                 $sSqlWrk .= " ORDER BY `marca` ASC";
                 $rswrk = $conn->Execute($sSqlWrk);
                 if ($rswrk && !$rswrk->EOF) {
                     // Lookup values found
                     $this->id_marca->ViewValue = $rswrk->fields('DispFld');
                     $this->id_marca->ViewValue .= ew_ValueSeparator(1, $this->id_marca) . $rswrk->fields('Disp2Fld');
                     $rswrk->Close();
                 } else {
                     $this->id_marca->ViewValue = $this->id_marca->CurrentValue;
                 }
             } else {
                 $this->id_marca->ViewValue = NULL;
             }
         }
         $this->id_marca->ViewCustomAttributes = "";
         // codigo
         $this->codigo->LinkCustomAttributes = "";
         $this->codigo->HrefValue = "";
         $this->codigo->TooltipValue = "";
         // Patente
         $this->Patente->LinkCustomAttributes = "";
         $this->Patente->HrefValue = "";
         $this->Patente->TooltipValue = "";
         // cantidad_rueda
         $this->cantidad_rueda->LinkCustomAttributes = "";
         $this->cantidad_rueda->HrefValue = "";
         $this->cantidad_rueda->TooltipValue = "";
         // nombre
         $this->nombre->LinkCustomAttributes = "";
         $this->nombre->HrefValue = "";
         $this->nombre->TooltipValue = "";
         // modelo
         $this->modelo->LinkCustomAttributes = "";
         $this->modelo->HrefValue = "";
         $this->modelo->TooltipValue = "";
         // id_chofer
         $this->id_chofer->LinkCustomAttributes = "";
         $this->id_chofer->HrefValue = "";
         $this->id_chofer->TooltipValue = "";
         // id_guarda
         $this->id_guarda->LinkCustomAttributes = "";
         $this->id_guarda->HrefValue = "";
         $this->id_guarda->TooltipValue = "";
         // id_marca
         $this->id_marca->LinkCustomAttributes = "";
         $this->id_marca->HrefValue = "";
         $this->id_marca->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
 function Page_Main()
 {
     global $objForm, $Language, $gsFormError, $gsSearchError, $Security;
     // Search filters
     $sSrchAdvanced = "";
     // Advanced search filter
     $sSrchBasic = "";
     // Basic search filter
     $sFilter = "";
     // Get command
     $this->Command = strtolower(@$_GET["cmd"]);
     if ($this->IsPageRequest()) {
         // Validate request
         // Process custom action first
         $this->ProcessCustomAction();
         // Handle reset command
         $this->ResetCmd();
         // Set up Breadcrumb
         if ($this->Export == "") {
             $this->SetupBreadcrumb();
         }
         // Hide list options
         if ($this->Export != "") {
             $this->ListOptions->HideAllOptions(array("sequence"));
             $this->ListOptions->UseDropDownButton = FALSE;
             // Disable drop down button
             $this->ListOptions->UseButtonGroup = FALSE;
             // Disable button group
         } elseif ($this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit") {
             $this->ListOptions->HideAllOptions();
             $this->ListOptions->UseDropDownButton = FALSE;
             // Disable drop down button
             $this->ListOptions->UseButtonGroup = FALSE;
             // Disable button group
         }
         // Hide export options
         if ($this->Export != "" || $this->CurrentAction != "") {
             $this->ExportOptions->HideAllOptions();
         }
         // Hide other options
         if ($this->Export != "") {
             foreach ($this->OtherOptions as &$option) {
                 $option->HideAllOptions();
             }
         }
         // Get default search criteria
         ew_AddFilter($this->DefaultSearchWhere, $this->BasicSearchWhere(TRUE));
         // Get basic search values
         $this->LoadBasicSearchValues();
         // Restore search parms from Session if not searching / reset / export
         if (($this->Export != "" || $this->Command != "search" && $this->Command != "reset" && $this->Command != "resetall") && $this->CheckSearchParms()) {
             $this->RestoreSearchParms();
         }
         // Call Recordset SearchValidated event
         $this->Recordset_SearchValidated();
         // Set up sorting order
         $this->SetUpSortOrder();
         // Get basic search criteria
         if ($gsSearchError == "") {
             $sSrchBasic = $this->BasicSearchWhere();
         }
     }
     // Restore display records
     if ($this->getRecordsPerPage() != "") {
         $this->DisplayRecs = $this->getRecordsPerPage();
         // Restore from Session
     } else {
         $this->DisplayRecs = 20;
         // Load default
     }
     // Load Sorting Order
     $this->LoadSortOrder();
     // Load search default if no existing search criteria
     if (!$this->CheckSearchParms()) {
         // Load basic search from default
         $this->BasicSearch->LoadDefault();
         if ($this->BasicSearch->Keyword != "") {
             $sSrchBasic = $this->BasicSearchWhere();
         }
     }
     // Build search criteria
     ew_AddFilter($this->SearchWhere, $sSrchAdvanced);
     ew_AddFilter($this->SearchWhere, $sSrchBasic);
     // Call Recordset_Searching event
     $this->Recordset_Searching($this->SearchWhere);
     // Save search criteria
     if ($this->Command == "search" && !$this->RestoreSearch) {
         $this->setSearchWhere($this->SearchWhere);
         // Save to Session
         $this->StartRec = 1;
         // Reset start record counter
         $this->setStartRecordNumber($this->StartRec);
     } else {
         $this->SearchWhere = $this->getSearchWhere();
     }
     // Build filter
     $sFilter = "";
     ew_AddFilter($sFilter, $this->DbDetailFilter);
     ew_AddFilter($sFilter, $this->SearchWhere);
     // Set up filter in session
     $this->setSessionWhere($sFilter);
     $this->CurrentFilter = "";
     // Load record count first
     $bSelectLimit = EW_SELECT_LIMIT;
     if ($bSelectLimit) {
         $this->TotalRecs = $this->SelectRecordCount();
     } else {
         if ($this->Recordset = $this->LoadRecordset()) {
             $this->TotalRecs = $this->Recordset->RecordCount();
         }
     }
     // Search options
     $this->SetupSearchOptions();
 }
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->ViewUrl = $this->GetViewUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->InlineEditUrl = $this->GetInlineEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->InlineCopyUrl = $this->GetInlineCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // id_detail_nilai
     // id_nilai
     // id_mapel
     // nilai_afektif
     // nilai_komulatif
     // nilai_psikomotorik
     // nilai_rata_rata
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // id_detail_nilai
         $this->id_detail_nilai->ViewValue = $this->id_detail_nilai->CurrentValue;
         $this->id_detail_nilai->ViewCustomAttributes = "";
         // id_nilai
         $this->id_nilai->ViewValue = $this->id_nilai->CurrentValue;
         $this->id_nilai->ViewCustomAttributes = "";
         // id_mapel
         if (strval($this->id_mapel->CurrentValue) != "") {
             $sFilterWrk = "`id_mapel`" . ew_SearchString("=", $this->id_mapel->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id_mapel`, `nama_mapel` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `mapel`";
             $sWhereWrk = "";
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_mapel, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->id_mapel->ViewValue = $rswrk->fields('DispFld');
                 $rswrk->Close();
             } else {
                 $this->id_mapel->ViewValue = $this->id_mapel->CurrentValue;
             }
         } else {
             $this->id_mapel->ViewValue = NULL;
         }
         $this->id_mapel->ViewCustomAttributes = "";
         // nilai_afektif
         $this->nilai_afektif->ViewValue = $this->nilai_afektif->CurrentValue;
         $this->nilai_afektif->ViewCustomAttributes = "";
         // nilai_komulatif
         $this->nilai_komulatif->ViewValue = $this->nilai_komulatif->CurrentValue;
         $this->nilai_komulatif->ViewCustomAttributes = "";
         // nilai_psikomotorik
         $this->nilai_psikomotorik->ViewValue = $this->nilai_psikomotorik->CurrentValue;
         $this->nilai_psikomotorik->ViewCustomAttributes = "";
         // nilai_rata_rata
         $this->nilai_rata_rata->ViewValue = $this->nilai_rata_rata->CurrentValue;
         $this->nilai_rata_rata->ViewCustomAttributes = "";
         // id_mapel
         $this->id_mapel->LinkCustomAttributes = "";
         $this->id_mapel->HrefValue = "";
         $this->id_mapel->TooltipValue = "";
         // nilai_afektif
         $this->nilai_afektif->LinkCustomAttributes = "";
         $this->nilai_afektif->HrefValue = "";
         $this->nilai_afektif->TooltipValue = "";
         // nilai_komulatif
         $this->nilai_komulatif->LinkCustomAttributes = "";
         $this->nilai_komulatif->HrefValue = "";
         $this->nilai_komulatif->TooltipValue = "";
         // nilai_psikomotorik
         $this->nilai_psikomotorik->LinkCustomAttributes = "";
         $this->nilai_psikomotorik->HrefValue = "";
         $this->nilai_psikomotorik->TooltipValue = "";
         // nilai_rata_rata
         $this->nilai_rata_rata->LinkCustomAttributes = "";
         $this->nilai_rata_rata->HrefValue = "";
         $this->nilai_rata_rata->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #29
0
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // socio_nro
     // id_actividad
     // id_usuario
     // propietario
     // comercio
     // direccion_comercio
     // activo
     // mail
     // tel
     // cel
     // cuit_cuil
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // socio_nro
         $this->socio_nro->ViewValue = $this->socio_nro->CurrentValue;
         $this->socio_nro->ViewCustomAttributes = "";
         // id_actividad
         if (strval($this->id_actividad->CurrentValue) != "") {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->id_actividad->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `id`, `actividad` AS `DispFld`, `descripcion` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `actividad`";
             $sWhereWrk = "";
             $lookuptblfilter = "`activa`='S'";
             if (strval($lookuptblfilter) != "") {
                 ew_AddFilter($sWhereWrk, $lookuptblfilter);
             }
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_actividad, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->id_actividad->ViewValue = $rswrk->fields('DispFld');
                 $this->id_actividad->ViewValue .= ew_ValueSeparator(1, $this->id_actividad) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->id_actividad->ViewValue = $this->id_actividad->CurrentValue;
             }
         } else {
             $this->id_actividad->ViewValue = NULL;
         }
         $this->id_actividad->ViewCustomAttributes = "";
         // propietario
         $this->propietario->ViewValue = $this->propietario->CurrentValue;
         $this->propietario->ViewCustomAttributes = "";
         // comercio
         $this->comercio->ViewValue = $this->comercio->CurrentValue;
         $this->comercio->ViewCustomAttributes = "";
         // direccion_comercio
         $this->direccion_comercio->ViewValue = $this->direccion_comercio->CurrentValue;
         $this->direccion_comercio->ViewCustomAttributes = "";
         // activo
         if (strval($this->activo->CurrentValue) != "") {
             switch ($this->activo->CurrentValue) {
                 case $this->activo->FldTagValue(1):
                     $this->activo->ViewValue = $this->activo->FldTagCaption(1) != "" ? $this->activo->FldTagCaption(1) : $this->activo->CurrentValue;
                     break;
                 case $this->activo->FldTagValue(2):
                     $this->activo->ViewValue = $this->activo->FldTagCaption(2) != "" ? $this->activo->FldTagCaption(2) : $this->activo->CurrentValue;
                     break;
                 default:
                     $this->activo->ViewValue = $this->activo->CurrentValue;
             }
         } else {
             $this->activo->ViewValue = NULL;
         }
         $this->activo->ViewCustomAttributes = "";
         // mail
         $this->mail->ViewValue = $this->mail->CurrentValue;
         $this->mail->ViewValue = strtolower($this->mail->ViewValue);
         $this->mail->ViewCustomAttributes = "";
         // tel
         $this->tel->ViewValue = $this->tel->CurrentValue;
         $this->tel->ViewValue = trim($this->tel->ViewValue);
         $this->tel->ViewCustomAttributes = "";
         // cel
         $this->cel->ViewValue = $this->cel->CurrentValue;
         $this->cel->ViewValue = trim($this->cel->ViewValue);
         $this->cel->ViewCustomAttributes = "";
         // cuit_cuil
         $this->cuit_cuil->ViewValue = $this->cuit_cuil->CurrentValue;
         $this->cuit_cuil->ViewValue = ew_FormatNumber($this->cuit_cuil->ViewValue, 0, -2, -2, -2);
         $this->cuit_cuil->ViewCustomAttributes = "";
         // id_actividad
         $this->id_actividad->LinkCustomAttributes = "";
         $this->id_actividad->HrefValue = "";
         $this->id_actividad->TooltipValue = "";
         // propietario
         $this->propietario->LinkCustomAttributes = "";
         $this->propietario->HrefValue = "";
         $this->propietario->TooltipValue = "";
         // comercio
         $this->comercio->LinkCustomAttributes = "";
         $this->comercio->HrefValue = "";
         $this->comercio->TooltipValue = "";
         // direccion_comercio
         $this->direccion_comercio->LinkCustomAttributes = "";
         $this->direccion_comercio->HrefValue = "";
         $this->direccion_comercio->TooltipValue = "";
         // activo
         $this->activo->LinkCustomAttributes = "";
         $this->activo->HrefValue = "";
         $this->activo->TooltipValue = "";
         // mail
         $this->mail->LinkCustomAttributes = "";
         $this->mail->HrefValue = "";
         $this->mail->TooltipValue = "";
         // tel
         $this->tel->LinkCustomAttributes = "";
         $this->tel->HrefValue = "";
         $this->tel->TooltipValue = "";
         // cel
         $this->cel->LinkCustomAttributes = "";
         $this->cel->HrefValue = "";
         $this->cel->TooltipValue = "";
         // cuit_cuil
         $this->cuit_cuil->LinkCustomAttributes = "";
         $this->cuit_cuil->HrefValue = "";
         $this->cuit_cuil->TooltipValue = "";
     } elseif ($this->RowType == EW_ROWTYPE_EDIT) {
         // Edit row
         // id_actividad
         $this->id_actividad->EditCustomAttributes = "";
         if (trim(strval($this->id_actividad->CurrentValue)) == "") {
             $sFilterWrk = "0=1";
         } else {
             $sFilterWrk = "`id`" . ew_SearchString("=", $this->id_actividad->CurrentValue, EW_DATATYPE_NUMBER);
         }
         $sSqlWrk = "SELECT `id`, `actividad` AS `DispFld`, `descripcion` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld`, '' AS `SelectFilterFld`, '' AS `SelectFilterFld2`, '' AS `SelectFilterFld3`, '' AS `SelectFilterFld4` FROM `actividad`";
         $sWhereWrk = "";
         $lookuptblfilter = "`activa`='S'";
         if (strval($lookuptblfilter) != "") {
             ew_AddFilter($sWhereWrk, $lookuptblfilter);
         }
         if ($sFilterWrk != "") {
             ew_AddFilter($sWhereWrk, $sFilterWrk);
         }
         // Call Lookup selecting
         $this->Lookup_Selecting($this->id_actividad, $sWhereWrk);
         if ($sWhereWrk != "") {
             $sSqlWrk .= " WHERE " . $sWhereWrk;
         }
         $rswrk = $conn->Execute($sSqlWrk);
         $arwrk = $rswrk ? $rswrk->GetRows() : array();
         if ($rswrk) {
             $rswrk->Close();
         }
         array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"), "", "", "", "", "", "", ""));
         $this->id_actividad->EditValue = $arwrk;
         // propietario
         $this->propietario->EditCustomAttributes = "";
         $this->propietario->EditValue = ew_HtmlEncode($this->propietario->CurrentValue);
         $this->propietario->PlaceHolder = ew_HtmlEncode(ew_RemoveHtml($this->propietario->FldCaption()));
         // comercio
         $this->comercio->EditCustomAttributes = "";
         $this->comercio->EditValue = ew_HtmlEncode($this->comercio->CurrentValue);
         $this->comercio->PlaceHolder = ew_HtmlEncode(ew_RemoveHtml($this->comercio->FldCaption()));
         // direccion_comercio
         $this->direccion_comercio->EditCustomAttributes = "";
         $this->direccion_comercio->EditValue = ew_HtmlEncode($this->direccion_comercio->CurrentValue);
         $this->direccion_comercio->PlaceHolder = ew_HtmlEncode(ew_RemoveHtml($this->direccion_comercio->FldCaption()));
         // activo
         $this->activo->EditCustomAttributes = "";
         $arwrk = array();
         $arwrk[] = array($this->activo->FldTagValue(1), $this->activo->FldTagCaption(1) != "" ? $this->activo->FldTagCaption(1) : $this->activo->FldTagValue(1));
         $arwrk[] = array($this->activo->FldTagValue(2), $this->activo->FldTagCaption(2) != "" ? $this->activo->FldTagCaption(2) : $this->activo->FldTagValue(2));
         $this->activo->EditValue = $arwrk;
         // mail
         $this->mail->EditCustomAttributes = "";
         $this->mail->EditValue = ew_HtmlEncode($this->mail->CurrentValue);
         $this->mail->PlaceHolder = ew_HtmlEncode(ew_RemoveHtml($this->mail->FldCaption()));
         // tel
         $this->tel->EditCustomAttributes = "";
         $this->tel->EditValue = ew_HtmlEncode($this->tel->CurrentValue);
         $this->tel->PlaceHolder = ew_HtmlEncode(ew_RemoveHtml($this->tel->FldCaption()));
         // cel
         $this->cel->EditCustomAttributes = "";
         $this->cel->EditValue = ew_HtmlEncode($this->cel->CurrentValue);
         $this->cel->PlaceHolder = ew_HtmlEncode(ew_RemoveHtml($this->cel->FldCaption()));
         // cuit_cuil
         $this->cuit_cuil->EditCustomAttributes = "";
         $this->cuit_cuil->EditValue = ew_HtmlEncode($this->cuit_cuil->CurrentValue);
         $this->cuit_cuil->PlaceHolder = ew_HtmlEncode(ew_RemoveHtml($this->cuit_cuil->FldCaption()));
         // Edit refer script
         // id_actividad
         $this->id_actividad->HrefValue = "";
         // propietario
         $this->propietario->HrefValue = "";
         // comercio
         $this->comercio->HrefValue = "";
         // direccion_comercio
         $this->direccion_comercio->HrefValue = "";
         // activo
         $this->activo->HrefValue = "";
         // mail
         $this->mail->HrefValue = "";
         // tel
         $this->tel->HrefValue = "";
         // cel
         $this->cel->HrefValue = "";
         // cuit_cuil
         $this->cuit_cuil->HrefValue = "";
     }
     if ($this->RowType == EW_ROWTYPE_ADD || $this->RowType == EW_ROWTYPE_EDIT || $this->RowType == EW_ROWTYPE_SEARCH) {
         // Add / Edit / Search row
         $this->SetupFieldTitles();
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }
Example #30
0
 function RenderRow()
 {
     global $conn, $Security, $Language;
     global $gsLanguage;
     // Initialize URLs
     $this->AddUrl = $this->GetAddUrl();
     $this->EditUrl = $this->GetEditUrl();
     $this->CopyUrl = $this->GetCopyUrl();
     $this->DeleteUrl = $this->GetDeleteUrl();
     $this->ListUrl = $this->GetListUrl();
     $this->SetupOtherOptions();
     // Convert decimal values if posted back
     if ($this->monto->FormValue == $this->monto->CurrentValue && is_numeric(ew_StrToFloat($this->monto->CurrentValue))) {
         $this->monto->CurrentValue = ew_StrToFloat($this->monto->CurrentValue);
     }
     // Call Row_Rendering event
     $this->Row_Rendering();
     // Common render codes for all row types
     // id
     // mes
     // anio
     // fecha
     // monto
     // id_usuario
     // id_socio
     if ($this->RowType == EW_ROWTYPE_VIEW) {
         // View row
         // id
         $this->id->ViewCustomAttributes = "";
         // mes
         $this->mes->ViewValue = $this->mes->CurrentValue;
         $this->mes->ViewCustomAttributes = "";
         // anio
         $this->anio->ViewValue = $this->anio->CurrentValue;
         $this->anio->ViewCustomAttributes = "";
         // fecha
         $this->fecha->ViewValue = $this->fecha->CurrentValue;
         $this->fecha->ViewValue = ew_FormatDateTime($this->fecha->ViewValue, 7);
         $this->fecha->ViewCustomAttributes = "";
         // monto
         $this->monto->ViewValue = $this->monto->CurrentValue;
         $this->monto->ViewValue = ew_FormatCurrency($this->monto->ViewValue, 0, -2, -2, -2);
         $this->monto->ViewCustomAttributes = "";
         // id_socio
         if (strval($this->id_socio->CurrentValue) != "") {
             $sFilterWrk = "`socio_nro`" . ew_SearchString("=", $this->id_socio->CurrentValue, EW_DATATYPE_NUMBER);
             $sSqlWrk = "SELECT `socio_nro`, `propietario` AS `DispFld`, `comercio` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `socios`";
             $sWhereWrk = "";
             $lookuptblfilter = "`activo`='S'";
             if (strval($lookuptblfilter) != "") {
                 ew_AddFilter($sWhereWrk, $lookuptblfilter);
             }
             if ($sFilterWrk != "") {
                 ew_AddFilter($sWhereWrk, $sFilterWrk);
             }
             // Call Lookup selecting
             $this->Lookup_Selecting($this->id_socio, $sWhereWrk);
             if ($sWhereWrk != "") {
                 $sSqlWrk .= " WHERE " . $sWhereWrk;
             }
             $sSqlWrk .= " ORDER BY `propietario` DESC";
             $rswrk = $conn->Execute($sSqlWrk);
             if ($rswrk && !$rswrk->EOF) {
                 // Lookup values found
                 $this->id_socio->ViewValue = $rswrk->fields('DispFld');
                 $this->id_socio->ViewValue .= ew_ValueSeparator(1, $this->id_socio) . $rswrk->fields('Disp2Fld');
                 $rswrk->Close();
             } else {
                 $this->id_socio->ViewValue = $this->id_socio->CurrentValue;
             }
         } else {
             $this->id_socio->ViewValue = NULL;
         }
         $this->id_socio->ViewCustomAttributes = "";
         // id
         $this->id->LinkCustomAttributes = "";
         $this->id->HrefValue = "";
         $this->id->TooltipValue = "";
         // mes
         $this->mes->LinkCustomAttributes = "";
         $this->mes->HrefValue = "";
         $this->mes->TooltipValue = "";
         // anio
         $this->anio->LinkCustomAttributes = "";
         $this->anio->HrefValue = "";
         $this->anio->TooltipValue = "";
         // fecha
         $this->fecha->LinkCustomAttributes = "";
         $this->fecha->HrefValue = "";
         $this->fecha->TooltipValue = "";
         // monto
         $this->monto->LinkCustomAttributes = "";
         $this->monto->HrefValue = "";
         $this->monto->TooltipValue = "";
         // id_socio
         $this->id_socio->LinkCustomAttributes = "";
         $this->id_socio->HrefValue = "";
         $this->id_socio->TooltipValue = "";
     }
     // Call Row Rendered event
     if ($this->RowType != EW_ROWTYPE_AGGREGATEINIT) {
         $this->Row_Rendered();
     }
 }