did more with login

This commit is contained in:
EggMan20339 2024-04-04 01:07:20 -04:00
parent d5a098d868
commit 428a53ea0d
11 changed files with 56 additions and 10 deletions

Binary file not shown.

Binary file not shown.

View File

@ -5,20 +5,43 @@
<script runat="server">
</script>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<style>
body, html {
height: 100%;
margin: 0;
}
.centered-div {
display: flex;
justify-content: center;
align-items: center;
height: 100%;
background-color: #333; /* Optional: in case you want a background color */
}
.login-form {
text-align: center;
width: 100%; /* You might want to set a max-width here */
}
.login-form h1, .login-form label {
color: white; /* This ensures your text is white as specified */
}
</style>
<title>Login</title>
</head>
<body style="background-color: #0f0f0f">
<form id="Login" runat="server">
<div style="horiz-align: center; width: 100%">
<div class="centered-div">
<div class="login-form">
<h1 style="color: white">Login to Lewis' Pharmacy</h1>
<label for="Username" style="color: white">Username:</label>
<asp:TextBox ID="Username" runat="server"></asp:TextBox><br/>
<label for="Password" style="color: white">Password:</label>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox><br/>
<asp:TextBox ID="Password" runat="server" TextMode="Password"></asp:TextBox><br/><br/>
<asp:Button ID="LoginButton" runat="server" Text="Login" OnClick="LoginButton_Click"/>
</div>
<br/><br/><br/>
</div></div>
</form>
</body>
</html>

View File

@ -58,5 +58,15 @@ namespace FWA_MAIN
{
Response.Redirect("Prescription.aspx");
}
protected void btnLogout_OnClick(object sender, EventArgs e)
{
System.Web.Security.FormsAuthentication.SignOut();
// Optionally clear the session
Session.Clear();
// Redirect the user to the login page or another page
Response.Redirect("login.aspx"); }
}
}

View File

@ -22,6 +22,8 @@
<asp:Button runat="server" ID="btnPhysician" CssClass="sidenavbutton" Text="Physicians" OnClick="btnPhysician_OnClick"/>
<asp:Button runat="server" ID="btnMedication" CssClass="sidenavbutton" Text="Medications" OnClick="btnMedication_OnClick"/>
<asp:Button runat="server" ID="btnPrescription" CssClass="sidenavbutton" Text="Prescriptions" OnClick="btnPrescription_OnClick"/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<asp:Button runat="server" ID="btnLogout" CssClass="sidenavbutton" Text="Logout" OnClick="btnLogout_OnClick"/>
</div>
</nav>

View File

@ -59,6 +59,15 @@ namespace FWA_MAIN
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnPrescription;
/// <summary>
/// btnLogout control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Button btnLogout;
/// <summary>
/// cph1 control.
/// </summary>

Binary file not shown.

Binary file not shown.

View File

@ -22,6 +22,8 @@
<asp:Button runat="server" ID="btnPhysician" CssClass="sidenavbutton" Text="Physicians" OnClick="btnPhysician_OnClick"/>
<asp:Button runat="server" ID="btnMedication" CssClass="sidenavbutton" Text="Medications" OnClick="btnMedication_OnClick"/>
<asp:Button runat="server" ID="btnPrescription" CssClass="sidenavbutton" Text="Prescriptions" OnClick="btnPrescription_OnClick"/>
<br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>
<asp:Button runat="server" ID="btnLogout" CssClass="sidenavbutton" Text="Logout" OnClick="btnLogout_OnClick"/>
</div>
</nav>