function AddRow($rsold = NULL) { global $conn, $Language, $Security; // Begin transaction if ($this->getCurrentDetailTable() != "") { $conn->BeginTrans(); } // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // fecha $this->fecha->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha->CurrentValue, 7), NULL, FALSE); // idhabitacion $this->idhabitacion->SetDbValueDef($rsnew, $this->idhabitacion->CurrentValue, 0, strval($this->idhabitacion->CurrentValue) == ""); // idpaciente $this->idpaciente->SetDbValueDef($rsnew, $this->idpaciente->CurrentValue, 0, strval($this->idpaciente->CurrentValue) == ""); // es_operacion $this->es_operacion->SetDbValueDef($rsnew, $this->es_operacion->CurrentValue, "", strval($this->es_operacion->CurrentValue) == ""); // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } // Get insert id if necessary if ($AddRow) { $this->idinternado->setDbValue($conn->Insert_ID()); $rsnew['idinternado'] = $this->idinternado->DbValue; } // Add detail records if ($AddRow) { $DetailTblVar = explode(",", $this->getCurrentDetailTable()); if (in_array("internado_diario", $DetailTblVar) && $GLOBALS["internado_diario"]->DetailAdd) { $GLOBALS["internado_diario"]->idinternado->setSessionValue($this->idinternado->CurrentValue); // Set master key if (!isset($GLOBALS["internado_diario_grid"])) { $GLOBALS["internado_diario_grid"] = new cinternado_diario_grid(); } // Get detail page object $AddRow = $GLOBALS["internado_diario_grid"]->GridInsert(); if (!$AddRow) { $GLOBALS["internado_diario"]->idinternado->setSessionValue(""); } // Clear master key if insert failed } } // Commit/Rollback transaction if ($this->getCurrentDetailTable() != "") { if ($AddRow) { $conn->CommitTrans(); // Commit transaction } else { $conn->RollbackTrans(); // Rollback transaction } } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } return $AddRow; }
function AddRow($rsold = NULL) { global $conn, $Language, $Security; // Begin transaction if ($this->getCurrentDetailTable() != "") { $conn->BeginTrans(); } // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // descripcion $this->descripcion->SetDbValueDef($rsnew, $this->descripcion->CurrentValue, NULL, FALSE); // importe $this->importe->SetDbValueDef($rsnew, $this->importe->CurrentValue, NULL, FALSE); // fecha_creacion $this->fecha_creacion->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha_creacion->CurrentValue, 7), NULL, FALSE); // activa $this->activa->SetDbValueDef($rsnew, $this->activa->CurrentValue, NULL, strval($this->activa->CurrentValue) == ""); // id_usuario if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin $rsnew['id_usuario'] = CurrentUserID(); } // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } // Get insert id if necessary if ($AddRow) { $this->id->setDbValue($conn->Insert_ID()); $rsnew['id'] = $this->id->DbValue; } // Add detail records if ($AddRow) { $DetailTblVar = explode(",", $this->getCurrentDetailTable()); if (in_array("socios_cuotas", $DetailTblVar) && $GLOBALS["socios_cuotas"]->DetailAdd) { $GLOBALS["socios_cuotas"]->id_montos->setSessionValue($this->id->CurrentValue); // Set master key if (!isset($GLOBALS["socios_cuotas_grid"])) { $GLOBALS["socios_cuotas_grid"] = new csocios_cuotas_grid(); } // Get detail page object $AddRow = $GLOBALS["socios_cuotas_grid"]->GridInsert(); if (!$AddRow) { $GLOBALS["socios_cuotas"]->id_montos->setSessionValue(""); } // Clear master key if insert failed } } // Commit/Rollback transaction if ($this->getCurrentDetailTable() != "") { if ($AddRow) { $conn->CommitTrans(); // Commit transaction } else { $conn->RollbackTrans(); // Rollback transaction } } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); $this->WriteAuditTrailOnAdd($rsnew); } return $AddRow; }
function EditRow() { global $Security, $Language; $sFilter = $this->KeyFilter(); $sFilter = $this->ApplyUserIDFilters($sFilter); $conn =& $this->Connection(); $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } if ($rs->EOF) { $this->setFailureMessage($Language->Phrase("NoRecord")); // Set no record message $EditRow = FALSE; // Update Failed } else { // Save old values $rsold =& $rs->fields; $this->LoadDbValues($rsold); $rsnew = array(); // name $this->name->SetDbValueDef($rsnew, $this->name->CurrentValue, "", $this->name->ReadOnly); // email $this->_email->SetDbValueDef($rsnew, $this->_email->CurrentValue, "", $this->_email->ReadOnly); // joined $this->joined->SetDbValueDef($rsnew, ew_CurrentUserIP(), 0); $rsnew['joined'] =& $this->joined->DbValue; // facebook $this->facebook->SetDbValueDef($rsnew, $this->facebook->CurrentValue, NULL, $this->facebook->ReadOnly); // twitter $this->twitter->SetDbValueDef($rsnew, $this->twitter->CurrentValue, NULL, $this->twitter->ReadOnly); // twitch $this->twitch->SetDbValueDef($rsnew, $this->twitch->CurrentValue, NULL, $this->twitch->ReadOnly); // skype $this->skype->SetDbValueDef($rsnew, $this->skype->CurrentValue, NULL, $this->skype->ReadOnly); // birthday $this->birthday->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->birthday->CurrentValue, 5), NULL, $this->birthday->ReadOnly); // profession $this->profession->SetDbValueDef($rsnew, $this->profession->CurrentValue, NULL, $this->profession->ReadOnly); // game_type $this->game_type->SetDbValueDef($rsnew, $this->game_type->CurrentValue, NULL, $this->game_type->ReadOnly); // division $this->division->SetDbValueDef($rsnew, $this->division->CurrentValue, NULL, $this->division->ReadOnly); // has_expansion $this->has_expansion->SetDbValueDef($rsnew, $this->has_expansion->CurrentValue, "", $this->has_expansion->ReadOnly); // notes $this->notes->SetDbValueDef($rsnew, $this->notes->CurrentValue, NULL, $this->notes->ReadOnly); // Call Row Updating event $bUpdateRow = $this->Row_Updating($rsold, $rsnew); if ($bUpdateRow) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; if (count($rsnew) > 0) { $EditRow = $this->Update($rsnew, "", $rsold); } else { $EditRow = TRUE; } // No field to update $conn->raiseErrorFn = ''; if ($EditRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("UpdateCancelled")); } $EditRow = FALSE; } } // Call Row_Updated event if ($EditRow) { $this->Row_Updated($rsold, $rsnew); } $rs->Close(); return $EditRow; }
function AddRow($rsold = NULL) { global $conn, $Language, $Security; // Set up foreign key field value from Session if ($this->getCurrentMasterTable() == "hoja_mantenimientos") { $this->id_hoja_mantenimiento->CurrentValue = $this->id_hoja_mantenimiento->getSessionValue(); } // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // fecha $this->fecha->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha->CurrentValue, 7), NULL, FALSE); // detalles $this->detalles->SetDbValueDef($rsnew, $this->detalles->CurrentValue, NULL, FALSE); // iva $this->iva->SetDbValueDef($rsnew, $this->iva->CurrentValue, NULL, FALSE); // Importe $this->Importe->SetDbValueDef($rsnew, $this->Importe->CurrentValue, NULL, FALSE); // id_tipo_gasto $this->id_tipo_gasto->SetDbValueDef($rsnew, $this->id_tipo_gasto->CurrentValue, NULL, FALSE); // id_hoja_mantenimiento $this->id_hoja_mantenimiento->SetDbValueDef($rsnew, $this->id_hoja_mantenimiento->CurrentValue, NULL, FALSE); // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } // Get insert id if necessary if ($AddRow) { $this->codigo->setDbValue($conn->Insert_ID()); $rsnew['codigo'] = $this->codigo->DbValue; } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } return $AddRow; }
function AddRow($rsold = NULL) { global $conn, $Language, $Security; // Check if valid key values for master user if ($Security->CurrentUserID() != "" && !$Security->IsAdmin()) { // Non system admin $sMasterFilter = $this->SqlMasterFilter_socios(); if (strval($this->id_socio->CurrentValue) != "" && $this->getCurrentMasterTable() == "socios") { $sMasterFilter = str_replace("@socio_nro@", ew_AdjustSql($this->id_socio->CurrentValue), $sMasterFilter); } else { $sMasterFilter = ""; } if ($sMasterFilter != "") { $rsmaster = $GLOBALS["socios"]->LoadRs($sMasterFilter); $this->MasterRecordExists = $rsmaster && !$rsmaster->EOF; if (!$this->MasterRecordExists) { $sMasterUserIdMsg = str_replace("%c", CurrentUserID(), $Language->Phrase("UnAuthorizedMasterUserID")); $sMasterUserIdMsg = str_replace("%f", $sMasterFilter, $sMasterUserIdMsg); $this->setFailureMessage($sMasterUserIdMsg); return FALSE; } else { $rsmaster->Close(); } } } // Check referential integrity for master table 'socios' $bValidMasterRecord = TRUE; $sMasterFilter = $this->SqlMasterFilter_socios(); if (strval($this->id_socio->CurrentValue) != "") { $sMasterFilter = str_replace("@socio_nro@", ew_AdjustSql($this->id_socio->CurrentValue), $sMasterFilter); } else { $bValidMasterRecord = FALSE; } if ($bValidMasterRecord) { $rsmaster = $GLOBALS["socios"]->LoadRs($sMasterFilter); $bValidMasterRecord = $rsmaster && !$rsmaster->EOF; $rsmaster->Close(); } if (!$bValidMasterRecord) { $sRelatedRecordMsg = str_replace("%t", "socios", $Language->Phrase("RelatedRecordRequired")); $this->setFailureMessage($sRelatedRecordMsg); return FALSE; } // Begin transaction if ($this->getCurrentDetailTable() != "") { $conn->BeginTrans(); } // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // mes $this->mes->SetDbValueDef($rsnew, $this->mes->CurrentValue, NULL, FALSE); // anio $this->anio->SetDbValueDef($rsnew, $this->anio->CurrentValue, NULL, FALSE); // fecha $this->fecha->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha->CurrentValue, 7), NULL, FALSE); // monto $this->monto->SetDbValueDef($rsnew, $this->monto->CurrentValue, NULL, FALSE); // id_socio $this->id_socio->SetDbValueDef($rsnew, $this->id_socio->CurrentValue, NULL, FALSE); // id_usuario if (!$Security->IsAdmin() && $Security->IsLoggedIn()) { // Non system admin $rsnew['id_usuario'] = CurrentUserID(); } // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } // Get insert id if necessary if ($AddRow) { $this->id->setDbValue($conn->Insert_ID()); $rsnew['id'] = $this->id->DbValue; } // Add detail records if ($AddRow) { $DetailTblVar = explode(",", $this->getCurrentDetailTable()); if (in_array("detalle_deudas", $DetailTblVar) && $GLOBALS["detalle_deudas"]->DetailAdd) { $GLOBALS["detalle_deudas"]->id_deuda->setSessionValue($this->id->CurrentValue); // Set master key if (!isset($GLOBALS["detalle_deudas_grid"])) { $GLOBALS["detalle_deudas_grid"] = new cdetalle_deudas_grid(); } // Get detail page object $AddRow = $GLOBALS["detalle_deudas_grid"]->GridInsert(); if (!$AddRow) { $GLOBALS["detalle_deudas"]->id_deuda->setSessionValue(""); } // Clear master key if insert failed } if (in_array("pagos", $DetailTblVar) && $GLOBALS["pagos"]->DetailAdd) { $GLOBALS["pagos"]->id_deuda->setSessionValue($this->id->CurrentValue); // Set master key if (!isset($GLOBALS["pagos_grid"])) { $GLOBALS["pagos_grid"] = new cpagos_grid(); } // Get detail page object $AddRow = $GLOBALS["pagos_grid"]->GridInsert(); if (!$AddRow) { $GLOBALS["pagos"]->id_deuda->setSessionValue(""); } // Clear master key if insert failed } } // Commit/Rollback transaction if ($this->getCurrentDetailTable() != "") { if ($AddRow) { $conn->CommitTrans(); // Commit transaction } else { $conn->RollbackTrans(); // Rollback transaction } } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); $this->WriteAuditTrailOnAdd($rsnew); } return $AddRow; }
function EditRow() { global $conn, $Security, $patient_main; $sFilter = $patient_main->KeyFilter(); $patient_main->CurrentFilter = $sFilter; $sSql = $patient_main->SQL(); $conn->raiseErrorFn = 'ew_ErrorFn'; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } if ($rs->EOF) { $EditRow = FALSE; // Update Failed } else { // Save old values $rsold =& $rs->fields; $rsnew = array(); // Field PatientMainNo // Field PatientID $patient_main->PatientID->SetDbValueDef($patient_main->PatientID->CurrentValue, ""); $rsnew['PatientID'] =& $patient_main->PatientID->DbValue; // Field PatientName $patient_main->PatientName->SetDbValueDef($patient_main->PatientName->CurrentValue, ""); $rsnew['PatientName'] =& $patient_main->PatientName->DbValue; // Field PatientBirthDate $patient_main->PatientBirthDate->SetDbValueDef(ew_UnFormatDateTime($patient_main->PatientBirthDate->CurrentValue, 5), NULL); $rsnew['PatientBirthDate'] =& $patient_main->PatientBirthDate->DbValue; // Field PatientSex $patient_main->PatientSex->SetDbValueDef($patient_main->PatientSex->CurrentValue, ""); $rsnew['PatientSex'] =& $patient_main->PatientSex->DbValue; // Field OtherPatientID $patient_main->OtherPatientID->SetDbValueDef($patient_main->OtherPatientID->CurrentValue, NULL); $rsnew['OtherPatientID'] =& $patient_main->OtherPatientID->DbValue; // Call Row Updating event $bUpdateRow = $patient_main->Row_Updating($rsold, $rsnew); if ($bUpdateRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $EditRow = $conn->Execute($patient_main->UpdateSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($patient_main->CancelMessage != "") { $this->setMessage($patient_main->CancelMessage); $patient_main->CancelMessage = ""; } else { $this->setMessage("Update cancelled"); } $EditRow = FALSE; } } // Call Row_Updated event if ($EditRow) { $patient_main->Row_Updated($rsold, $rsnew); } $rs->Close(); return $EditRow; }
$Delivery_Report_1_report->sFilter = ""; if ($Delivery_Report_1_report->sFilter != "") { $Delivery_Report_1_report->sFilter .= " AND "; } if (is_null(ew_UnFormatDateTime(ew_FormatDateTime($Delivery_Report_1->PublishedDate->CurrentValue, 6), 6))) { $Delivery_Report_1_report->sFilter .= "(`PublishedDate` IS NULL)"; } else { $Delivery_Report_1_report->sFilter .= "(`PublishedDate` = '" . ew_AdjustSql(ew_UnFormatDateTime(ew_FormatDateTime($Delivery_Report_1->PublishedDate->CurrentValue, 6), 6)) . "')"; } if ($Delivery_Report_1_report->sFilter != "") { $Delivery_Report_1_report->sFilter .= " AND "; } if (is_null(ew_UnFormatDateTime(ew_FormatDateTime($Delivery_Report_1->DeliveryDate->CurrentValue, 6), 6))) { $Delivery_Report_1_report->sFilter .= "(`DeliveryDate` IS NULL)"; } else { $Delivery_Report_1_report->sFilter .= "(`DeliveryDate` = '" . ew_AdjustSql(ew_UnFormatDateTime(ew_FormatDateTime($Delivery_Report_1->DeliveryDate->CurrentValue, 6), 6)) . "')"; } if ($Delivery_Report_1_report->sFilter != "") { $Delivery_Report_1_report->sFilter .= " AND "; } if (is_null($Delivery_Report_1->Delivery_Window->CurrentValue)) { $Delivery_Report_1_report->sFilter .= "(`Delivery_Window` IS NULL)"; } else { $Delivery_Report_1_report->sFilter .= "(`Delivery_Window` = '" . ew_AdjustSql($Delivery_Report_1->Delivery_Window->CurrentValue) . "')"; } if ($Delivery_Report_1_report->sDbDetailFilter != "") { if ($Delivery_Report_1_report->sFilter != "") { $Delivery_Report_1_report->sFilter .= " AND "; } $Delivery_Report_1_report->sFilter .= "(" . $Delivery_Report_1_report->sDbDetailFilter . ")"; }
function AddRow() { global $conn, $Security, $archives; // Check for duplicate key $bCheckKey = TRUE; $sFilter = $archives->SqlKeyFilter(); if (trim(strval($archives->id->CurrentValue)) == "") { $bCheckKey = FALSE; } else { $sFilter = str_replace("@id@", ew_AdjustSql($archives->id->CurrentValue), $sFilter); // Replace key value } if (!is_numeric($archives->id->CurrentValue)) { $bCheckKey = FALSE; } if ($bCheckKey) { $rsChk = $archives->LoadRs($sFilter); if ($rsChk && !$rsChk->EOF) { $_SESSION[EW_SESSION_MESSAGE] = "Duplicate value for primary key"; $rsChk->Close(); return FALSE; } } $rsnew = array(); // Field url $archives->url->SetDbValueDef($archives->url->CurrentValue, ""); $rsnew['url'] =& $archives->url->DbValue; // Field projectname $archives->projectname->SetDbValueDef($archives->projectname->CurrentValue, NULL); $rsnew['projectname'] =& $archives->projectname->DbValue; // Field title $archives->title->SetDbValueDef($archives->title->CurrentValue, ""); $rsnew['title'] =& $archives->title->DbValue; // Field datetime $archives->datetime->SetDbValueDef(ew_UnFormatDateTime($archives->datetime->CurrentValue, 5), ew_CurrentDate()); $rsnew['datetime'] =& $archives->datetime->DbValue; // Field content $archives->content->SetDbValueDef($archives->content->CurrentValue, NULL); $rsnew['content'] =& $archives->content->DbValue; // Call Row Inserting event $bInsertRow = $archives->Row_Inserting($rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $conn->Execute($archives->InsertSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($archives->CancelMessage != "") { $_SESSION[EW_SESSION_MESSAGE] = $archives->CancelMessage; $archives->CancelMessage = ""; } else { $_SESSION[EW_SESSION_MESSAGE] = "Insert cancelled"; } $AddRow = FALSE; } if ($AddRow) { $archives->id->setDbValue($conn->Insert_ID()); $rsnew['id'] =& $archives->id->DbValue; // Call Row Inserted event $archives->Row_Inserted($rsnew); } return $AddRow; }
function EditRow() { global $conn, $Security, $Notifications; $sFilter = $Notifications->KeyFilter(); $Notifications->CurrentFilter = $sFilter; $sSql = $Notifications->SQL(); $conn->raiseErrorFn = 'ew_ErrorFn'; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } if ($rs->EOF) { $EditRow = FALSE; // Update Failed } else { // Save old values $rsold =& $rs->fields; $rsnew = array(); // Field ZipCode // Field Email // Field Location $Notifications->Location->SetDbValueDef($Notifications->Location->CurrentValue, NULL); $rsnew['Location'] =& $Notifications->Location->DbValue; // Field Timestamp $Notifications->Timestamp->SetDbValueDef(ew_UnFormatDateTime($Notifications->Timestamp->CurrentValue, 6), ew_CurrentDate()); $rsnew['Timestamp'] =& $Notifications->Timestamp->DbValue; // Call Row Updating event $bUpdateRow = $Notifications->Row_Updating($rsold, $rsnew); if ($bUpdateRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $EditRow = $conn->Execute($Notifications->UpdateSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($Notifications->CancelMessage != "") { $this->setMessage($Notifications->CancelMessage); $Notifications->CancelMessage = ""; } else { $this->setMessage("Update cancelled"); } $EditRow = FALSE; } } // Call Row_Updated event if ($EditRow) { $Notifications->Row_Updated($rsold, $rsnew); } $rs->Close(); return $EditRow; }
function RenderRow() { global $conn, $Security, $Orders; // Call Row_Rendering event $Orders->Row_Rendering(); // Common render codes for all row types // OrderID $Orders->OrderID->CellCssStyle = ""; $Orders->OrderID->CellCssClass = ""; // CustomerID $Orders->CustomerID->CellCssStyle = ""; $Orders->CustomerID->CellCssClass = ""; // TransactionNumber $Orders->TransactionNumber->CellCssStyle = ""; $Orders->TransactionNumber->CellCssClass = ""; // DateOrdered $Orders->DateOrdered->CellCssStyle = ""; $Orders->DateOrdered->CellCssClass = ""; // Total $Orders->Total->CellCssStyle = ""; $Orders->Total->CellCssClass = ""; // DeliveryDate $Orders->DeliveryDate->CellCssStyle = ""; $Orders->DeliveryDate->CellCssClass = ""; // PromoCodeID $Orders->PromoCodeID->CellCssStyle = ""; $Orders->PromoCodeID->CellCssClass = ""; // Sequence $Orders->Sequence->CellCssStyle = ""; $Orders->Sequence->CellCssClass = ""; if ($Orders->RowType == EW_ROWTYPE_VIEW) { // View row // OrderID $Orders->OrderID->ViewValue = $Orders->OrderID->CurrentValue; $Orders->OrderID->CssStyle = ""; $Orders->OrderID->CssClass = ""; $Orders->OrderID->ViewCustomAttributes = ""; // CustomerID if (strval($Orders->CustomerID->CurrentValue) != "") { $sSqlWrk = "SELECT `LastName`, `FirstName` FROM `Customers` WHERE `CustomerID` = " . ew_AdjustSql($Orders->CustomerID->CurrentValue) . ""; $sSqlWrk .= " ORDER BY `LastName` Asc"; $rswrk = $conn->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup value(s) found $Orders->CustomerID->ViewValue = $rswrk->fields('LastName'); $Orders->CustomerID->ViewValue .= ew_ValueSeparator(0) . $rswrk->fields('FirstName'); $rswrk->Close(); } else { $Orders->CustomerID->ViewValue = $Orders->CustomerID->CurrentValue; } } else { $Orders->CustomerID->ViewValue = NULL; } $Orders->CustomerID->CssStyle = ""; $Orders->CustomerID->CssClass = ""; $Orders->CustomerID->ViewCustomAttributes = ""; // TransactionNumber $Orders->TransactionNumber->ViewValue = $Orders->TransactionNumber->CurrentValue; $Orders->TransactionNumber->CssStyle = ""; $Orders->TransactionNumber->CssClass = ""; $Orders->TransactionNumber->ViewCustomAttributes = ""; // DateOrdered $Orders->DateOrdered->ViewValue = $Orders->DateOrdered->CurrentValue; $Orders->DateOrdered->ViewValue = ew_FormatDateTime($Orders->DateOrdered->ViewValue, 6); $Orders->DateOrdered->CssStyle = ""; $Orders->DateOrdered->CssClass = ""; $Orders->DateOrdered->ViewCustomAttributes = ""; // Total $Orders->Total->ViewValue = $Orders->Total->CurrentValue; $Orders->Total->ViewValue = ew_FormatCurrency($Orders->Total->ViewValue, 2, -2, 0, -2); $Orders->Total->CssStyle = ""; $Orders->Total->CssClass = ""; $Orders->Total->ViewCustomAttributes = ""; // DeliveryDate $Orders->DeliveryDate->ViewValue = $Orders->DeliveryDate->CurrentValue; $Orders->DeliveryDate->ViewValue = ew_FormatDateTime($Orders->DeliveryDate->ViewValue, 6); $Orders->DeliveryDate->CssStyle = ""; $Orders->DeliveryDate->CssClass = ""; $Orders->DeliveryDate->ViewCustomAttributes = ""; // PromoCodeID if (strval($Orders->PromoCodeID->CurrentValue) != "") { $sSqlWrk = "SELECT `PromoCodeName` FROM `PromoCodes` WHERE `PromoCodeID` = " . ew_AdjustSql($Orders->PromoCodeID->CurrentValue) . ""; $sSqlWrk .= " ORDER BY `PromoCodeName` Asc"; $rswrk = $conn->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup value(s) found $Orders->PromoCodeID->ViewValue = $rswrk->fields('PromoCodeName'); $rswrk->Close(); } else { $Orders->PromoCodeID->ViewValue = $Orders->PromoCodeID->CurrentValue; } } else { $Orders->PromoCodeID->ViewValue = NULL; } $Orders->PromoCodeID->CssStyle = ""; $Orders->PromoCodeID->CssClass = ""; $Orders->PromoCodeID->ViewCustomAttributes = ""; // Sequence $Orders->Sequence->ViewValue = $Orders->Sequence->CurrentValue; $Orders->Sequence->CssStyle = ""; $Orders->Sequence->CssClass = ""; $Orders->Sequence->ViewCustomAttributes = ""; // OrderID $Orders->OrderID->HrefValue = ""; // CustomerID $Orders->CustomerID->HrefValue = ""; // TransactionNumber $Orders->TransactionNumber->HrefValue = ""; // DateOrdered $Orders->DateOrdered->HrefValue = ""; // Total $Orders->Total->HrefValue = ""; // DeliveryDate $Orders->DeliveryDate->HrefValue = ""; // PromoCodeID $Orders->PromoCodeID->HrefValue = ""; // Sequence $Orders->Sequence->HrefValue = ""; } elseif ($Orders->RowType == EW_ROWTYPE_SEARCH) { // Search row // OrderID $Orders->OrderID->EditCustomAttributes = ""; $Orders->OrderID->EditValue = ew_HtmlEncode($Orders->OrderID->AdvancedSearch->SearchValue); // CustomerID $Orders->CustomerID->EditCustomAttributes = ""; $Orders->CustomerID->EditCustomAttributes = ""; // TransactionNumber $Orders->TransactionNumber->EditCustomAttributes = ""; $Orders->TransactionNumber->EditValue = ew_HtmlEncode($Orders->TransactionNumber->AdvancedSearch->SearchValue); $Orders->TransactionNumber->EditCustomAttributes = ""; $Orders->TransactionNumber->EditValue2 = ew_HtmlEncode($Orders->TransactionNumber->AdvancedSearch->SearchValue2); // DateOrdered $Orders->DateOrdered->EditCustomAttributes = ""; $Orders->DateOrdered->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($Orders->DateOrdered->AdvancedSearch->SearchValue, 6), 6)); $Orders->DateOrdered->EditCustomAttributes = ""; $Orders->DateOrdered->EditValue2 = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($Orders->DateOrdered->AdvancedSearch->SearchValue2, 6), 6)); // Total $Orders->Total->EditCustomAttributes = ""; $Orders->Total->EditValue = ew_HtmlEncode($Orders->Total->AdvancedSearch->SearchValue); // DeliveryDate $Orders->DeliveryDate->EditCustomAttributes = ""; $Orders->DeliveryDate->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($Orders->DeliveryDate->AdvancedSearch->SearchValue, 6), 6)); // PromoCodeID $Orders->PromoCodeID->EditCustomAttributes = ""; // Sequence $Orders->Sequence->EditCustomAttributes = ""; $Orders->Sequence->EditValue = ew_HtmlEncode($Orders->Sequence->AdvancedSearch->SearchValue); } // Call Row Rendered event $Orders->Row_Rendered(); }
function ConvertSearchValue(&$Fld, $FldVal) { $Value = $FldVal; if ($Fld->FldDataType == EW_DATATYPE_DATE && $FldVal != "") { $Value = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat); } return $Value; }
function RestoreFormValues() { global $objForm, $tbl_twitter_stat; $this->LoadRow(); $tbl_twitter_stat->id_profile->CurrentValue = $tbl_twitter_stat->id_profile->FormValue; $tbl_twitter_stat->stat_date->CurrentValue = $tbl_twitter_stat->stat_date->FormValue; $tbl_twitter_stat->stat_date->CurrentValue = ew_UnFormatDateTime($tbl_twitter_stat->stat_date->CurrentValue, 5); $tbl_twitter_stat->year->CurrentValue = $tbl_twitter_stat->year->FormValue; $tbl_twitter_stat->month->CurrentValue = $tbl_twitter_stat->month->FormValue; $tbl_twitter_stat->week->CurrentValue = $tbl_twitter_stat->week->FormValue; $tbl_twitter_stat->following->CurrentValue = $tbl_twitter_stat->following->FormValue; $tbl_twitter_stat->followers->CurrentValue = $tbl_twitter_stat->followers->FormValue; $tbl_twitter_stat->listed->CurrentValue = $tbl_twitter_stat->listed->FormValue; $tbl_twitter_stat->tweets->CurrentValue = $tbl_twitter_stat->tweets->FormValue; }
function AddRow() { global $conn, $Security, $Notifications; // Check if key value entered if ($Notifications->ZipCode->CurrentValue == "") { $this->setMessage("Invalid key value"); return FALSE; } // Check if key value entered if ($Notifications->zEmail->CurrentValue == "") { $this->setMessage("Invalid key value"); return FALSE; } // Check for duplicate key $bCheckKey = TRUE; $sFilter = $Notifications->KeyFilter(); if ($bCheckKey) { $rsChk = $Notifications->LoadRs($sFilter); if ($rsChk && !$rsChk->EOF) { $sKeyErrMsg = str_replace("%f", $sFilter, "Duplicate primary key: '%f'"); $this->setMessage($sKeyErrMsg); $rsChk->Close(); return FALSE; } } $rsnew = array(); // Field ZipCode $Notifications->ZipCode->SetDbValueDef($Notifications->ZipCode->CurrentValue, 0); $rsnew['ZipCode'] =& $Notifications->ZipCode->DbValue; // Field Email $Notifications->zEmail->SetDbValueDef($Notifications->zEmail->CurrentValue, ""); $rsnew['Email'] =& $Notifications->zEmail->DbValue; // Field Location $Notifications->Location->SetDbValueDef($Notifications->Location->CurrentValue, NULL); $rsnew['Location'] =& $Notifications->Location->DbValue; // Field Timestamp $Notifications->Timestamp->SetDbValueDef(ew_UnFormatDateTime($Notifications->Timestamp->CurrentValue, 6), ew_CurrentDate()); $rsnew['Timestamp'] =& $Notifications->Timestamp->DbValue; // Call Row Inserting event $bInsertRow = $Notifications->Row_Inserting($rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $conn->Execute($Notifications->InsertSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($Notifications->CancelMessage != "") { $this->setMessage($Notifications->CancelMessage); $Notifications->CancelMessage = ""; } else { $this->setMessage("Insert cancelled"); } $AddRow = FALSE; } if ($AddRow) { // Call Row Inserted event $Notifications->Row_Inserted($rsnew); } return $AddRow; }
function RestoreFormValues() { global $objForm, $bookpost; $bookpost->bookid->CurrentValue = $bookpost->bookid->FormValue; $bookpost->name->CurrentValue = $bookpost->name->FormValue; $bookpost->cata->CurrentValue = $bookpost->cata->FormValue; $bookpost->author->CurrentValue = $bookpost->author->FormValue; $bookpost->publisher->CurrentValue = $bookpost->publisher->FormValue; $bookpost->info->CurrentValue = $bookpost->info->FormValue; $bookpost->code->CurrentValue = $bookpost->code->FormValue; $bookpost->pic->CurrentValue = $bookpost->pic->FormValue; $bookpost->useremail->CurrentValue = $bookpost->useremail->FormValue; $bookpost->price->CurrentValue = $bookpost->price->FormValue; $bookpost->datatime->CurrentValue = $bookpost->datatime->FormValue; $bookpost->datatime->CurrentValue = ew_UnFormatDateTime($bookpost->datatime->CurrentValue, 5); $bookpost->hidden->CurrentValue = $bookpost->hidden->FormValue; }
function AddRow() { global $conn, $Security, $Orders; $rsnew = array(); // Field CustomerID $Orders->CustomerID->SetDbValueDef($Orders->CustomerID->CurrentValue, 0); $rsnew['CustomerID'] =& $Orders->CustomerID->DbValue; // Field TransactionNumber $Orders->TransactionNumber->SetDbValueDef($Orders->TransactionNumber->CurrentValue, NULL); $rsnew['TransactionNumber'] =& $Orders->TransactionNumber->DbValue; // Field DateOrdered $Orders->DateOrdered->SetDbValueDef(ew_UnFormatDateTime($Orders->DateOrdered->CurrentValue, 6), ew_CurrentDate()); $rsnew['DateOrdered'] =& $Orders->DateOrdered->DbValue; // Field Total $Orders->Total->SetDbValueDef($Orders->Total->CurrentValue, 0); $rsnew['Total'] =& $Orders->Total->DbValue; // Field DeliveryDate $Orders->DeliveryDate->SetDbValueDef(ew_UnFormatDateTime($Orders->DeliveryDate->CurrentValue, 6), ew_CurrentDate()); $rsnew['DeliveryDate'] =& $Orders->DeliveryDate->DbValue; // Field PromoCodeID $Orders->PromoCodeID->SetDbValueDef($Orders->PromoCodeID->CurrentValue, NULL); $rsnew['PromoCodeID'] =& $Orders->PromoCodeID->DbValue; // Field Timestamp $Orders->Timestamp->SetDbValueDef(ew_UnFormatDateTime($Orders->Timestamp->CurrentValue, 6), ew_CurrentDate()); $rsnew['Timestamp'] =& $Orders->Timestamp->DbValue; // Field Sequence $Orders->Sequence->SetDbValueDef($Orders->Sequence->CurrentValue, NULL); $rsnew['Sequence'] =& $Orders->Sequence->DbValue; // Call Row Inserting event $bInsertRow = $Orders->Row_Inserting($rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $conn->Execute($Orders->InsertSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($Orders->CancelMessage != "") { $this->setMessage($Orders->CancelMessage); $Orders->CancelMessage = ""; } else { $this->setMessage("Insert cancelled"); } $AddRow = FALSE; } if ($AddRow) { $Orders->OrderID->setDbValue($conn->Insert_ID()); $rsnew['OrderID'] =& $Orders->OrderID->DbValue; // Call Row Inserted event $Orders->Row_Inserted($rsnew); } return $AddRow; }
function AddRow($rsold = NULL) { global $Language, $Security; $conn =& $this->Connection(); // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // PATH if ($this->PATH->Visible && !$this->PATH->Upload->KeepFile) { $this->PATH->Upload->DbValue = ""; // No need to delete old file if ($this->PATH->Upload->FileName == "") { $rsnew['PATH'] = NULL; } else { $rsnew['PATH'] = $this->PATH->Upload->FileName; } } // PROCESS $this->PROCESS->SetDbValueDef($rsnew, $this->PROCESS->CurrentValue, 0, FALSE); // BANK_ACCOUNT_ID $this->BANK_ACCOUNT_ID->SetDbValueDef($rsnew, $this->BANK_ACCOUNT_ID->CurrentValue, 0, FALSE); // UPLOAD_FILE_STATUS_ID $this->UPLOAD_FILE_STATUS_ID->SetDbValueDef($rsnew, $this->UPLOAD_FILE_STATUS_ID->CurrentValue, 0, FALSE); // DATETIME $this->DATETIME->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->DATETIME->CurrentValue, 7), ew_CurrentDate(), FALSE); if ($this->PATH->Visible && !$this->PATH->Upload->KeepFile) { if (!ew_Empty($this->PATH->Upload->Value)) { $rsnew['PATH'] = ew_UploadFileNameEx(ew_UploadPathEx(TRUE, $this->PATH->UploadPath), $rsnew['PATH']); // Get new file name } } // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { // Get insert id if necessary $this->UPLOAD_FILE_ID->setDbValue($conn->Insert_ID()); $rsnew['UPLOAD_FILE_ID'] = $this->UPLOAD_FILE_ID->DbValue; if ($this->PATH->Visible && !$this->PATH->Upload->KeepFile) { if (!ew_Empty($this->PATH->Upload->Value)) { $this->PATH->Upload->SaveToFile($this->PATH->UploadPath, $rsnew['PATH'], TRUE); } } } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } // PATH ew_CleanUploadTempPath($this->PATH, $this->PATH->Upload->Index); return $AddRow; }
function EditRow() { global $conn, $Security, $PromoCodes; $sFilter = $PromoCodes->KeyFilter(); $PromoCodes->CurrentFilter = $sFilter; $sSql = $PromoCodes->SQL(); $conn->raiseErrorFn = 'ew_ErrorFn'; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } if ($rs->EOF) { $EditRow = FALSE; // Update Failed } else { // Save old values $rsold =& $rs->fields; $rsnew = array(); // Field PromoCodeID // Field PromoCodeName $PromoCodes->PromoCodeName->SetDbValueDef($PromoCodes->PromoCodeName->CurrentValue, ""); $rsnew['PromoCodeName'] =& $PromoCodes->PromoCodeName->DbValue; // Field PromoCodeType $PromoCodes->PromoCodeType->SetDbValueDef($PromoCodes->PromoCodeType->CurrentValue, ""); $rsnew['PromoCodeType'] =& $PromoCodes->PromoCodeType->DbValue; // Field Amount $PromoCodes->Amount->SetDbValueDef($PromoCodes->Amount->CurrentValue, 0); $rsnew['Amount'] =& $PromoCodes->Amount->DbValue; // Field ValidFrom $PromoCodes->ValidFrom->SetDbValueDef(ew_UnFormatDateTime($PromoCodes->ValidFrom->CurrentValue, 6), ew_CurrentDate()); $rsnew['ValidFrom'] =& $PromoCodes->ValidFrom->DbValue; // Field ValidTo $PromoCodes->ValidTo->SetDbValueDef(ew_UnFormatDateTime($PromoCodes->ValidTo->CurrentValue, 6), NULL); $rsnew['ValidTo'] =& $PromoCodes->ValidTo->DbValue; // Field Message $PromoCodes->Message->SetDbValueDef($PromoCodes->Message->CurrentValue, NULL); $rsnew['Message'] =& $PromoCodes->Message->DbValue; // Field One_Time_Only $PromoCodes->One_Time_Only->SetDbValueDef($PromoCodes->One_Time_Only->CurrentValue, ""); $rsnew['One_Time_Only'] =& $PromoCodes->One_Time_Only->DbValue; // Field New_Customer_Only $PromoCodes->New_Customer_Only->SetDbValueDef($PromoCodes->New_Customer_Only->CurrentValue, ""); $rsnew['New_Customer_Only'] =& $PromoCodes->New_Customer_Only->DbValue; // Field multiple_use $PromoCodes->multiple_use->SetDbValueDef($PromoCodes->multiple_use->CurrentValue, 0); $rsnew['multiple_use'] =& $PromoCodes->multiple_use->DbValue; // Call Row Updating event $bUpdateRow = $PromoCodes->Row_Updating($rsold, $rsnew); if ($bUpdateRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $EditRow = $conn->Execute($PromoCodes->UpdateSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($PromoCodes->CancelMessage != "") { $this->setMessage($PromoCodes->CancelMessage); $PromoCodes->CancelMessage = ""; } else { $this->setMessage("Update cancelled"); } $EditRow = FALSE; } } // Call Row_Updated event if ($EditRow) { $PromoCodes->Row_Updated($rsold, $rsnew); } $rs->Close(); return $EditRow; }
function EditRow() { global $conn, $Security, $GiftCertificates; $sFilter = $GiftCertificates->KeyFilter(); $GiftCertificates->CurrentFilter = $sFilter; $sSql = $GiftCertificates->SQL(); $conn->raiseErrorFn = 'ew_ErrorFn'; $rs = $conn->Execute($sSql); $conn->raiseErrorFn = ''; if ($rs === FALSE) { return FALSE; } if ($rs->EOF) { $EditRow = FALSE; // Update Failed } else { // Save old values $rsold =& $rs->fields; $rsnew = array(); // Field GiftCertificateID // Field CustomerID $GiftCertificates->CustomerID->SetDbValueDef($GiftCertificates->CustomerID->CurrentValue, 0); $rsnew['CustomerID'] =& $GiftCertificates->CustomerID->DbValue; // Field GiftEmail $GiftCertificates->GiftEmail->SetDbValueDef($GiftCertificates->GiftEmail->CurrentValue, NULL); $rsnew['GiftEmail'] =& $GiftCertificates->GiftEmail->DbValue; // Field GiftPhone $GiftCertificates->GiftPhone->SetDbValueDef($GiftCertificates->GiftPhone->CurrentValue, NULL); $rsnew['GiftPhone'] =& $GiftCertificates->GiftPhone->DbValue; // Field GiftFirstName $GiftCertificates->GiftFirstName->SetDbValueDef($GiftCertificates->GiftFirstName->CurrentValue, ""); $rsnew['GiftFirstName'] =& $GiftCertificates->GiftFirstName->DbValue; // Field GiftLastName $GiftCertificates->GiftLastName->SetDbValueDef($GiftCertificates->GiftLastName->CurrentValue, ""); $rsnew['GiftLastName'] =& $GiftCertificates->GiftLastName->DbValue; // Field GiftAmount $GiftCertificates->GiftAmount->SetDbValueDef($GiftCertificates->GiftAmount->CurrentValue, 0); $rsnew['GiftAmount'] =& $GiftCertificates->GiftAmount->DbValue; // Field GiftMessage $GiftCertificates->GiftMessage->SetDbValueDef($GiftCertificates->GiftMessage->CurrentValue, NULL); $rsnew['GiftMessage'] =& $GiftCertificates->GiftMessage->DbValue; // Field GiftSendMethod $GiftCertificates->GiftSendMethod->SetDbValueDef($GiftCertificates->GiftSendMethod->CurrentValue, NULL); $rsnew['GiftSendMethod'] =& $GiftCertificates->GiftSendMethod->DbValue; // Field GiftSendAddress1 $GiftCertificates->GiftSendAddress1->SetDbValueDef($GiftCertificates->GiftSendAddress1->CurrentValue, NULL); $rsnew['GiftSendAddress1'] =& $GiftCertificates->GiftSendAddress1->DbValue; // Field GiftSendAddress2 $GiftCertificates->GiftSendAddress2->SetDbValueDef($GiftCertificates->GiftSendAddress2->CurrentValue, NULL); $rsnew['GiftSendAddress2'] =& $GiftCertificates->GiftSendAddress2->DbValue; // Field GiftSendCity $GiftCertificates->GiftSendCity->SetDbValueDef($GiftCertificates->GiftSendCity->CurrentValue, NULL); $rsnew['GiftSendCity'] =& $GiftCertificates->GiftSendCity->DbValue; // Field GiftSendState $GiftCertificates->GiftSendState->SetDbValueDef($GiftCertificates->GiftSendState->CurrentValue, NULL); $rsnew['GiftSendState'] =& $GiftCertificates->GiftSendState->DbValue; // Field GiftSendZip $GiftCertificates->GiftSendZip->SetDbValueDef($GiftCertificates->GiftSendZip->CurrentValue, NULL); $rsnew['GiftSendZip'] =& $GiftCertificates->GiftSendZip->DbValue; // Field GiftSendEmail $GiftCertificates->GiftSendEmail->SetDbValueDef($GiftCertificates->GiftSendEmail->CurrentValue, NULL); $rsnew['GiftSendEmail'] =& $GiftCertificates->GiftSendEmail->DbValue; // Field PromoCodeID $GiftCertificates->PromoCodeID->SetDbValueDef($GiftCertificates->PromoCodeID->CurrentValue, NULL); $rsnew['PromoCodeID'] =& $GiftCertificates->PromoCodeID->DbValue; // Field DateMailed $GiftCertificates->DateMailed->SetDbValueDef(ew_UnFormatDateTime($GiftCertificates->DateMailed->CurrentValue, 6), NULL); $rsnew['DateMailed'] =& $GiftCertificates->DateMailed->DbValue; // Field Redeemed $tmpBool = $GiftCertificates->Redeemed->CurrentValue; if ($tmpBool != "Y" && $tmpBool != "N") { $tmpBool = !empty($tmpBool) ? "Y" : "N"; } $GiftCertificates->Redeemed->SetDbValueDef($tmpBool, NULL); $rsnew['Redeemed'] =& $GiftCertificates->Redeemed->DbValue; // Call Row Updating event $bUpdateRow = $GiftCertificates->Row_Updating($rsold, $rsnew); if ($bUpdateRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $EditRow = $conn->Execute($GiftCertificates->UpdateSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($GiftCertificates->CancelMessage != "") { $this->setMessage($GiftCertificates->CancelMessage); $GiftCertificates->CancelMessage = ""; } else { $this->setMessage("Update cancelled"); } $EditRow = FALSE; } } // Call Row_Updated event if ($EditRow) { $GiftCertificates->Row_Updated($rsold, $rsnew); } $rs->Close(); return $EditRow; }
function KeyFilter() { $sKeyFilter = $this->SqlKeyFilter(); if (!is_numeric($this->id_profile->CurrentValue)) { $sKeyFilter = "0=1"; } // Invalid key $sKeyFilter = str_replace("@id_profile@", ew_AdjustSql($this->id_profile->CurrentValue), $sKeyFilter); // Replace key value $sKeyFilter = str_replace("@stat_date@", ew_AdjustSql(ew_UnFormatDateTime($this->stat_date->CurrentValue, 5)), $sKeyFilter); // Replace key value return $sKeyFilter; }
function AddRow($rsold = NULL) { global $Language, $Security; $conn =& $this->Connection(); // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // m_id $this->m_id->SetDbValueDef($rsnew, $this->m_id->CurrentValue, NULL, FALSE); // package_id $this->package_id->SetDbValueDef($rsnew, $this->package_id->CurrentValue, NULL, FALSE); // customer_name $this->customer_name->SetDbValueDef($rsnew, $this->customer_name->CurrentValue, NULL, FALSE); // customer_cell $this->customer_cell->SetDbValueDef($rsnew, $this->customer_cell->CurrentValue, NULL, FALSE); // date $this->date->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->date->CurrentValue, 7), ew_CurrentDate(), FALSE); // month $this->month->SetDbValueDef($rsnew, $this->month->CurrentValue, "", FALSE); // category $this->category->SetDbValueDef($rsnew, $this->category->CurrentValue, "", FALSE); // amount $this->amount->SetDbValueDef($rsnew, $this->amount->CurrentValue, 0, FALSE); // Details $this->Details->SetDbValueDef($rsnew, $this->Details->CurrentValue, "", FALSE); // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { // Get insert id if necessary $this->delivery_id->setDbValue($conn->Insert_ID()); $rsnew['delivery_id'] = $this->delivery_id->DbValue; } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } return $AddRow; }
function AddRow($rsold = NULL) { global $conn, $Language, $Security; // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // nombre $this->nombre->SetDbValueDef($rsnew, $this->nombre->CurrentValue, NULL, FALSE); // direccion $this->direccion->SetDbValueDef($rsnew, $this->direccion->CurrentValue, NULL, FALSE); // fecha_nacimiento $this->fecha_nacimiento->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha_nacimiento->CurrentValue, 7), NULL, FALSE); // tel $this->tel->SetDbValueDef($rsnew, $this->tel->CurrentValue, NULL, FALSE); // cel $this->cel->SetDbValueDef($rsnew, $this->cel->CurrentValue, NULL, FALSE); // email $this->_email->SetDbValueDef($rsnew, $this->_email->CurrentValue, NULL, FALSE); // fecha_inicio $this->fecha_inicio->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha_inicio->CurrentValue, 7), NULL, FALSE); // cetegoria $this->cetegoria->SetDbValueDef($rsnew, $this->cetegoria->CurrentValue, NULL, FALSE); // datos $this->datos->SetDbValueDef($rsnew, $this->datos->CurrentValue, NULL, FALSE); // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = $GLOBALS["EW_ERROR_FN"]; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } // Get insert id if necessary if ($AddRow) { $this->codigo->setDbValue($conn->Insert_ID()); $rsnew['codigo'] = $this->codigo->DbValue; } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } return $AddRow; }
function AddRow() { global $conn, $Language, $Security, $tbl_facebook_stat; // Check if key value entered if ($tbl_facebook_stat->id_profile->CurrentValue == "") { $this->setMessage($Language->Phrase("InvalidKeyValue")); return FALSE; } // Check if key value entered if ($tbl_facebook_stat->stat_date->CurrentValue == "") { $this->setMessage($Language->Phrase("InvalidKeyValue")); return FALSE; } // Check for duplicate key $bCheckKey = TRUE; $sFilter = $tbl_facebook_stat->KeyFilter(); if ($bCheckKey) { $rsChk = $tbl_facebook_stat->LoadRs($sFilter); if ($rsChk && !$rsChk->EOF) { $sKeyErrMsg = str_replace("%f", $sFilter, $Language->Phrase("DupKey")); $this->setMessage($sKeyErrMsg); $rsChk->Close(); return FALSE; } } $rsnew = array(); // id_profile $tbl_facebook_stat->id_profile->SetDbValueDef($rsnew, $tbl_facebook_stat->id_profile->CurrentValue, 0, FALSE); // stat_date $tbl_facebook_stat->stat_date->SetDbValueDef($rsnew, ew_UnFormatDateTime($tbl_facebook_stat->stat_date->CurrentValue, 5, FALSE), ew_CurrentDate()); // year $tbl_facebook_stat->year->SetDbValueDef($rsnew, $tbl_facebook_stat->year->CurrentValue, 0, FALSE); // month $tbl_facebook_stat->month->SetDbValueDef($rsnew, $tbl_facebook_stat->month->CurrentValue, 0, FALSE); // week $tbl_facebook_stat->week->SetDbValueDef($rsnew, $tbl_facebook_stat->week->CurrentValue, 0, FALSE); // interactions $tbl_facebook_stat->interactions->SetDbValueDef($rsnew, $tbl_facebook_stat->interactions->CurrentValue, 0, TRUE); // comments $tbl_facebook_stat->comments->SetDbValueDef($rsnew, $tbl_facebook_stat->comments->CurrentValue, 0, TRUE); // wallposts $tbl_facebook_stat->wallposts->SetDbValueDef($rsnew, $tbl_facebook_stat->wallposts->CurrentValue, 0, TRUE); // fans $tbl_facebook_stat->fans->SetDbValueDef($rsnew, $tbl_facebook_stat->fans->CurrentValue, 0, TRUE); // likes $tbl_facebook_stat->likes->SetDbValueDef($rsnew, $tbl_facebook_stat->likes->CurrentValue, 0, TRUE); // unsubscribe $tbl_facebook_stat->unsubscribe->SetDbValueDef($rsnew, $tbl_facebook_stat->unsubscribe->CurrentValue, 0, FALSE); // Call Row Inserting event $bInsertRow = $tbl_facebook_stat->Row_Inserting($rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $conn->Execute($tbl_facebook_stat->InsertSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($tbl_facebook_stat->CancelMessage != "") { $this->setMessage($tbl_facebook_stat->CancelMessage); $tbl_facebook_stat->CancelMessage = ""; } else { $this->setMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } if ($AddRow) { // Call Row Inserted event $tbl_facebook_stat->Row_Inserted($rsnew); } return $AddRow; }
function ConvertSearchValue(&$Fld, $FldVal) { if ($FldVal == EW_NULL_VALUE || $FldVal == EW_NOT_NULL_VALUE) { return $FldVal; } $Value = $FldVal; if ($Fld->FldDataType == EW_DATATYPE_BOOLEAN) { if ($FldVal != "") { $Value = $FldVal == "1" || strtolower(strval($FldVal)) == "y" || strtolower(strval($FldVal)) == "t" ? $Fld->TrueValue : $Fld->FalseValue; } } elseif ($Fld->FldDataType == EW_DATATYPE_DATE) { if ($FldVal != "") { $Value = ew_UnFormatDateTime($FldVal, $Fld->FldDateTimeFormat); } } return $Value; }
function RenderRow() { global $conn, $Security, $Language; global $gsLanguage; // Initialize URLs // 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 // id // descripcion // importe // fecha_creacion // activa // id_usuario if ($this->RowType == EW_ROWTYPE_VIEW) { // View row // id $this->id->ViewValue = $this->id->CurrentValue; $this->id->ViewCustomAttributes = ""; // descripcion $this->descripcion->ViewValue = $this->descripcion->CurrentValue; $this->descripcion->ViewCustomAttributes = ""; // importe $this->importe->ViewValue = $this->importe->CurrentValue; $this->importe->ViewValue = ew_FormatCurrency($this->importe->ViewValue, 0, -2, -2, -2); $this->importe->ViewCustomAttributes = ""; // fecha_creacion $this->fecha_creacion->ViewValue = $this->fecha_creacion->CurrentValue; $this->fecha_creacion->ViewValue = ew_FormatDateTime($this->fecha_creacion->ViewValue, 7); $this->fecha_creacion->ViewCustomAttributes = ""; // activa if (strval($this->activa->CurrentValue) != "") { switch ($this->activa->CurrentValue) { case $this->activa->FldTagValue(1): $this->activa->ViewValue = $this->activa->FldTagCaption(1) != "" ? $this->activa->FldTagCaption(1) : $this->activa->CurrentValue; break; case $this->activa->FldTagValue(2): $this->activa->ViewValue = $this->activa->FldTagCaption(2) != "" ? $this->activa->FldTagCaption(2) : $this->activa->CurrentValue; break; default: $this->activa->ViewValue = $this->activa->CurrentValue; } } else { $this->activa->ViewValue = NULL; } $this->activa->ViewCustomAttributes = ""; // id $this->id->LinkCustomAttributes = ""; $this->id->HrefValue = ""; $this->id->TooltipValue = ""; // descripcion $this->descripcion->LinkCustomAttributes = ""; $this->descripcion->HrefValue = ""; $this->descripcion->TooltipValue = ""; // importe $this->importe->LinkCustomAttributes = ""; $this->importe->HrefValue = ""; $this->importe->TooltipValue = ""; // fecha_creacion $this->fecha_creacion->LinkCustomAttributes = ""; $this->fecha_creacion->HrefValue = ""; $this->fecha_creacion->TooltipValue = ""; // activa $this->activa->LinkCustomAttributes = ""; $this->activa->HrefValue = ""; $this->activa->TooltipValue = ""; } elseif ($this->RowType == EW_ROWTYPE_SEARCH) { // Search row // id $this->id->EditAttrs["class"] = "form-control"; $this->id->EditCustomAttributes = ""; $this->id->EditValue = ew_HtmlEncode($this->id->AdvancedSearch->SearchValue); $this->id->PlaceHolder = ew_RemoveHtml($this->id->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()); // importe $this->importe->EditAttrs["class"] = "form-control"; $this->importe->EditCustomAttributes = ""; $this->importe->EditValue = ew_HtmlEncode($this->importe->AdvancedSearch->SearchValue); $this->importe->PlaceHolder = ew_RemoveHtml($this->importe->FldCaption()); // fecha_creacion $this->fecha_creacion->EditAttrs["class"] = "form-control"; $this->fecha_creacion->EditCustomAttributes = ""; $this->fecha_creacion->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($this->fecha_creacion->AdvancedSearch->SearchValue, 7), 7)); $this->fecha_creacion->PlaceHolder = ew_RemoveHtml($this->fecha_creacion->FldCaption()); // activa $this->activa->EditCustomAttributes = ""; $arwrk = array(); $arwrk[] = array($this->activa->FldTagValue(1), $this->activa->FldTagCaption(1) != "" ? $this->activa->FldTagCaption(1) : $this->activa->FldTagValue(1)); $arwrk[] = array($this->activa->FldTagValue(2), $this->activa->FldTagCaption(2) != "" ? $this->activa->FldTagCaption(2) : $this->activa->FldTagValue(2)); $this->activa->EditValue = $arwrk; } 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 AddRow($rsold = NULL) { global $conn, $Language, $Security; // Set up foreign key field value from Session if ($this->getCurrentMasterTable() == "paciente") { $this->idpaciente->CurrentValue = $this->idpaciente->getSessionValue(); } // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // idpaciente $this->idpaciente->SetDbValueDef($rsnew, $this->idpaciente->CurrentValue, 0, strval($this->idpaciente->CurrentValue) == ""); // fecha_inicio $this->fecha_inicio->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha_inicio->CurrentValue, 7), NULL, FALSE); // fecha_final $this->fecha_final->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->fecha_final->CurrentValue, 7), NULL, FALSE); // estado $this->estado->SetDbValueDef($rsnew, $this->estado->CurrentValue, "", strval($this->estado->CurrentValue) == ""); // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } // Get insert id if necessary if ($AddRow) { $this->idcuenta->setDbValue($conn->Insert_ID()); $rsnew['idcuenta'] = $this->idcuenta->DbValue; } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } return $AddRow; }
function AddRow() { global $conn, $Security, $patient_detail; $rsnew = array(); // Field StudyID $patient_detail->StudyID->SetDbValueDef($patient_detail->StudyID->CurrentValue, ""); $rsnew['StudyID'] =& $patient_detail->StudyID->DbValue; // Field PatientID $patient_detail->PatientID->SetDbValueDef($patient_detail->PatientID->CurrentValue, ""); $rsnew['PatientID'] =& $patient_detail->PatientID->DbValue; // Field StudyDate $patient_detail->StudyDate->SetDbValueDef(ew_UnFormatDateTime($patient_detail->StudyDate->CurrentValue, 5), NULL); $rsnew['StudyDate'] =& $patient_detail->StudyDate->DbValue; // Field ContentDate $patient_detail->ContentDate->SetDbValueDef(ew_UnFormatDateTime($patient_detail->ContentDate->CurrentValue, 5), NULL); $rsnew['ContentDate'] =& $patient_detail->ContentDate->DbValue; // Field StudyTime $patient_detail->StudyTime->SetDbValueDef(ew_FormatDateTime($patient_detail->StudyTime->CurrentValue, 4), NULL); $rsnew['StudyTime'] =& $patient_detail->StudyTime->DbValue; // Field ContentTime $patient_detail->ContentTime->SetDbValueDef(ew_FormatDateTime($patient_detail->ContentTime->CurrentValue, 4), NULL); $rsnew['ContentTime'] =& $patient_detail->ContentTime->DbValue; // Field InstitutionName $patient_detail->InstitutionName->SetDbValueDef($patient_detail->InstitutionName->CurrentValue, NULL); $rsnew['InstitutionName'] =& $patient_detail->InstitutionName->DbValue; // Field InstitutionAddress $patient_detail->InstitutionAddress->SetDbValueDef($patient_detail->InstitutionAddress->CurrentValue, NULL); $rsnew['InstitutionAddress'] =& $patient_detail->InstitutionAddress->DbValue; // Field InstitutionDepartmentName $patient_detail->InstitutionDepartmentName->SetDbValueDef($patient_detail->InstitutionDepartmentName->CurrentValue, NULL); $rsnew['InstitutionDepartmentName'] =& $patient_detail->InstitutionDepartmentName->DbValue; // Field Modality $patient_detail->Modality->SetDbValueDef($patient_detail->Modality->CurrentValue, NULL); $rsnew['Modality'] =& $patient_detail->Modality->DbValue; // Field OperatorName $patient_detail->OperatorName->SetDbValueDef($patient_detail->OperatorName->CurrentValue, NULL); $rsnew['OperatorName'] =& $patient_detail->OperatorName->DbValue; // Field Manufacturer $patient_detail->Manufacturer->SetDbValueDef($patient_detail->Manufacturer->CurrentValue, NULL); $rsnew['Manufacturer'] =& $patient_detail->Manufacturer->DbValue; // Field BodyPartExamined $patient_detail->BodyPartExamined->SetDbValueDef($patient_detail->BodyPartExamined->CurrentValue, NULL); $rsnew['BodyPartExamined'] =& $patient_detail->BodyPartExamined->DbValue; // Field ProtocolName $patient_detail->ProtocolName->SetDbValueDef($patient_detail->ProtocolName->CurrentValue, NULL); $rsnew['ProtocolName'] =& $patient_detail->ProtocolName->DbValue; // Field AccessionNumber $patient_detail->AccessionNumber->SetDbValueDef($patient_detail->AccessionNumber->CurrentValue, NULL); $rsnew['AccessionNumber'] =& $patient_detail->AccessionNumber->DbValue; // Field InstanceNumber $patient_detail->InstanceNumber->SetDbValueDef($patient_detail->InstanceNumber->CurrentValue, NULL); $rsnew['InstanceNumber'] =& $patient_detail->InstanceNumber->DbValue; // Field Status $patient_detail->Status->SetDbValueDef($patient_detail->Status->CurrentValue, ""); $rsnew['Status'] =& $patient_detail->Status->DbValue; // Call Row Inserting event $bInsertRow = $patient_detail->Row_Inserting($rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $conn->Execute($patient_detail->InsertSQL($rsnew)); $conn->raiseErrorFn = ''; } else { if ($patient_detail->CancelMessage != "") { $this->setMessage($patient_detail->CancelMessage); $patient_detail->CancelMessage = ""; } else { $this->setMessage("Insert cancelled"); } $AddRow = FALSE; } if ($AddRow) { $patient_detail->DetailNo->setDbValue($conn->Insert_ID()); $rsnew['DetailNo'] =& $patient_detail->DetailNo->DbValue; // Call Row Inserted event $patient_detail->Row_Inserted($rsnew); } return $AddRow; }
function RestoreFormValues() { global $objForm; $this->id_tramite->CurrentValue = $this->id_tramite->FormValue; $this->fecha->CurrentValue = $this->fecha->FormValue; $this->fecha->CurrentValue = ew_UnFormatDateTime($this->fecha->CurrentValue, 7); $this->hora->CurrentValue = $this->hora->FormValue; $this->titulo->CurrentValue = $this->titulo->FormValue; }
function AddRow($rsold = NULL) { global $conn, $Language, $Security; // Load db values from rsold if ($rsold) { $this->LoadDbValues($rsold); } $rsnew = array(); // Password $this->Password->SetDbValueDef($rsnew, $this->Password->CurrentValue, "", FALSE); // Email $this->_Email->SetDbValueDef($rsnew, $this->_Email->CurrentValue, "", FALSE); // Created $this->Created->SetDbValueDef($rsnew, ew_UnFormatDateTime($this->Created->CurrentValue, 5), ew_CurrentDate(), strval($this->Created->CurrentValue) == ""); // Type $this->Type->SetDbValueDef($rsnew, $this->Type->CurrentValue, NULL, FALSE); // Call Row Inserting event $rs = $rsold == NULL ? NULL : $rsold->fields; $bInsertRow = $this->Row_Inserting($rs, $rsnew); if ($bInsertRow) { $conn->raiseErrorFn = 'ew_ErrorFn'; $AddRow = $this->Insert($rsnew); $conn->raiseErrorFn = ''; if ($AddRow) { } } else { if ($this->getSuccessMessage() != "" || $this->getFailureMessage() != "") { // Use the message, do nothing } elseif ($this->CancelMessage != "") { $this->setFailureMessage($this->CancelMessage); $this->CancelMessage = ""; } else { $this->setFailureMessage($Language->Phrase("InsertCancelled")); } $AddRow = FALSE; } // Get insert id if necessary if ($AddRow) { $this->ID->setDbValue($conn->Insert_ID()); $rsnew['ID'] = $this->ID->DbValue; } if ($AddRow) { // Call Row Inserted event $rs = $rsold == NULL ? NULL : $rsold->fields; $this->Row_Inserted($rs, $rsnew); } return $AddRow; }
$Kitchen_Report_22D2_report->sFilter = ""; if ($Kitchen_Report_22D2_report->sFilter != "") { $Kitchen_Report_22D2_report->sFilter .= " AND "; } if (is_null(ew_UnFormatDateTime(ew_FormatDateTime($Kitchen_Report_22D2->PublishedDate->CurrentValue, 6), 6))) { $Kitchen_Report_22D2_report->sFilter .= "(`PublishedDate` IS NULL)"; } else { $Kitchen_Report_22D2_report->sFilter .= "(`PublishedDate` = '" . ew_AdjustSql(ew_UnFormatDateTime(ew_FormatDateTime($Kitchen_Report_22D2->PublishedDate->CurrentValue, 6), 6)) . "')"; } if ($Kitchen_Report_22D2_report->sFilter != "") { $Kitchen_Report_22D2_report->sFilter .= " AND "; } if (is_null(ew_UnFormatDateTime(ew_FormatDateTime($Kitchen_Report_22D2->DeliveryDate->CurrentValue, 6), 6))) { $Kitchen_Report_22D2_report->sFilter .= "(`DeliveryDate` IS NULL)"; } else { $Kitchen_Report_22D2_report->sFilter .= "(`DeliveryDate` = '" . ew_AdjustSql(ew_UnFormatDateTime(ew_FormatDateTime($Kitchen_Report_22D2->DeliveryDate->CurrentValue, 6), 6)) . "')"; } if ($Kitchen_Report_22D2_report->sFilter != "") { $Kitchen_Report_22D2_report->sFilter .= " AND "; } if (is_null($Kitchen_Report_22D2->MenuName->CurrentValue)) { $Kitchen_Report_22D2_report->sFilter .= "(`MenuName` IS NULL)"; } else { $Kitchen_Report_22D2_report->sFilter .= "(`MenuName` = '" . ew_AdjustSql($Kitchen_Report_22D2->MenuName->CurrentValue) . "')"; } if ($Kitchen_Report_22D2_report->sDbDetailFilter != "") { if ($Kitchen_Report_22D2_report->sFilter != "") { $Kitchen_Report_22D2_report->sFilter .= " AND "; } $Kitchen_Report_22D2_report->sFilter .= "(" . $Kitchen_Report_22D2_report->sDbDetailFilter . ")"; }
function RenderRow() { global $conn, $Security, $Language, $tbl_facebook_stat; // Initialize URLs // Call Row_Rendering event $tbl_facebook_stat->Row_Rendering(); // Common render codes for all row types // id_profile $tbl_facebook_stat->id_profile->CellCssStyle = ""; $tbl_facebook_stat->id_profile->CellCssClass = ""; $tbl_facebook_stat->id_profile->CellAttrs = array(); $tbl_facebook_stat->id_profile->ViewAttrs = array(); $tbl_facebook_stat->id_profile->EditAttrs = array(); // stat_date $tbl_facebook_stat->stat_date->CellCssStyle = ""; $tbl_facebook_stat->stat_date->CellCssClass = ""; $tbl_facebook_stat->stat_date->CellAttrs = array(); $tbl_facebook_stat->stat_date->ViewAttrs = array(); $tbl_facebook_stat->stat_date->EditAttrs = array(); // year $tbl_facebook_stat->year->CellCssStyle = ""; $tbl_facebook_stat->year->CellCssClass = ""; $tbl_facebook_stat->year->CellAttrs = array(); $tbl_facebook_stat->year->ViewAttrs = array(); $tbl_facebook_stat->year->EditAttrs = array(); // month $tbl_facebook_stat->month->CellCssStyle = ""; $tbl_facebook_stat->month->CellCssClass = ""; $tbl_facebook_stat->month->CellAttrs = array(); $tbl_facebook_stat->month->ViewAttrs = array(); $tbl_facebook_stat->month->EditAttrs = array(); // week $tbl_facebook_stat->week->CellCssStyle = ""; $tbl_facebook_stat->week->CellCssClass = ""; $tbl_facebook_stat->week->CellAttrs = array(); $tbl_facebook_stat->week->ViewAttrs = array(); $tbl_facebook_stat->week->EditAttrs = array(); // interactions $tbl_facebook_stat->interactions->CellCssStyle = ""; $tbl_facebook_stat->interactions->CellCssClass = ""; $tbl_facebook_stat->interactions->CellAttrs = array(); $tbl_facebook_stat->interactions->ViewAttrs = array(); $tbl_facebook_stat->interactions->EditAttrs = array(); // comments $tbl_facebook_stat->comments->CellCssStyle = ""; $tbl_facebook_stat->comments->CellCssClass = ""; $tbl_facebook_stat->comments->CellAttrs = array(); $tbl_facebook_stat->comments->ViewAttrs = array(); $tbl_facebook_stat->comments->EditAttrs = array(); // wallposts $tbl_facebook_stat->wallposts->CellCssStyle = ""; $tbl_facebook_stat->wallposts->CellCssClass = ""; $tbl_facebook_stat->wallposts->CellAttrs = array(); $tbl_facebook_stat->wallposts->ViewAttrs = array(); $tbl_facebook_stat->wallposts->EditAttrs = array(); // fans $tbl_facebook_stat->fans->CellCssStyle = ""; $tbl_facebook_stat->fans->CellCssClass = ""; $tbl_facebook_stat->fans->CellAttrs = array(); $tbl_facebook_stat->fans->ViewAttrs = array(); $tbl_facebook_stat->fans->EditAttrs = array(); // likes $tbl_facebook_stat->likes->CellCssStyle = ""; $tbl_facebook_stat->likes->CellCssClass = ""; $tbl_facebook_stat->likes->CellAttrs = array(); $tbl_facebook_stat->likes->ViewAttrs = array(); $tbl_facebook_stat->likes->EditAttrs = array(); // unsubscribe $tbl_facebook_stat->unsubscribe->CellCssStyle = ""; $tbl_facebook_stat->unsubscribe->CellCssClass = ""; $tbl_facebook_stat->unsubscribe->CellAttrs = array(); $tbl_facebook_stat->unsubscribe->ViewAttrs = array(); $tbl_facebook_stat->unsubscribe->EditAttrs = array(); if ($tbl_facebook_stat->RowType == EW_ROWTYPE_VIEW) { // View row // id_profile if (strval($tbl_facebook_stat->id_profile->CurrentValue) != "") { $sFilterWrk = "`id` = " . ew_AdjustSql($tbl_facebook_stat->id_profile->CurrentValue) . ""; $sSqlWrk = "SELECT DISTINCT `name` FROM `tbl_profile`"; $sWhereWrk = ""; if ($sWhereWrk != "") { $sWhereWrk .= " AND "; } $sWhereWrk .= "(" . "is_active = '1'" . ")"; if ($sFilterWrk != "") { if ($sWhereWrk != "") { $sWhereWrk .= " AND "; } $sWhereWrk .= "(" . $sFilterWrk . ")"; } if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } $sSqlWrk .= " ORDER BY `name` Asc"; $rswrk = $conn->Execute($sSqlWrk); if ($rswrk && !$rswrk->EOF) { // Lookup values found $tbl_facebook_stat->id_profile->ViewValue = $rswrk->fields('name'); $rswrk->Close(); } else { $tbl_facebook_stat->id_profile->ViewValue = $tbl_facebook_stat->id_profile->CurrentValue; } } else { $tbl_facebook_stat->id_profile->ViewValue = NULL; } $tbl_facebook_stat->id_profile->CssStyle = ""; $tbl_facebook_stat->id_profile->CssClass = ""; $tbl_facebook_stat->id_profile->ViewCustomAttributes = ""; // stat_date $tbl_facebook_stat->stat_date->ViewValue = $tbl_facebook_stat->stat_date->CurrentValue; $tbl_facebook_stat->stat_date->ViewValue = ew_FormatDateTime($tbl_facebook_stat->stat_date->ViewValue, 5); $tbl_facebook_stat->stat_date->CssStyle = ""; $tbl_facebook_stat->stat_date->CssClass = ""; $tbl_facebook_stat->stat_date->ViewCustomAttributes = ""; // year $tbl_facebook_stat->year->ViewValue = $tbl_facebook_stat->year->CurrentValue; $tbl_facebook_stat->year->CssStyle = ""; $tbl_facebook_stat->year->CssClass = ""; $tbl_facebook_stat->year->ViewCustomAttributes = ""; // month $tbl_facebook_stat->month->ViewValue = $tbl_facebook_stat->month->CurrentValue; $tbl_facebook_stat->month->CssStyle = ""; $tbl_facebook_stat->month->CssClass = ""; $tbl_facebook_stat->month->ViewCustomAttributes = ""; // week $tbl_facebook_stat->week->ViewValue = $tbl_facebook_stat->week->CurrentValue; $tbl_facebook_stat->week->CssStyle = ""; $tbl_facebook_stat->week->CssClass = ""; $tbl_facebook_stat->week->ViewCustomAttributes = ""; // interactions $tbl_facebook_stat->interactions->ViewValue = $tbl_facebook_stat->interactions->CurrentValue; $tbl_facebook_stat->interactions->CssStyle = ""; $tbl_facebook_stat->interactions->CssClass = ""; $tbl_facebook_stat->interactions->ViewCustomAttributes = ""; // comments $tbl_facebook_stat->comments->ViewValue = $tbl_facebook_stat->comments->CurrentValue; $tbl_facebook_stat->comments->CssStyle = ""; $tbl_facebook_stat->comments->CssClass = ""; $tbl_facebook_stat->comments->ViewCustomAttributes = ""; // wallposts $tbl_facebook_stat->wallposts->ViewValue = $tbl_facebook_stat->wallposts->CurrentValue; $tbl_facebook_stat->wallposts->CssStyle = ""; $tbl_facebook_stat->wallposts->CssClass = ""; $tbl_facebook_stat->wallposts->ViewCustomAttributes = ""; // fans $tbl_facebook_stat->fans->ViewValue = $tbl_facebook_stat->fans->CurrentValue; $tbl_facebook_stat->fans->CssStyle = ""; $tbl_facebook_stat->fans->CssClass = ""; $tbl_facebook_stat->fans->ViewCustomAttributes = ""; // likes $tbl_facebook_stat->likes->ViewValue = $tbl_facebook_stat->likes->CurrentValue; $tbl_facebook_stat->likes->CssStyle = ""; $tbl_facebook_stat->likes->CssClass = ""; $tbl_facebook_stat->likes->ViewCustomAttributes = ""; // unsubscribe $tbl_facebook_stat->unsubscribe->ViewValue = $tbl_facebook_stat->unsubscribe->CurrentValue; $tbl_facebook_stat->unsubscribe->CssStyle = ""; $tbl_facebook_stat->unsubscribe->CssClass = ""; $tbl_facebook_stat->unsubscribe->ViewCustomAttributes = ""; // id_profile $tbl_facebook_stat->id_profile->HrefValue = ""; $tbl_facebook_stat->id_profile->TooltipValue = ""; // stat_date $tbl_facebook_stat->stat_date->HrefValue = ""; $tbl_facebook_stat->stat_date->TooltipValue = ""; // year $tbl_facebook_stat->year->HrefValue = ""; $tbl_facebook_stat->year->TooltipValue = ""; // month $tbl_facebook_stat->month->HrefValue = ""; $tbl_facebook_stat->month->TooltipValue = ""; // week $tbl_facebook_stat->week->HrefValue = ""; $tbl_facebook_stat->week->TooltipValue = ""; // interactions $tbl_facebook_stat->interactions->HrefValue = ""; $tbl_facebook_stat->interactions->TooltipValue = ""; // comments $tbl_facebook_stat->comments->HrefValue = ""; $tbl_facebook_stat->comments->TooltipValue = ""; // wallposts $tbl_facebook_stat->wallposts->HrefValue = ""; $tbl_facebook_stat->wallposts->TooltipValue = ""; // fans $tbl_facebook_stat->fans->HrefValue = ""; $tbl_facebook_stat->fans->TooltipValue = ""; // likes $tbl_facebook_stat->likes->HrefValue = ""; $tbl_facebook_stat->likes->TooltipValue = ""; // unsubscribe $tbl_facebook_stat->unsubscribe->HrefValue = ""; $tbl_facebook_stat->unsubscribe->TooltipValue = ""; } elseif ($tbl_facebook_stat->RowType == EW_ROWTYPE_SEARCH) { // Search row // id_profile $tbl_facebook_stat->id_profile->EditCustomAttributes = ""; $sFilterWrk = ""; $sSqlWrk = "SELECT DISTINCT `id`, `name`, '' AS Disp2Fld, '' AS SelectFilterFld FROM `tbl_profile`"; $sWhereWrk = ""; if ($sWhereWrk != "") { $sWhereWrk .= " AND "; } $sWhereWrk .= "(" . "is_active = '1'" . ")"; if ($sFilterWrk != "") { if ($sWhereWrk != "") { $sWhereWrk .= " AND "; } $sWhereWrk .= "(" . $sFilterWrk . ")"; } if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } $sSqlWrk .= " ORDER BY `name` Asc"; $rswrk = $conn->Execute($sSqlWrk); $arwrk = $rswrk ? $rswrk->GetRows() : array(); if ($rswrk) { $rswrk->Close(); } array_unshift($arwrk, array("", $Language->Phrase("PleaseSelect"))); $tbl_facebook_stat->id_profile->EditValue = $arwrk; // stat_date $tbl_facebook_stat->stat_date->EditCustomAttributes = ""; $tbl_facebook_stat->stat_date->EditValue = ew_HtmlEncode(ew_FormatDateTime(ew_UnFormatDateTime($tbl_facebook_stat->stat_date->AdvancedSearch->SearchValue, 5), 5)); // year $tbl_facebook_stat->year->EditCustomAttributes = ""; $tbl_facebook_stat->year->EditValue = ew_HtmlEncode($tbl_facebook_stat->year->AdvancedSearch->SearchValue); // month $tbl_facebook_stat->month->EditCustomAttributes = ""; $tbl_facebook_stat->month->EditValue = ew_HtmlEncode($tbl_facebook_stat->month->AdvancedSearch->SearchValue); // week $tbl_facebook_stat->week->EditCustomAttributes = ""; $tbl_facebook_stat->week->EditValue = ew_HtmlEncode($tbl_facebook_stat->week->AdvancedSearch->SearchValue); // interactions $tbl_facebook_stat->interactions->EditCustomAttributes = ""; $tbl_facebook_stat->interactions->EditValue = ew_HtmlEncode($tbl_facebook_stat->interactions->AdvancedSearch->SearchValue); // comments $tbl_facebook_stat->comments->EditCustomAttributes = ""; $tbl_facebook_stat->comments->EditValue = ew_HtmlEncode($tbl_facebook_stat->comments->AdvancedSearch->SearchValue); // wallposts $tbl_facebook_stat->wallposts->EditCustomAttributes = ""; $tbl_facebook_stat->wallposts->EditValue = ew_HtmlEncode($tbl_facebook_stat->wallposts->AdvancedSearch->SearchValue); // fans $tbl_facebook_stat->fans->EditCustomAttributes = ""; $tbl_facebook_stat->fans->EditValue = ew_HtmlEncode($tbl_facebook_stat->fans->AdvancedSearch->SearchValue); // likes $tbl_facebook_stat->likes->EditCustomAttributes = ""; $tbl_facebook_stat->likes->EditValue = ew_HtmlEncode($tbl_facebook_stat->likes->AdvancedSearch->SearchValue); // unsubscribe $tbl_facebook_stat->unsubscribe->EditCustomAttributes = ""; $tbl_facebook_stat->unsubscribe->EditValue = ew_HtmlEncode($tbl_facebook_stat->unsubscribe->AdvancedSearch->SearchValue); } // Call Row Rendered event if ($tbl_facebook_stat->RowType != EW_ROWTYPE_AGGREGATEINIT) { $tbl_facebook_stat->Row_Rendered(); } }