function Page_Main() { global $conn; $GLOBALS["Page"] =& $this; //**$conn = ew_Connect(); // Global Page Loading event (in userfn*.php) //**Page_Loading(); if (ob_get_length()) { ob_end_clean(); } $time = time(); $_SESSION["EW_LAST_REFRESH_TIME"] = $time; echo ew_Encrypt($time); // Global Page Unloaded event (in userfn*.php) //**Page_Unloaded(); // Close connection //**ew_CloseConn(); }
function RenderListOptionsExt() { global $Security, $Language; $links = ""; $btngrps = ""; $sSqlWrk = "[codigo_bodega]='" . ew_AdjustSql($this->codigo_bodega->CurrentValue) . "'"; // Column "detail_in_bodegaubicaciones" $link = ""; $option =& $this->ListOptions->Items["detail_in_bodegaubicaciones"]; $url = "in_bodegaubicacionespreview.php?t=in_bodegas&f=" . ew_Encrypt($sSqlWrk); $btngrp = "<div data-table=\"in_bodegaubicaciones\" data-url=\"" . $url . "\" class=\"btn-group\">"; if ($Security->IsLoggedIn()) { $label = $Language->TablePhrase("in_bodegaubicaciones", "TblCaption"); $link = "<li><a href=\"#\" data-toggle=\"tab\" data-table=\"in_bodegaubicaciones\" data-url=\"" . $url . "\">" . $label . "</a></li>"; $links .= $link; $detaillnk = ew_JsEncode3("in_bodegaubicacioneslist.php?" . EW_TABLE_SHOW_MASTER . "=in_bodegas&fk_codigo_bodega=" . urlencode(strval($this->codigo_bodega->CurrentValue)) . ""); $btngrp .= "<button type=\"button\" class=\"btn btn-default btn-sm\" title=\"" . $Language->TablePhrase("in_bodegaubicaciones", "TblCaption") . "\" onclick=\"window.location='" . $detaillnk . "'\">" . $Language->Phrase("MasterDetailListLink") . "</button>"; } if ($GLOBALS["in_bodegaubicaciones_grid"]->DetailView && $Security->CanView() && $Security->IsLoggedIn()) { $btngrp .= "<button type=\"button\" class=\"btn btn-default btn-sm\" title=\"" . ew_HtmlTitle($Language->Phrase("MasterDetailViewLink")) . "\" onclick=\"window.location='" . $this->GetViewUrl(EW_TABLE_SHOW_DETAIL . "=in_bodegaubicaciones") . "'\">" . $Language->Phrase("MasterDetailViewLink") . "</button>"; } $btngrp .= "</div>"; if ($link != "") { $btngrps .= $btngrp; $option->Body .= "<div class=\"hide ewPreview\">" . $link . $btngrp . "</div>"; } // Hide detail items if necessary $this->ListOptions->HideDetailItemsForDropDown(); // Column "preview" $option =& $this->ListOptions->GetItem("preview"); if (!$option) { // Add preview column $option =& $this->ListOptions->Add("preview"); $option->OnLeft = FALSE; if ($option->OnLeft) { $option->MoveTo($this->ListOptions->ItemPos("checkbox") + 1); } else { $option->MoveTo($this->ListOptions->ItemPos("checkbox")); } $option->Visible = !($this->Export != "" || $this->CurrentAction == "gridadd" || $this->CurrentAction == "gridedit"); $option->ShowInDropDown = FALSE; $option->ShowInButtonGroup = FALSE; } if ($option) { $option->Body = "<span class=\"ewPreviewRowBtn icon-expand\"></span>"; $option->Body .= "<div class=\"hide ewPreview\">" . $links . $btngrps . "</div>"; if ($option->Visible) { $option->Visible = $link != ""; } } // Column "details" (Multiple details) $option =& $this->ListOptions->GetItem("details"); if ($option) { $option->Body .= "<div class=\"hide ewPreview\">" . $links . $btngrps . "</div>"; if ($option->Visible) { $option->Visible = $links != ""; } } }
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 echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`codigo` = {filter_value}"); ?> &t0=3"> </span> <?php } } else { ?> <span id="el$rowindex$_gastos_mantenimientos_id_tipo_gasto" class="form-group gastos_mantenimientos_id_tipo_gasto"> <span<?php echo $gastos_mantenimientos->id_tipo_gasto->ViewAttributes(); ?> > <p class="form-control-static"><?php echo $gastos_mantenimientos->id_tipo_gasto->ViewValue; ?>
function Page_Main() { global $conn, $Language, $gsFormError; global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("forgotpwd", "<span id=\"ewPageCaption\">" . $Language->Phrase("RequestPwdPage") . "</span>", ew_CurrentUrl()); $bPostBack = ew_IsHttpPost(); $bValidEmail = FALSE; if ($bPostBack) { // Setup variables $this->Email = $_POST["email"]; $bValidEmail = $this->ValidateForm($this->Email); if ($bValidEmail) { $this->Action = "activate"; $this->ActivateCode = ew_Encrypt($this->Email); } else { $this->setFailureMessage($gsFormError); } // Handle email activation } elseif (@$_GET["action"] != "") { $this->Action = $_GET["action"]; $this->Email = @$_GET["email"]; $this->ActivateCode = @$_GET["code"]; if ($this->Email != ew_Decrypt($this->ActivateCode) || strtolower($this->Action) != "confirm") { // Email activation if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("ActivateFailed")); } // Set activate failed message $this->Page_Terminate("login.php"); // Go to login page } } if ($this->Action != "") { $bEmailSent = FALSE; // Set up filter (SQL WHERE clause) and get Return SQL // SQL constructor in usuario class, usuarioinfo.php $sFilter = str_replace("%e", ew_AdjustSql($this->Email), EW_USER_EMAIL_FILTER); $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); if ($RsUser = $conn->Execute($sSql)) { if (!$RsUser->EOF) { $rsold = $RsUser->fields; $bValidEmail = TRUE; // Call User Recover Password event $bValidEmail = $this->User_RecoverPassword($rsold); if ($bValidEmail) { $sUserName = $rsold['usuario']; $sPassword = $rsold['contrasenia']; if (EW_ENCRYPTED_PASSWORD) { if (strtolower($this->Action) == "confirm") { $sPassword = substr($sPassword, 0, 16); // Use first 16 characters only $rsnew = array('contrasenia' => $sPassword); // Reset the password $this->Update($rsnew); } } else { $this->Action = "confirm"; // Send password directly if not MD5 } } } else { $bValidEmail = FALSE; $this->setFailureMessage($Language->Phrase("InvalidEmail")); } if ($bValidEmail) { $Email = new cEmail(); if (strtolower($this->Action) == "confirm") { $Email->Load("phptxt/forgotpwd.txt"); $Email->ReplaceContent('<!--$Password-->', $sPassword); } else { $Email->Load("phptxt/resetpwd.txt"); $sActivateLink = ew_FullUrl() . "?action=confirm"; $sActivateLink .= "&email=" . $this->Email; $sActivateLink .= "&code=" . $this->ActivateCode; $Email->ReplaceContent('<!--$ActivateLink-->', $sActivateLink); } $Email->ReplaceSender(EW_SENDER_EMAIL); // Replace Sender $Email->ReplaceRecipient($this->Email); // Replace Recipient $Email->ReplaceContent('<!--$UserName-->', $sUserName); $Email->Charset = EW_EMAIL_CHARSET; $Args = array(); if (EW_ENCRYPTED_PASSWORD && strtolower($this->Action) == "confirm") { $Args["rs"] =& $rsnew; } if ($this->Email_Sending($Email, $Args)) { $bEmailSent = $Email->Send(); } } $RsUser->Close(); } if ($bEmailSent) { if ($this->getSuccessMessage() == "") { if (strtolower($this->Action) == "confirm") { $this->setSuccessMessage($Language->Phrase("PwdEmailSent")); } else { $this->setSuccessMessage($Language->Phrase("ResetPwdEmailSent")); } } // Set up success message $this->Page_Terminate("login.php"); // Return to login page } elseif ($bValidEmail) { $this->setFailureMessage($Language->Phrase("FailedToSendMail")); // Set up error message } } }
} if (!$GLOBALS["deudas"]->UserIDAllow("add")) { $sWhereWrk = $GLOBALS["socios"]->AddUserIDFilter($sWhereWrk); } // Call Lookup selecting $deudas->Lookup_Selecting($deudas->id_socio, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } $sSqlWrk .= " ORDER BY `propietario` DESC"; ?> <input type="hidden" name="s_x_id_socio" id="s_x_id_socio" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`socio_nro` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $deudas->id_socio->CustomMsg; ?> </div></div> </div> <?php } ?> </div> <?php if (in_array("detalle_deudas", explode(",", $deudas->getCurrentDetailTable())) && $detalle_deudas->DetailAdd) {
?> </select> <?php $sSqlWrk = "SELECT `idhospital`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `hospital`"; $sWhereWrk = ""; // Call Lookup selecting $nivel->Lookup_Selecting($nivel->idhospital, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idhospital" id="s_x_idhospital" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idhospital` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $nivel->idhospital->CustomMsg; ?> </div></div> </div> <?php } ?> </div> <?php if (in_array("sala", explode(",", $nivel->getCurrentDetailTable())) && $sala->DetailAdd) {
function LookupFilterQuery() { foreach ($this->LookupFilters as $key => &$value) { if (preg_match('/^f\\d+$|^s$/', $key)) { // "f<n>" or "s" $value = ew_Encrypt($value); } // Encrypt SQL and filter } return http_build_query($this->LookupFilters); }
?> </select> <?php $sSqlWrk = "SELECT `userlevelid`, `userlevelname` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `userlevels`"; $sWhereWrk = ""; // Call Lookup selecting $userlevelpermissions->Lookup_Selecting($userlevelpermissions->userlevelid, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_userlevelid" id="s_x_userlevelid" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`userlevelid` = {filter_value}"); ?> &t0=3"> </span> <?php echo $userlevelpermissions->userlevelid->CustomMsg; ?> </td> </tr> <?php } if ($userlevelpermissions->_tablename->Visible) { // tablename ?> <tr id="r__tablename"> <td><span id="elh_userlevelpermissions__tablename"><?php
?> </select> <?php $sSqlWrk = "SELECT `idnivel`, `descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `nivel`"; $sWhereWrk = ""; // Call Lookup selecting $sala->Lookup_Selecting($sala->idnivel, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idnivel" id="s_x_idnivel" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idnivel` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $sala->idnivel->CustomMsg; ?> </div></div> </div> <?php } ?> </div> <input type="hidden" data-field="x_idsala" name="x_idsala" id="x_idsala" value="<?php echo ew_HtmlEncode($sala->idsala->CurrentValue);
?> </select> <?php $sSqlWrk = "SELECT `idmunicipio`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `municipio`"; $sWhereWrk = ""; // Call Lookup selecting $hospital->Lookup_Selecting($hospital->idmunicipio, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idmunicipio" id="s_x_idmunicipio" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idmunicipio` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $hospital->idmunicipio->CustomMsg; ?> </div></div> </div> <?php } ?> </div> <?php if (in_array("nivel", explode(",", $hospital->getCurrentDetailTable())) && $nivel->DetailAdd) {
?> </select> <?php $sSqlWrk = "SELECT `idcuenta`, `idcuenta` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `cuenta`"; $sWhereWrk = ""; // Call Lookup selecting $internado_diario->Lookup_Selecting($internado_diario->idcuenta, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idcuenta" id="s_x_idcuenta" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idcuenta` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $internado_diario->idcuenta->CustomMsg; ?> </div></div> </div> <?php } if ($internado_diario->fecha->Visible) { // fecha ?> <div id="r_fecha" class="form-group">
?> </select> <?php $sSqlWrk = "SELECT `idcontinente`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `continente`"; $sWhereWrk = ""; // Call Lookup selecting $pais->Lookup_Selecting($pais->idcontinente, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idcontinente" id="s_x_idcontinente" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idcontinente` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $pais->idcontinente->CustomMsg; ?> </div></div> </div> <?php } if ($pais->estado->Visible) { // estado ?> <div id="r_estado" class="form-group">
" value="<?php echo $user_add->Token; ?> "> <?php } ?> <input type="hidden" name="t" value="user"> <input type="hidden" name="a_add" id="a_add" value="A"> <!-- Fields to prevent google autofill --> <input class="hidden" type="text" name="<?php echo ew_Encrypt(ew_Random()); ?> "> <input class="hidden" type="password" name="<?php echo ew_Encrypt(ew_Random()); ?> "> <div> <?php if ($user->username->Visible) { // username ?> <div id="r_username" class="form-group"> <label id="elh_user_username" for="x_username" class="col-sm-2 control-label ewLabel"><?php echo $user->username->FldCaption(); echo $Language->Phrase("FieldRequiredIndicator"); ?> </label> <div class="col-sm-10"><div<?php echo $user->username->CellAttributes();
$in_bodegaubicaciones->Lookup_Selecting($in_bodegaubicaciones->Seccion_id, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x<?php echo $in_bodegaubicaciones_grid->RowIndex; ?> _Seccion_id" id="s_x<?php echo $in_bodegaubicaciones_grid->RowIndex; ?> _Seccion_id" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("[Seccion_Id] = {filter_value}"); ?> &t0=3"> </span> <?php } else { ?> <span id="el$rowindex$_in_bodegaubicaciones_Seccion_id" class="form-group in_bodegaubicaciones_Seccion_id"> <span<?php echo $in_bodegaubicaciones->Seccion_id->ViewAttributes(); ?> > <p class="form-control-static"><?php echo $in_bodegaubicaciones->Seccion_id->ViewValue; ?> </p></span>
function Page_Main() { global $UserTableConn, $Language, $gsFormError; global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("forgotpwd", "RequestPwdPage", ew_CurrentUrl(), "", "", TRUE); $bPostBack = ew_IsHttpPost(); $bValidEmail = FALSE; if ($bPostBack) { // Setup variables $this->Email = $_POST["email"]; $bValidEmail = $this->ValidateForm($this->Email); if ($bValidEmail) { if (EW_ENCRYPTED_PASSWORD) { $this->Action = "reset"; } else { $this->Action = "confirm"; } // Send password directly if not MD5 $this->ActivateCode = ew_Encrypt($this->Email); } else { $this->setFailureMessage($gsFormError); } // Handle email activation } elseif (@$_GET["action"] != "") { $this->Action = $_GET["action"]; $this->Email = @$_GET["email"]; $this->ActivateCode = @$_GET["code"]; if ($this->Email != ew_Decrypt($this->ActivateCode) || strtolower($this->Action) != "confirm" && strtolower($this->Action) != "reset") { // Email activation if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("ActivateFailed")); } // Set activate failed message $this->Page_Terminate("login.php"); // Go to login page } if (strtolower($this->Action) == "reset") { $this->Action = "resetpassword"; } } if ($this->Action != "") { $bEmailSent = FALSE; // Set up filter (SQL WHERE clause) and get Return SQL // SQL constructor in user class, userinfo.php $sFilter = str_replace("%e", ew_AdjustSql($this->Email, EW_USER_TABLE_DBID), EW_USER_EMAIL_FILTER); $this->CurrentFilter = $sFilter; $sSql = $this->SQL(); if ($RsUser = $UserTableConn->Execute($sSql)) { if (!$RsUser->EOF) { $rsold = $RsUser->fields; $bValidEmail = TRUE; // Call User Recover Password event $bValidEmail = $this->User_RecoverPassword($rsold); if ($bValidEmail) { $sUserName = $rsold['CODE']; $sPassword = $rsold['PASS']; } } else { $bValidEmail = FALSE; $this->setFailureMessage($Language->Phrase("InvalidEmail")); } $RsUser->Close(); if ($bValidEmail) { if (strtolower($this->Action) == "resetpassword") { // Reset password $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = $sUserName; // Save login user name $_SESSION[EW_SESSION_STATUS] = "passwordreset"; $this->Page_Terminate("changepwd.php"); } else { $Email = new cEmail(); if (strtolower($this->Action) == "confirm") { $Email->Load(EW_EMAIL_FORGOTPWD_TEMPLATE); $Email->ReplaceContent('<!--$Password-->', $sPassword); } else { $Email->Load(EW_EMAIL_RESETPWD_TEMPLATE); $sActivateLink = ew_FullUrl() . "?action=reset"; $sActivateLink .= "&email=" . $this->Email; $sActivateLink .= "&code=" . $this->ActivateCode; $Email->ReplaceContent('<!--$ActivateLink-->', $sActivateLink); } $Email->ReplaceSender(EW_SENDER_EMAIL); // Replace Sender $Email->ReplaceRecipient($this->Email); // Replace Recipient $Email->ReplaceContent('<!--$UserName-->', $sUserName); $Args = array(); if (EW_ENCRYPTED_PASSWORD && strtolower($this->Action) == "confirm") { $Args["rs"] =& $rsnew; } if ($this->Email_Sending($Email, $Args)) { $bEmailSent = $Email->Send(); } } } } if ($bEmailSent) { if ($this->getSuccessMessage() == "") { if (strtolower($this->Action) == "confirm") { $this->setSuccessMessage($Language->Phrase("PwdEmailSent")); } else { $this->setSuccessMessage($Language->Phrase("ResetPwdEmailSent")); } } // Set up success message $this->Page_Terminate("login.php"); // Return to login page } elseif ($bValidEmail) { $this->setFailureMessage($Email->SendErrDescription); // Set up error message } } }
$medicina->Lookup_Selecting($medicina->idlaboratorio, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x<?php echo $medicina_grid->RowIndex; ?> _idlaboratorio" id="s_x<?php echo $medicina_grid->RowIndex; ?> _idlaboratorio" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idlaboratorio` = {filter_value}"); ?> &t0=3"> </span> <?php } } else { ?> <span id="el$rowindex$_medicina_idlaboratorio" class="form-group medicina_idlaboratorio"> <span<?php echo $medicina->idlaboratorio->ViewAttributes(); ?> > <p class="form-control-static"><?php echo $medicina->idlaboratorio->ViewValue; ?>
?> </select> <?php $sSqlWrk = "SELECT `idespecialidad`, `descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `especialidad`"; $sWhereWrk = ""; // Call Lookup selecting $doctor_especialidad->Lookup_Selecting($doctor_especialidad->idespecialidad, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idespecialidad" id="s_x_idespecialidad" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idespecialidad` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $doctor_especialidad->idespecialidad->CustomMsg; ?> </div></div> </div> <?php } ?> </div> <?php if (in_array("doctor", explode(",", $doctor_especialidad->getCurrentDetailTable())) && $doctor->DetailAdd) {
function Page_Main() { global $conn, $Security, $Language, $gsFormError, $objForm; global $Breadcrumb; // Set up Breadcrumb $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("register", "<span id=\"ewPageCaption\">" . $Language->Phrase("RegisterPage") . "</span>", ew_CurrentUrl()); $bUserExists = FALSE; if (@$_POST["a_register"] != "") { // Get action $this->CurrentAction = $_POST["a_register"]; $this->LoadFormValues(); // Get form values // Validate form if (!$this->ValidateForm()) { $this->CurrentAction = "I"; // Form error, reset action $this->setFailureMessage($gsFormError); } } else { $this->CurrentAction = "I"; // Display blank record $this->LoadDefaultValues(); // Load default values } // Handle email activation if (@$_GET["action"] != "") { $sAction = $_GET["action"]; $sEmail = @$_GET["email"]; $sCode = @$_GET["token"]; @(list($sApprovalCode, $sUsr, $sPwd) = explode(",", $sCode, 3)); $sApprovalCode = ew_Decrypt($sApprovalCode); $sUsr = ew_Decrypt($sUsr); $sPwd = ew_Decrypt($sPwd); if ($sEmail == $sApprovalCode) { if (strtolower($sAction) == "confirm") { // Email activation if ($this->ActivateEmail($sEmail)) { // Activate this email if ($this->getSuccessMessage() == "") { $this->setSuccessMessage($Language->Phrase("ActivateAccount")); } // Set up message acount activated $this->Page_Terminate("cciaglogin.php"); // Go to login page } } } if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("ActivateFailed")); } // Set activate failed message $this->Page_Terminate("cciaglogin.php"); // Go to login page } switch ($this->CurrentAction) { case "I": // Blank record, no action required break; case "A": // Add // Check for duplicate User ID $sFilter = str_replace("%u", ew_AdjustSql($this->usuario->CurrentValue), EW_USER_NAME_FILTER); // Set up filter (SQL WHERE clause) and get return SQL // SQL constructor in usuario class, usuarioinfo.php $this->CurrentFilter = $sFilter; $sUserSql = $this->SQL(); if ($rs = $conn->Execute($sUserSql)) { if (!$rs->EOF) { $bUserExists = TRUE; $this->RestoreFormValues(); // Restore form values $this->setFailureMessage($Language->Phrase("UserExists")); // Set user exist message } $rs->Close(); } if (!$bUserExists) { $this->SendEmail = TRUE; // Send email on add success if ($this->AddRow()) { // Add record // Load user email $sReceiverEmail = $this->_email->CurrentValue; if ($sReceiverEmail == "") { // Send to recipient directly $sReceiverEmail = EW_RECIPIENT_EMAIL; $sBccEmail = ""; } else { // Bcc recipient $sBccEmail = EW_RECIPIENT_EMAIL; } // Set up email content if ($sReceiverEmail != "") { $Email = new cEmail(); $Email->Load("phptxt/cciagregister.txt"); $Email->ReplaceSender(EW_SENDER_EMAIL); // Replace Sender $Email->ReplaceRecipient($sReceiverEmail); // Replace Recipient if ($sBccEmail != "") { $Email->AddBcc($sBccEmail); } // Add Bcc $Email->ReplaceContent('<!--FieldCaption_email-->', $this->_email->FldCaption()); $Email->ReplaceContent('<!--email-->', strval($this->_email->FormValue)); $sActivateLink = ew_FullUrl() . "?action=confirm"; $sActivateLink .= "&email=" . $this->_email->CurrentValue; $sToken = ew_Encrypt($this->_email->CurrentValue) . "," . ew_Encrypt($this->usuario->CurrentValue) . "," . ew_Encrypt($this->contrasenia->FormValue); $sActivateLink .= "&token=" . $sToken; $Email->ReplaceContent("<!--ActivateLink-->", $sActivateLink); $Email->Charset = EW_EMAIL_CHARSET; // Get new recordset $this->CurrentFilter = $this->KeyFilter(); $sSql = $this->SQL(); $rsnew = $conn->Execute($sSql); $Args = array(); $Args["rs"] = $rsnew->fields; $bEmailSent = FALSE; if ($this->Email_Sending($Email, $Args)) { $bEmailSent = $Email->Send(); } // Send email failed if (!$bEmailSent) { $this->setFailureMessage($Email->SendErrDescription); } } if ($this->getSuccessMessage() == "") { $this->setSuccessMessage($Language->Phrase("RegisterSuccessActivate")); } // Activate success $this->Page_Terminate("cciaglogin.php"); // Return } else { $this->RestoreFormValues(); // Restore form values } } } // Render row if ($this->CurrentAction == "F") { // Confirm page $this->RowType = EW_ROWTYPE_VIEW; // Render view } else { $this->RowType = EW_ROWTYPE_ADD; // Render add } $this->ResetAttrs(); $this->RenderRow(); }
function Page_Main() { global $Security, $Language, $UserProfile, $gsFormError; global $Breadcrumb; $url = substr(ew_CurrentUrl(), strrpos(ew_CurrentUrl(), "/") + 1); $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("login", "LoginPage", $url, "", "", TRUE); $sPassword = ""; $sLastUrl = $Security->LastUrl(); // Get last URL if ($sLastUrl == "") { $sLastUrl = "index.php"; } // If session expired, show session expired message if (@$_GET["expired"] == "1") { $this->setFailureMessage($Language->Phrase("SessionExpired")); } if (IsLoggingIn()) { $this->Username = @$_SESSION[EW_SESSION_USER_PROFILE_USER_NAME]; $sPassword = @$_SESSION[EW_SESSION_USER_PROFILE_PASSWORD]; $this->LoginType = @$_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE]; $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE); if ($bValidPwd) { $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = ""; $_SESSION[EW_SESSION_USER_PROFILE_PASSWORD] = ""; $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = ""; } } else { if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } $Security->LoadUserLevel(); // Load user level $this->Username = ""; // Initialize $encrypted = FALSE; if (isset($_POST["username"])) { $this->Username = ew_RemoveXSS(ew_StripSlashes($_POST["username"])); $sPassword = ew_RemoveXSS(ew_StripSlashes(@$_POST["password"])); $this->LoginType = strtolower(ew_RemoveXSS(@$_POST["type"])); } else { if (EW_ALLOW_LOGIN_BY_URL && isset($_GET["username"])) { $this->Username = ew_RemoveXSS(ew_StripSlashes($_GET["username"])); $sPassword = ew_RemoveXSS(ew_StripSlashes(@$_GET["password"])); $this->LoginType = strtolower(ew_RemoveXSS(@$_GET["type"])); $encrypted = !empty($_GET["encrypted"]); } } if ($this->Username != "") { $bValidate = $this->ValidateForm($this->Username, $sPassword); if (!$bValidate) { $this->setFailureMessage($gsFormError); } $_SESSION[EW_SESSION_USER_LOGIN_TYPE] = $this->LoginType; // Save user login type $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = $this->Username; // Save login user name $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = $this->LoginType; // Save login type // Max login attempt checking if ($UserProfile->ExceedLoginRetry($this->Username)) { $bValidate = FALSE; $this->setFailureMessage(str_replace("%t", EW_USER_PROFILE_RETRY_LOCKOUT, $Language->Phrase("ExceedMaxRetry"))); } } else { if ($Security->IsLoggedIn()) { if ($this->getFailureMessage() == "") { $this->Page_Terminate($sLastUrl); } // Return to last accessed page } $bValidate = FALSE; // Restore settings if (@$_COOKIE[EW_PROJECT_NAME]['Checksum'] == strval(crc32(md5(EW_RANDOM_KEY)))) { $this->Username = ew_Decrypt(@$_COOKIE[EW_PROJECT_NAME]['Username']); } if (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "autologin") { $this->LoginType = "a"; } elseif (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "rememberusername") { $this->LoginType = "u"; } else { $this->LoginType = ""; } } $bValidPwd = FALSE; if ($bValidate) { // Call Logging In event $bValidate = $this->User_LoggingIn($this->Username, $sPassword); if ($bValidate) { $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE, $encrypted); // Manual login if (!$bValidPwd) { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("InvalidUidPwd")); } // Invalid user id/password } } else { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("LoginCancelled")); } // Login cancelled } } } if ($bValidPwd) { // Write cookies if ($this->LoginType == "a") { // Auto login setcookie(EW_PROJECT_NAME . '[AutoLogin]', "autologin", EW_COOKIE_EXPIRY_TIME); // Set autologin cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Password]', ew_Encrypt($sPassword), EW_COOKIE_EXPIRY_TIME); // Set password cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } elseif ($this->LoginType == "u") { // Remember user name setcookie(EW_PROJECT_NAME . '[AutoLogin]', "rememberusername", EW_COOKIE_EXPIRY_TIME); // Set remember user name cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } else { setcookie(EW_PROJECT_NAME . '[AutoLogin]', "", EW_COOKIE_EXPIRY_TIME); // Clear auto login cookie } $this->WriteAuditTrailOnLogin($this->Username); // Call loggedin event $this->User_LoggedIn($this->Username); $this->Page_Terminate($sLastUrl); // Return to last accessed URL } elseif ($this->Username != "" && $sPassword != "") { // Call user login error event $this->User_LoginError($this->Username, $sPassword); } }
?> </select> <?php $sSqlWrk = "SELECT `iddepartamento`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `departamento`"; $sWhereWrk = ""; // Call Lookup selecting $municipio->Lookup_Selecting($municipio->iddepartamento, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_iddepartamento" id="s_x_iddepartamento" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`iddepartamento` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $municipio->iddepartamento->CustomMsg; ?> </div></div> </div> <?php } ?> </div> <input type="hidden" data-field="x_idmunicipio" name="x_idmunicipio" id="x_idmunicipio" value="<?php echo ew_HtmlEncode($municipio->idmunicipio->CurrentValue);
?> </select> <?php $sSqlWrk = "SELECT `idpaciente`, `nombre` AS `DispFld`, '' AS `Disp2Fld`, `apellido` AS `Disp3Fld`, '' AS `Disp4Fld` FROM `paciente`"; $sWhereWrk = ""; // Call Lookup selecting $internado->Lookup_Selecting($internado->idpaciente, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idpaciente" id="s_x_idpaciente" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idpaciente` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $internado->idpaciente->CustomMsg; ?> </div></div> </div> <?php } if ($internado->es_operacion->Visible) { // es_operacion ?> <div id="r_es_operacion" class="form-group">
</select> <?php $sSqlWrk = "SELECT `id_actividad`, `rubro` AS `DispFld`, `actividad` AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `v_db_rubro_actividad`"; $sWhereWrk = ""; // Call Lookup selecting $socios->Lookup_Selecting($socios->id_actividad, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } $sSqlWrk .= " ORDER BY `rubro` ASC"; ?> <input type="hidden" name="s_x_id_actividad" id="s_x_id_actividad" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`id_actividad` = {filter_value}"); ?> &t0=3"> </span> <?php echo $socios->id_actividad->CustomMsg; ?> </div></div> </div> <?php } if ($socios->propietario->Visible) { // propietario ?> <div id="r_propietario" class="form-group"> <label id="elh_socios_propietario" for="x_propietario" class="col-sm-2 control-label ewLabel"><?php
"<?php echo $wrkonchange; ?> > <?php $sSqlWrk = "SELECT `mid`, `mcardnumber` AS `DispFld` FROM `members`"; $sWhereWrk = "`mcardnumber` LIKE '{query_value}%'"; $delivery->Lookup_Selecting($delivery->m_id, $sWhereWrk); // Call Lookup selecting if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } $sSqlWrk .= " LIMIT " . EW_AUTO_SUGGEST_MAX_ENTRIES; ?> <input type="hidden" name="q_x_m_id" id="q_x_m_id" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &d="> <script type="text/javascript"> fdeliveryadd.CreateAutoSuggest({"id":"x_m_id","forceSelect":false}); </script> </span> <?php echo $delivery->m_id->CustomMsg; ?> </div></div> </div> <?php } if ($delivery->package_id->Visible) { // package_id
function Page_Main() { global $Security, $Language, $UserProfile, $gsFormError; global $Breadcrumb; $Breadcrumb = new cBreadcrumb(); $Breadcrumb->Add("login", "<span id=\"ewPageCaption\">" . $Language->Phrase("LoginPage") . "</span>", ew_CurrentUrl()); $sPassword = ""; $sLastUrl = $Security->LastUrl(); // Get last URL if ($sLastUrl == "") { $sLastUrl = "index.php"; } if (IsLoggingIn()) { $this->Username = @$_SESSION[EW_SESSION_USER_PROFILE_USER_NAME]; $sPassword = @$_SESSION[EW_SESSION_USER_PROFILE_PASSWORD]; $this->LoginType = @$_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE]; $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE); if ($bValidPwd) { $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = ""; $_SESSION[EW_SESSION_USER_PROFILE_PASSWORD] = ""; $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = ""; } } else { if (!$Security->IsLoggedIn()) { $Security->AutoLogin(); } $this->Username = ""; // Initialize if (@$_POST["username"] != "") { // Setup variables $this->Username = ew_RemoveXSS(ew_StripSlashes(@$_POST["username"])); $sPassword = ew_RemoveXSS(ew_StripSlashes(@$_POST["password"])); $this->LoginType = strtolower(ew_RemoveXSS(@$_POST["type"])); } if ($this->Username != "") { $bValidate = $this->ValidateForm($this->Username, $sPassword); if (!$bValidate) { $this->setFailureMessage($gsFormError); } $_SESSION[EW_SESSION_USER_PROFILE_USER_NAME] = $this->Username; // Save login user name $_SESSION[EW_SESSION_USER_PROFILE_LOGIN_TYPE] = $this->LoginType; // Save login type } else { if ($Security->IsLoggedIn()) { if ($this->getFailureMessage() == "") { $this->Page_Terminate($sLastUrl); } // Return to last accessed page } $bValidate = FALSE; // Restore settings if (@$_COOKIE[EW_PROJECT_NAME]['Checksum'] == strval(crc32(md5(EW_RANDOM_KEY)))) { $this->Username = ew_Decrypt(@$_COOKIE[EW_PROJECT_NAME]['Username']); } if (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "autologin") { $this->LoginType = "a"; } elseif (@$_COOKIE[EW_PROJECT_NAME]['AutoLogin'] == "rememberusername") { $this->LoginType = "u"; } else { $this->LoginType = ""; } } $bValidPwd = FALSE; if ($bValidate) { // Call Logging In event $bValidate = $this->User_LoggingIn($this->Username, $sPassword); if ($bValidate) { $bValidPwd = $Security->ValidateUser($this->Username, $sPassword, FALSE); // Manual login if (!$bValidPwd) { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("InvalidUidPwd")); } // Invalid user id/password } } else { if ($this->getFailureMessage() == "") { $this->setFailureMessage($Language->Phrase("LoginCancelled")); } // Login cancelled } } } if ($bValidPwd) { // Write cookies if ($this->LoginType == "a") { // Auto login setcookie(EW_PROJECT_NAME . '[AutoLogin]', "autologin", EW_COOKIE_EXPIRY_TIME); // Set autologin cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Password]', ew_Encrypt($sPassword), EW_COOKIE_EXPIRY_TIME); // Set password cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } elseif ($this->LoginType == "u") { // Remember user name setcookie(EW_PROJECT_NAME . '[AutoLogin]', "rememberusername", EW_COOKIE_EXPIRY_TIME); // Set remember user name cookie setcookie(EW_PROJECT_NAME . '[Username]', ew_Encrypt($this->Username), EW_COOKIE_EXPIRY_TIME); // Set user name cookie setcookie(EW_PROJECT_NAME . '[Checksum]', crc32(md5(EW_RANDOM_KEY)), EW_COOKIE_EXPIRY_TIME); } else { setcookie(EW_PROJECT_NAME . '[AutoLogin]', "", EW_COOKIE_EXPIRY_TIME); // Clear auto login cookie } // Call loggedin event $this->User_LoggedIn($this->Username); $this->Page_Terminate($sLastUrl); // Return to last accessed URL } elseif ($this->Username != "" && $sPassword != "") { // Call user login error event $this->User_LoginError($this->Username, $sPassword); } }
?> </select> <?php $sSqlWrk = "SELECT `idservicio_medico`, `descripcion` AS `DispFld`, '' AS `Disp2Fld`, '' AS `Disp3Fld`, '' AS `Disp4Fld` FROM `servicio_medico`"; $sWhereWrk = ""; // Call Lookup selecting $servicio_medico_prestado->Lookup_Selecting($servicio_medico_prestado->idservicio_medico, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_idservicio_medico" id="s_x_idservicio_medico" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idservicio_medico` = {filter_value}"); ?> &t0=3"> </span> <?php } echo $servicio_medico_prestado->idservicio_medico->CustomMsg; ?> </div></div> </div> <?php } if ($servicio_medico_prestado->costo->Visible) { // costo ?> <div id="r_costo" class="form-group">
$consulta->Lookup_Selecting($consulta->iddoctor, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x<?php echo $consulta_grid->RowIndex; ?> _iddoctor" id="s_x<?php echo $consulta_grid->RowIndex; ?> _iddoctor" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`iddoctor` = {filter_value}"); ?> &t0=3"> </span> <?php } } else { ?> <span id="el$rowindex$_consulta_iddoctor" class="form-group consulta_iddoctor"> <span<?php echo $consulta->iddoctor->ViewAttributes(); ?> > <p class="form-control-static"><?php echo $consulta->iddoctor->ViewValue; ?>
$receta->Lookup_Selecting($receta->idturno, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x<?php echo $receta_grid->RowIndex; ?> _idturno" id="s_x<?php echo $receta_grid->RowIndex; ?> _idturno" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`idturno` = {filter_value}"); ?> &t0=3"> </span> <?php } } else { ?> <span id="el$rowindex$_receta_idturno" class="form-group receta_idturno"> <span<?php echo $receta->idturno->ViewAttributes(); ?> > <p class="form-control-static"><?php echo $receta->idturno->ViewValue; ?>
function ew_CreateToken() { return ew_Encrypt(time()); }
$sWhereWrk = ""; $lookuptblfilter = "`activa`='S'"; if (strval($lookuptblfilter) != "") { ew_AddFilter($sWhereWrk, $lookuptblfilter); } // Call Lookup selecting $socios->Lookup_Selecting($socios->id_actividad, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } ?> <input type="hidden" name="s_x_id_actividad" id="s_x_id_actividad" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`id` = {filter_value}"); ?> &t0=3"> </span> <?php echo $socios->id_actividad->CustomMsg; ?> </td> </tr> <?php } if ($socios->propietario->Visible) { // propietario ?> <tr id="r_propietario"> <td><span id="elh_socios_propietario"><?php
$lookuptblfilter = "`activo`='S'"; if (strval($lookuptblfilter) != "") { ew_AddFilter($sWhereWrk, $lookuptblfilter); } // Call Lookup selecting $v_trabajos_a_entregar->Lookup_Selecting($v_trabajos_a_entregar->estado, $sWhereWrk); if ($sWhereWrk != "") { $sSqlWrk .= " WHERE " . $sWhereWrk; } $sSqlWrk .= " ORDER BY `codigo` ASC"; ?> <input type="hidden" name="s_x_estado" id="s_x_estado" value="s=<?php echo ew_Encrypt($sSqlWrk); ?> &f0=<?php echo ew_Encrypt("`estado` = {filter_value}"); ?> &t0=200"> </span> </span> <?php } ?> </div> <div id="xsr_2" class="ewRow"> <?php if ($v_trabajos_a_entregar->fecha_recepcion->Visible) { // fecha_recepcion ?> <span id="xsc_fecha_recepcion" class="ewCell"> <span class="ewSearchCaption"><?php