diff --git a/.swp b/.swp deleted file mode 100644 index 3131ad0..0000000 Binary files a/.swp and /dev/null differ diff --git a/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/DesignTimeBuild/.dtbcache b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/DesignTimeBuild/.dtbcache new file mode 100644 index 0000000..13b0aab Binary files /dev/null and b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/DesignTimeBuild/.dtbcache differ diff --git a/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/.suo b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/.suo new file mode 100644 index 0000000..6a6577d Binary files /dev/null and b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/.suo differ diff --git a/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/db.lock b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/db.lock new file mode 100644 index 0000000..e69de29 diff --git a/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide new file mode 100644 index 0000000..56758a8 Binary files /dev/null and b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide differ diff --git a/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide-shm b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide-shm new file mode 100644 index 0000000..f36cf14 Binary files /dev/null and b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide-shm differ diff --git a/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide-wal b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide-wal new file mode 100644 index 0000000..f39af3e Binary files /dev/null and b/Anchal_Hora/CRUD_Operation/.vs/ConsoleApp1/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Anchal_Hora/Readme.md b/Anchal_Hora/Readme.md deleted file mode 100644 index 89d131f..0000000 --- a/Anchal_Hora/Readme.md +++ /dev/null @@ -1 +0,0 @@ -# Anchal Hora \ No newline at end of file diff --git a/Anchal_Hora/panel/.vs/WebApplicationPanel/DesignTimeBuild/.dtbcache b/Anchal_Hora/panel/.vs/WebApplicationPanel/DesignTimeBuild/.dtbcache new file mode 100644 index 0000000..df152d3 Binary files /dev/null and b/Anchal_Hora/panel/.vs/WebApplicationPanel/DesignTimeBuild/.dtbcache differ diff --git a/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/.suo b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/.suo new file mode 100644 index 0000000..ffd4c35 Binary files /dev/null and b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/.suo differ diff --git a/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/db.lock b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/db.lock new file mode 100644 index 0000000..e69de29 diff --git a/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide new file mode 100644 index 0000000..5b62b78 Binary files /dev/null and b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide differ diff --git a/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide-shm b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide-shm new file mode 100644 index 0000000..80e1dbe Binary files /dev/null and b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide-shm differ diff --git a/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide-wal b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide-wal new file mode 100644 index 0000000..92fe5be Binary files /dev/null and b/Anchal_Hora/panel/.vs/WebApplicationPanel/v15/Server/sqlite3/storage.ide-wal differ diff --git a/Anchal_Hora/panel/.vs/config/applicationhost.config b/Anchal_Hora/panel/.vs/config/applicationhost.config new file mode 100644 index 0000000..51ca4c8 --- /dev/null +++ b/Anchal_Hora/panel/.vs/config/applicationhost.config @@ -0,0 +1,983 @@ + + + + + + +
+
+
+
+
+
+
+
+ + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Anchal_Hora/panel/Database/SQLQuery14.sql b/Anchal_Hora/panel/Database/SQLQuery14.sql new file mode 100644 index 0000000..204f6fe --- /dev/null +++ b/Anchal_Hora/panel/Database/SQLQuery14.sql @@ -0,0 +1,11 @@ +CREATE TABLE EmpInformation(SNo int primary key, Projectid VARCHAR(200) , name VARCHAR(500) ,email VARCHAR(200) UNIQUE , [PASSWORD] VARCHAR(200) , [ROLE] VARCHAR(500), ContactNo bigint, ProjectName VARCHAR(200) ); + +INSERT INTO EmpInformation VALUES ('1', 'P1', 'Anchal','horaanchal@gmail.com', 'anchal', 'User1', '6656676878', 'Web development'); +INSERT INTO EmpInformation VALUES ('2', 'P1', 'Anjali','horaanjali@gmail.com', 'anjali', 'User2', '7867665676', 'Web development'); +INSERT INTO EmpInformation VALUES ('3', 'P2', 'Ankush','horaankush@gmail.com', 'ankush', 'User3', '6656566766', 'AI'); +INSERT INTO EmpInformation VALUES ('4', 'P2', 'Resham','horaresham@gmail.com', 'resham', 'User4', '8990876774','AI'); +INSERT INTO EmpInformation VALUES ('5', 'P1', 'Ansh','horaansh@gmail.com', 'ansh', 'Reporting Manager1', '7545347667', 'Web development'); +INSERT INTO EmpInformation VALUES ('6', 'P2', 'Aditya','horaaditya@gmail.com', 'aditya', 'Reporting Manager2', '6378656789', 'AI'); +INSERT INTO EmpInformation VALUES ('7','', 'Raghav','horaraghavl@gmail.com', 'raghav', 'Admin', '5653424789',''); + +SELECT * from EmpInformation ; diff --git a/Anchal_Hora/panel/Login.js b/Anchal_Hora/panel/Login.js new file mode 100644 index 0000000..29074ad --- /dev/null +++ b/Anchal_Hora/panel/Login.js @@ -0,0 +1,62 @@ +function login(){ + document.getElementById("btn").addEventListener("click",postData) + function postData(){ + var Sno=parseInt(document.getElementById("inputid").value); + var Username=document.getElementById("inputName").value; + var Email=document.getElementById("inputEmail").value; + var Password=document.getElementById("inputPassword").value; + +console.log(empLogin); +api(empLogin); + +window.location.href = "./admin/index.html"; + +}; + var empLogin = { + "Sno":Sno, + "Name":Username, + "Email":Email, + "Password":Password + }; + + function parseJwt (token) { + var base64Url = token.split('.')[1]; + var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); + var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) { + return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); + }).join('')); + + console.log(jsonPayload); + printToken(jsonPayload); + debugger; + return JSON.parse(jsonPayload); + + } + + function api(empLogin){ + let json = empLogin; + //sendHTTPReq('POST', "http://localhost:51391/api/Panel", json).then(x => func() ); + var xhr= new XMLHttpRequest(); + var url="http://localhost:51391/api/Login"; + xhr.open('POST', url,true); + xhr.responseType='json'; + xhr.setRequestHeader('Content-type','application/json'); + console.log(JSON.stringify(json)); + xhr.onload = () => { + console.log(xhr.response); + let jwtToken = {} ; + jwtToken = xhr.response; + parseJwt(jwtToken); + debugger; + }; + xhr.onerror = (err) =>{ + console.log(err); + }; + xhr.send(JSON.stringify(json)); +} + //debugger; + +} +function printToken(jsonPayload){ + console.log(jsonPayload); +} \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel.sln b/Anchal_Hora/panel/WebApplicationPanel.sln new file mode 100644 index 0000000..0f6340b --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.28307.1000 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebApplicationPanel", "WebApplicationPanel\WebApplicationPanel.csproj", "{EC1659EB-707D-416C-8BD0-AD72DD2CCE40}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {EC1659EB-707D-416C-8BD0-AD72DD2CCE40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {EC1659EB-707D-416C-8BD0-AD72DD2CCE40}.Debug|Any CPU.Build.0 = Debug|Any CPU + {EC1659EB-707D-416C-8BD0-AD72DD2CCE40}.Release|Any CPU.ActiveCfg = Release|Any CPU + {EC1659EB-707D-416C-8BD0-AD72DD2CCE40}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6291CE64-2D3B-4B27-BB96-989FDEF68E3B} + EndGlobalSection +EndGlobal diff --git a/Anchal_Hora/panel/WebApplicationPanel/Controllers/LoginController.cs b/Anchal_Hora/panel/WebApplicationPanel/Controllers/LoginController.cs new file mode 100644 index 0000000..f6faaff --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Controllers/LoginController.cs @@ -0,0 +1,84 @@ +using System; +using System.Collections.Generic; +using System.IdentityModel.Tokens.Jwt; +using System.Linq; +using System.Security.Claims; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Configuration; +using Microsoft.IdentityModel.Tokens; +using WebApplicationPanel.DbModels; + +// For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860 + +namespace WebappAPItype.Controllers +{ + [Route("api/[controller]")] + [ApiController] + + public class LoginController : Controller + { + private panelContext _panelcontext; + private IConfiguration _config; + private panelContext _panelContext; + + public LoginController(IConfiguration config, panelContext panelcontext) + + { + _panelcontext = panelcontext; + _config = config; + } + + [HttpPost] + public IActionResult Login([FromBody] EmpInformation login) + { + IActionResult response = Unauthorized(); + var user = AuthenticateUser(login); + + if (user != null) + { + var tokenString = GenerateJSONWebToken(user); + response = Ok(new { token = tokenString }); + } + + return response; + } + + private object GenerateJSONWebToken(object user) + { + throw new NotImplementedException(); + } + + private string GenerateJSONWebToken(EmpInformation userInfo) + { + var securityKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(_config["Jwt:Key"])); + var credentials = new SigningCredentials(securityKey, SecurityAlgorithms.HmacSha256); + var claims = new[] { + new Claim("Name", userInfo.Name), + new Claim("Email", userInfo.Email), + new Claim(JwtRegisteredClaimNames.Jti, Guid.NewGuid().ToString()) + }; + + + var token = new JwtSecurityToken(_config["Jwt:Issuer"], + _config["Jwt:Issuer"], + claims, + expires: DateTime.Now.AddMinutes(120), + signingCredentials: credentials); + + return new JwtSecurityTokenHandler().WriteToken(token); + } + + private EmpInformation AuthenticateUser(EmpInformation login) + { + EmpInformation user = _panelcontext.EmpInformation.Where(u => u.Sno == login.Sno && u.Password == login.Password).FirstOrDefault(); + if (user != null) + { + user = new EmpInformation { Email = user.Email, Name=user.Name }; + } + return user; + } + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/Controllers/Panel.cs b/Anchal_Hora/panel/WebApplicationPanel/Controllers/Panel.cs new file mode 100644 index 0000000..ce96ef7 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Controllers/Panel.cs @@ -0,0 +1,10 @@ +namespace WebApplicationPanel.Controllers +{ + internal class Panel + { + public int Sno { get; internal set; } + public int Username { get; internal set; } + public string Emailid { get; internal set; } + public string Password { get; internal set; } + } +} \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/Controllers/PanelController.cs b/Anchal_Hora/panel/WebApplicationPanel/Controllers/PanelController.cs new file mode 100644 index 0000000..1456693 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Controllers/PanelController.cs @@ -0,0 +1,91 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Http; +using System.Configuration; +using Microsoft.AspNetCore.Mvc; +using WebApplicationPanel.DbModels; +using WebappAPItype.CustomModels; +using Microsoft.Extensions.Configuration; + +namespace WebApplicationPanel.Controllers +{ + [Route("api/[controller]")] + [ApiController] + + + public class PanelController : ControllerBase + { + panelContext _panelContext; + + public PanelController(panelContext panelContext) + { + _panelContext = panelContext; + } + [HttpPost] + public IActionResult Createpanel([FromBody]PanelRequest panelRequest) + { + EmpInformation panel = new EmpInformation(); + panel.Sno = panelRequest.Sno; + panel.Name = panelRequest.Name; + panel.Email = panelRequest.Email; + panel.Password = panelRequest.Password; + + _panelContext.EmpInformation.Add(panel); + _panelContext.SaveChanges(); + return Ok("Employee Added"); + + } + + [HttpGet] + public IActionResult Get() + { + List output = _panelContext.EmpInformation.ToList(); + return Ok(output); + } + [HttpGet("{id}")] + + public ActionResult Get(int id) + { + EmpInformation output = _panelContext.EmpInformation.Find(id); + if (output == null) + { + return NotFound(); + } + return Ok(output); + } + + + [HttpPut("{id}")] + + public IActionResult Put(int id, [FromBody]PanelRequest panelRequest) + { + EmpInformation panel = _panelContext.EmpInformation.Find(id); + panel.Email = panelRequest.Email; + panel.Name = panelRequest.Name; + panel.Password = panelRequest.Password; + // _panelContext.EmpInformation.Update(panel); + _panelContext.SaveChanges(); + return Ok("Employee updated"); + + } + + [HttpDelete("{id}")] + + public ActionResult Delete(int id) + { + EmpInformation output = _panelContext.EmpInformation.Where(x => x.Sno == id).FirstOrDefault(); + if (output == null) + { + return NotFound(); + } + //EmpInformation e = new EmpInformation { Sno = id }; + + _panelContext.EmpInformation.Remove(output); + _panelContext.SaveChanges(); + return Ok("Employee Deleted"); + } + } +} + \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/Controllers/deleteController.cs b/Anchal_Hora/panel/WebApplicationPanel/Controllers/deleteController.cs new file mode 100644 index 0000000..241721b --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Controllers/deleteController.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using WebApplicationPanel.CustomModels; +using WebApplicationPanel.DbModels; + +namespace WebApplicationPanel.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class deleteController : Controller + { + panelContext _panelContext; + + //private object panelContext; + //private object panel; + + public deleteController(panelContext panelContext) + { + _panelContext = panelContext; + } + [HttpDelete("{id}")] + + public ActionResult Delete(int id) + { + EmpInformation output = _panelContext.EmpInformation.Where(x => x.Sno == id).FirstOrDefault(); + if (output == null) + { + return NotFound(); + } + //EmpInformation e = new EmpInformation { Sno = id }; + + _panelContext.EmpInformation.Remove(output); + _panelContext.SaveChanges(); + return Ok("Employee Deleted"); + } + } +} \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/Controllers/getController.cs b/Anchal_Hora/panel/WebApplicationPanel/Controllers/getController.cs new file mode 100644 index 0000000..bb0cb95 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Controllers/getController.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using WebApplicationPanel.DbModels; + +namespace WebApplicationPanel.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class getController : Controller + { + panelContext _panelContext; + + //private object panelContext; + //private object panel; + + public getController(panelContext panelContext) + { + _panelContext = panelContext; + } + [HttpGet] + public IActionResult Get() + { + List output = _panelContext.EmpInformation.ToList(); + return Ok(output); + } + } +} \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/Controllers/postController.cs b/Anchal_Hora/panel/WebApplicationPanel/Controllers/postController.cs new file mode 100644 index 0000000..c5af2fa --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Controllers/postController.cs @@ -0,0 +1,38 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using WebApplicationPanel.CustomModels; +using WebApplicationPanel.DbModels; + +namespace WebApplicationPanel.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class postController : Controller + { + panelContext _panelContext; + + //private object panelContext; + //private object panel; + + public postController(panelContext panelContext) + { + _panelContext = panelContext; + } + [HttpPost] + public IActionResult Addpanel([FromBody]PostRequest postRequest) + { + EmpInformation panel = new EmpInformation(); + panel.Sno = postRequest.Sno; + panel.Name = postRequest.Name; + panel.Email = postRequest.Email; + panel.Password = postRequest.Password; + _panelContext.EmpInformation.Add(panel); + _panelContext.SaveChanges(); + return Ok("Employee Added"); + + } + } +} \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/Controllers/updateController.cs b/Anchal_Hora/panel/WebApplicationPanel/Controllers/updateController.cs new file mode 100644 index 0000000..fbb98f6 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Controllers/updateController.cs @@ -0,0 +1,40 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Mvc; +using WebappAPItype.CustomModels; +using WebApplicationPanel.CustomModels; +using WebApplicationPanel.DbModels; + +namespace WebApplicationPanel.Controllers +{ + [Route("api/[controller]")] + [ApiController] + public class updateController : Controller + { + panelContext _panelContext; + + //private object panelContext; + //private object panel; + + public updateController(panelContext panelContext) + { + _panelContext = panelContext; + } + [HttpPut("{id}")] + + public IActionResult Put(int id, [FromBody]UpdateRequest updateRequest) + { + EmpInformation panel = _panelContext.EmpInformation.Find(id); + panel.Sno = updateRequest.Sno; + panel.Name = updateRequest.Name; + panel.Email = updateRequest.Email; + panel.Password = updateRequest.Password; + _panelContext.EmpInformation.Update(panel); + _panelContext.SaveChanges(); + return Ok("Employee updated"); + + } + } +} \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/CustomModels/PanelRequest.cs b/Anchal_Hora/panel/WebApplicationPanel/CustomModels/PanelRequest.cs new file mode 100644 index 0000000..cfc6e0d --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/CustomModels/PanelRequest.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebappAPItype.CustomModels +{ + public class PanelRequest + { + public int Sno { get; set; } + public string Projectid { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public string Password { get; set; } + public string Role { get; set; } + public long? ContactNo { get; set; } + public string ProjectName { get; set; } + + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/CustomModels/postRequest.cs b/Anchal_Hora/panel/WebApplicationPanel/CustomModels/postRequest.cs new file mode 100644 index 0000000..1e24a13 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/CustomModels/postRequest.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebApplicationPanel.CustomModels +{ + public class PostRequest + { + public int Sno { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public string Password { get; set; } + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/CustomModels/updateRequest.cs b/Anchal_Hora/panel/WebApplicationPanel/CustomModels/updateRequest.cs new file mode 100644 index 0000000..1aeb395 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/CustomModels/updateRequest.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; + +namespace WebappAPItype.CustomModels +{ + public class UpdateRequest + { + public int Sno { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public string Password { get; set; } + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/DbModels/EmpInformation.cs b/Anchal_Hora/panel/WebApplicationPanel/DbModels/EmpInformation.cs new file mode 100644 index 0000000..f87d085 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/DbModels/EmpInformation.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; + +namespace WebApplicationPanel.DbModels +{ + public partial class EmpInformation + { + public int Sno { get; set; } + public string Projectid { get; set; } + public string Name { get; set; } + public string Email { get; set; } + public string Password { get; set; } + public string Role { get; set; } + public long? ContactNo { get; set; } + public string ProjectName { get; set; } + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/DbModels/panelContext.cs b/Anchal_Hora/panel/WebApplicationPanel/DbModels/panelContext.cs new file mode 100644 index 0000000..79de404 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/DbModels/panelContext.cs @@ -0,0 +1,69 @@ +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata; + +namespace WebApplicationPanel.DbModels +{ + public partial class panelContext : DbContext + { + //public panelContext() + //{ + //} + + public panelContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet EmpInformation { get; set; } + public object Panel { get; internal set; } + + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.Sno); + + entity.HasIndex(e => e.Email) + .HasName("UQ__EmpInfor__AB6E61641E5DAFB2") + .IsUnique(); + + entity.Property(e => e.Sno) + .HasColumnName("SNo") + .ValueGeneratedNever(); + + entity.Property(e => e.Email) + .HasColumnName("email") + .HasMaxLength(200) + .IsUnicode(false); + + entity.Property(e => e.Name) + .HasColumnName("name") + .HasMaxLength(500) + .IsUnicode(false); + + entity.Property(e => e.Password) + .HasColumnName("PASSWORD") + .HasMaxLength(200) + .IsUnicode(false); + + entity.Property(e => e.ProjectName) + .HasMaxLength(200) + .IsUnicode(false); + + entity.Property(e => e.Projectid) + .HasMaxLength(200) + .IsUnicode(false); + + entity.Property(e => e.Role) + .HasColumnName("ROLE") + .HasMaxLength(500) + .IsUnicode(false); + }); + } + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/Program.cs b/Anchal_Hora/panel/WebApplicationPanel/Program.cs new file mode 100644 index 0000000..af91566 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Program.cs @@ -0,0 +1,24 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Threading.Tasks; +using Microsoft.AspNetCore; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.Logging; + +namespace WebApplicationPanel +{ + public class Program + { + public static void Main(string[] args) + { + CreateWebHostBuilder(args).Build().Run(); + } + + public static IWebHostBuilder CreateWebHostBuilder(string[] args) => + WebHost.CreateDefaultBuilder(args) + .UseStartup(); + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/Properties/launchSettings.json b/Anchal_Hora/panel/WebApplicationPanel/Properties/launchSettings.json new file mode 100644 index 0000000..933b95e --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Properties/launchSettings.json @@ -0,0 +1,30 @@ +{ + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:51391", + "sslPort": 0 + } + }, + "$schema": "http://json.schemastore.org/launchsettings.json", + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "WebApplicationPanel": { + "commandName": "Project", + "launchBrowser": true, + "launchUrl": "api/values", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "applicationUrl": "https://localhost:5001;http://localhost:5000" + } + } +} \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/Startup.cs b/Anchal_Hora/panel/WebApplicationPanel/Startup.cs new file mode 100644 index 0000000..13a8fb4 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/Startup.cs @@ -0,0 +1,75 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNetCore.Authentication.JwtBearer; +using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.HttpsPolicy; +using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; +using Microsoft.IdentityModel.Tokens; + +namespace WebappAPItype +{ + public class Startup + { + public Startup(IConfiguration configuration) + { + Configuration = configuration; + } + + public IConfiguration Configuration { get; } + + // This method gets called by the runtime. Use this method to add services to the container. + + public void ConfigureServices(IServiceCollection services) + { + services.AddAuthentication(JwtBearerDefaults.AuthenticationScheme) + .AddJwtBearer(options => + { + options.TokenValidationParameters = new TokenValidationParameters + { + ValidateIssuer = true, + ValidateAudience = true, + ValidateLifetime = true, + ValidateIssuerSigningKey = true, + ValidIssuer = Configuration["Jwt:Issuer"], + ValidAudience = Configuration["Jwt:Issuer"], + IssuerSigningKey = new SymmetricSecurityKey(Encoding.UTF8.GetBytes(Configuration["Jwt:Key"])) + }; + }); + services.AddMvc(); + services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1); + services.AddDbContext(o => o.UseSqlServer(Configuration["ConnectionString"])); + } + + // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. + public void Configure(IApplicationBuilder app, IHostingEnvironment env) + { + if (env.IsDevelopment()) + { + app.UseDeveloperExceptionPage(); + } + else + { + app.UseHsts(); + } + + app.UseCors(builder => + builder.AllowAnyHeader() + .AllowAnyMethod() + .AllowAnyOrigin()); + app.UseAuthentication(); + app.UseHttpsRedirection(); + app.UseMvc(); + app.UseCookiePolicy(); + + } + } +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/WebApplicationPanel.csproj b/Anchal_Hora/panel/WebApplicationPanel/WebApplicationPanel.csproj new file mode 100644 index 0000000..1700837 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/WebApplicationPanel.csproj @@ -0,0 +1,18 @@ + + + + netcoreapp2.1 + + + + + + + + + + + + + + diff --git a/Anchal_Hora/panel/WebApplicationPanel/WebApplicationPanel.csproj.user b/Anchal_Hora/panel/WebApplicationPanel/WebApplicationPanel.csproj.user new file mode 100644 index 0000000..4a4f2e9 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/WebApplicationPanel.csproj.user @@ -0,0 +1,13 @@ + + + + MvcControllerEmptyScaffolder + root/Controller + 600 + True + False + True + + False + + \ No newline at end of file diff --git a/Anchal_Hora/panel/WebApplicationPanel/appsettings.Development.json b/Anchal_Hora/panel/WebApplicationPanel/appsettings.Development.json new file mode 100644 index 0000000..3760cf0 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/appsettings.Development.json @@ -0,0 +1,10 @@ +{ + "Logging": { + "LogLevel": { + "Default": "Debug", + "System": "Information", + "Microsoft": "Information" + } + }, + "ConnectionString": "server=CYG366\\SQLEXPRESS; database=panel; Trusted_Connection=True;" +} diff --git a/Anchal_Hora/panel/WebApplicationPanel/appsettings.json b/Anchal_Hora/panel/WebApplicationPanel/appsettings.json new file mode 100644 index 0000000..70a4cd3 --- /dev/null +++ b/Anchal_Hora/panel/WebApplicationPanel/appsettings.json @@ -0,0 +1,7 @@ +{ + "Jwt": { + "Key": "ThisismySecretKey", + "Issuer": "Test.com" + }, + "ConnectionString": "server=CYG366\\SQLEXPRESS; database=panel; Trusted_Connection=True;" +} diff --git a/Anchal_Hora/panel/admin/create.html b/Anchal_Hora/panel/admin/create.html new file mode 100644 index 0000000..744dc08 --- /dev/null +++ b/Anchal_Hora/panel/admin/create.html @@ -0,0 +1,82 @@ + + + + + + + + + + + + Manage admin + + +
+ + + +
+ +
+ +
+ +
+

Add users

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+ +
+
+
+ + + + + + + \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/delete.html b/Anchal_Hora/panel/admin/delete.html new file mode 100644 index 0000000..b0c73b9 --- /dev/null +++ b/Anchal_Hora/panel/admin/delete.html @@ -0,0 +1,78 @@ + + + + + + + + + + Manage user + + +
+ + + +
+ +
+ +
+
+ + Manage user +
+ +
+

User Information

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+ +
+ +
+
+
+ + + \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/index.html b/Anchal_Hora/panel/admin/index.html new file mode 100644 index 0000000..16032b8 --- /dev/null +++ b/Anchal_Hora/panel/admin/index.html @@ -0,0 +1,74 @@ + + + + + + + + + + + + Manage admin + + +
+ + + +
+ +
+ +
+ + +
+

Manage users

+ + + + + + + + + + + + + + + + +
SNo.User nameAction
1Anchalupdatedelete
+
+
+ + + + \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/js/delete.js b/Anchal_Hora/panel/admin/js/delete.js new file mode 100644 index 0000000..bc282d2 --- /dev/null +++ b/Anchal_Hora/panel/admin/js/delete.js @@ -0,0 +1,34 @@ +document.getElementById("buttondelete").addEventListener("click",adminDeletedata) +function adminDeletedata(){ + + let id = document.getElementById("id").value; + console.log(id.value); + + // Creating a XHR object + var xhr = new XMLHttpRequest(); + let url = "https://localhost:51391/api/delete/"+id; + + + // open a connection + xhr.open("DELETE", url, true); + + // Set the request header i.e. which type of content you are sending + xhr.setRequestHeader("Content-Type", "application/json"); + + // Create a state change callback + xhr.onreadystatechange = function () { + if (xhr.readyState === 4 && xhr.status === 200) { + alert("deleted user") + console.log(url); + } + else{ + alert("no user with such ID"); + } + }; + + // Converting JSON data to string + var data = JSON.stringify({ "id": id.value}); + + // Sending data with the request + xhr.send(data); +} \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/js/get.js b/Anchal_Hora/panel/admin/js/get.js new file mode 100644 index 0000000..7b79ac0 --- /dev/null +++ b/Anchal_Hora/panel/admin/js/get.js @@ -0,0 +1,27 @@ +function adminGet(){} + + fetch('https://localhost:51391/api/get') + .then(function (response) { + return response.json(); + }) + .then(function (data) { + appendData(data); + }) + .catch(function (err) { + console.log(err); + }); + +function appendData(data) +{ + var users = document.getElementById("users"); + console.log(users); + + for (var i = 0; i < data.length; i++) { + var div = document.createElement("div"); + div.innerHTML = 'Name: ' + data[i].name + "Email :" + data[i].email + "Password :" + data[i].password + "ContactNo :" + data[i].contactno; + users.appendChild(div); + } +} + + + diff --git a/Anchal_Hora/panel/admin/js/post.js b/Anchal_Hora/panel/admin/js/post.js new file mode 100644 index 0000000..c3606f9 --- /dev/null +++ b/Anchal_Hora/panel/admin/js/post.js @@ -0,0 +1,28 @@ +document.getElementById("buttonsignup").addEventListener("click",adminPostdata); +function adminPostdata(){ + var Sno=document.getElementById("inputSno").value; + var Username=document.getElementById("inputName").value; + var Email=document.getElementById("inputEmail").value; + var Password=document.getElementById("inputPassword").value; + + var format={ + "Sno":Sno, + "Name":Username, + "Email":Email, + "Password":Password + }; + console.log(format); + //sendHTTPReq('POST', "http://localhost:51391/api/Panel", json).then(x => func() ); + var xhr= new XMLHttpRequest(); + var url="http://localhost:51391/api/post"; + xhr.open('POST', url,true); + xhr.responseType='json'; + xhr.setRequestHeader('Content-type','application/json'); + console.log(JSON.stringify(format)); + xhr.onload = () => { + console.log(xhr.status); + //var jwtToken = xhr.response.token; + + }; + xhr.send(JSON.stringify(format)); +} \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/js/update.js b/Anchal_Hora/panel/admin/js/update.js new file mode 100644 index 0000000..e8dfe1c --- /dev/null +++ b/Anchal_Hora/panel/admin/js/update.js @@ -0,0 +1,43 @@ +document.getElementById("buttonupdate").addEventListener("click",adminUpdatedata); +function adminUpdatedata(){ + var Sno=document.getElementById("inputSno").value; + var Username=document.getElementById("inputName").value; + var Email=document.getElementById("inputEmail").value; + var Password=document.getElementById("inputPassword").value; + + + // Creating a XHR object + var xhr = new XMLHttpRequest(); + let url = "https://localhost:51391/api/update/"+id; + console.log(url); + + // open a connection + xhr.open("PUT", url, true); + + // Set the request header i.e. which type of content you are sending + xhr.setRequestHeader("Content-Type", "application/json"); + + // Create a state change callback + xhr.onreadystatechange = function () { + if (xhr.readyState===4){ + if (xhr.status === 200) { + console.log("updated"); + alert("successfully updated"); + } + else { + alert("unsuccessful"); + } + } + }; + + // Converting JSON data to string + var data = JSON.stringify({ + "Sno":Sno, + "Name":Username, + "Email":Email, + "Password":Password }); + console.log(data); + + // Sending data with the request + xhr.send(data); +} \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/styles/admin.css b/Anchal_Hora/panel/admin/styles/admin.css new file mode 100644 index 0000000..a1790ef --- /dev/null +++ b/Anchal_Hora/panel/admin/styles/admin.css @@ -0,0 +1,82 @@ +header{ + background: #01474a; +} +.nav{ + display: flex; +} +.admin-wrapper{ + display: flex; + height:calc(100%-66px); +} +.admin-wrapper .left-sidebar{ + flex:3; + height:100vh; + background: #FF7F50 ; + border-top: 1px solid black; +} +.admin-wrapper .left-sidebar ul{ + list-style:none; + margin-top:4rem; + text-align: center; + padding: 4rem; + border:5rem; + color:white; + +} +.admin-wrapper .left-sidebar ul li a { + padding:18px; + display: block; + border-bottom:1px solid black; +} +.admin-wrapper .left-sidebar ul li a:hover { + background:rgb(121, 145, 165); +} + +.admin-wrapper .admin-content{ + flex:7; + height:100%; + padding:40px 100px 100px; + +} +.admin-content .page-title{ + text-align:center; + margin-bottom:1.5rem; +} +table{ + width:100%; + border-collapse:collapse; + font-size:1.1rem; + +} + +th, +td{ + padding:15px; + text-align:left; + border-bottom:1px solid darkkhaki; +} + +.edit{ + color:firebrick; +} +.update{ + color:forestgreen; +} +.delete{ + color:darkslategray; +} + +.edit:hover, +.delete:hover, +.publish:hover{ + text-decoration:underline; +} + +form div{ + margin-bottom: 15px; +} + + + + + diff --git a/Anchal_Hora/panel/admin/styles/style.css b/Anchal_Hora/panel/admin/styles/style.css new file mode 100644 index 0000000..c1b7ff2 --- /dev/null +++ b/Anchal_Hora/panel/admin/styles/style.css @@ -0,0 +1,95 @@ +*{ + box-sizing:border-box; +} + +body{ + padding:0px; + margin:0px; + background: #f6f6f6; + font-family: 'Lora', serif; +} + +header{ + background: #008489; + height:66px; +} + +header * { + color: white; +} + +header .logo{ + float:left; + height:inherit; + margin-left:2em; + +} + +header .logo-text{ +margin:10px; +font-family: 'Condal', serif; +} + +header .logo-text span { + color:#FF4500; + +} + +header ul{ + float:right; + margin:0px; + padding:0px; + list-style: none; +} + +header ul li{ + float:left; + position:relative; +} + +header ul li ul{ + position:absolute; + top:66px; + right:0px; + width:180px; + display:none; +} + +header ul li:hover ul{ + display:block; +} + +header ul li ul li{ + width:100%; +} + +header ul li ul li a{ + padding:10px; + background:white; + color:#444; +} + +header ul li ul li a{ + color:red; +} + +header ul li ul li a:hover{ + background: #d5d5d6; +} + + +header ul li a{ + display:block; + padding:21px; + font-size:1.1em; + text-decoration:none; +} + +header ul li a:hover{ + background: #008489; + transition:0.5s; +} + +header.menu-toggle{ + display:none; +} \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/update.html b/Anchal_Hora/panel/admin/update.html new file mode 100644 index 0000000..675ede0 --- /dev/null +++ b/Anchal_Hora/panel/admin/update.html @@ -0,0 +1,77 @@ + + + + + + + + + + Manage user + + +
+ + + +
+ +
+ +
+
+ + Manage user +
+ +
+

User Information

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+ +
+
+
+ + + \ No newline at end of file diff --git a/Anchal_Hora/panel/admin/view.html b/Anchal_Hora/panel/admin/view.html new file mode 100644 index 0000000..7e62d02 --- /dev/null +++ b/Anchal_Hora/panel/admin/view.html @@ -0,0 +1,54 @@ + + + + + + + + + + + + Manage admin + + +
+ + + +
+ +
+ +
+
+ + + + \ No newline at end of file diff --git a/Anchal_Hora/panel/index.html b/Anchal_Hora/panel/index.html new file mode 100644 index 0000000..e57ac10 --- /dev/null +++ b/Anchal_Hora/panel/index.html @@ -0,0 +1,64 @@ + + + + + + + + + + Document + + + +
+

login Form

+
+ + + + + diff --git a/Anchal_Hora/panel/manager/create.html b/Anchal_Hora/panel/manager/create.html new file mode 100644 index 0000000..4561f31 --- /dev/null +++ b/Anchal_Hora/panel/manager/create.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + Manage manager + + +
+ + + +
+ +
+ +
+ +
+

Add users

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+ +
+
+
+ + + + \ No newline at end of file diff --git a/Anchal_Hora/panel/manager/index.html b/Anchal_Hora/panel/manager/index.html new file mode 100644 index 0000000..2786c77 --- /dev/null +++ b/Anchal_Hora/panel/manager/index.html @@ -0,0 +1,71 @@ + + + + + + + + + + + + Manage manager + + +
+ + + +
+ +
+ +
+ + +
+

Manage users

+ + + + + + + + + + + + + + + +
SNo.User nameAction
1Anchalupdate
+
+
+ + + \ No newline at end of file diff --git a/Anchal_Hora/panel/manager/styles/admin.css b/Anchal_Hora/panel/manager/styles/admin.css new file mode 100644 index 0000000..8b3987a --- /dev/null +++ b/Anchal_Hora/panel/manager/styles/admin.css @@ -0,0 +1,86 @@ +header{ + background: #01474a; +} +.nav{ + display: flex; +} +.admin-wrapper{ + display: flex; + height:calc(100%-66px); +} + +.admin-wrapper .left-sidebar{ + flex:3; + height:100vh; + background: #FF7F50; + border-top: 1px solid black; + +} +.admin-wrapper .left-sidebar ul{ + list-style:none; + margin-top:4rem; + text-align: center; + padding: 4rem; + border:5rem; + color:white; + +} + +.admin-wrapper .left-sidebar ul li a { + padding:18px; + display: block; + border-bottom:1px solid black; +} + +.admin-wrapper .left-sidebar ul li a:hover { + background:rgb(121, 145, 165); +} + +.admin-wrapper .admin-content{ + flex:7; + height:100%; + padding:40px 100px 100px; + +} + +.admin-content .page-title{ + text-align:center; + margin-bottom:1.5rem; +} +table{ + width:100%; + border-collapse:collapse; + font-size:1.1rem; +} + +th, +td{ + padding:15px; + text-align:left; + border-bottom:1px solid darkkhaki; +} + +.edit{ + color:firebrick; +} +.update{ + color:forestgreen; +} +.delete{ + color:darkslategray; +} + +.edit:hover, +.delete:hover, +.publish:hover{ + text-decoration:underline; +} + +form div{ + margin-bottom: 15px; +} + + + + + diff --git a/Anchal_Hora/panel/manager/styles/style.css b/Anchal_Hora/panel/manager/styles/style.css new file mode 100644 index 0000000..c1b7ff2 --- /dev/null +++ b/Anchal_Hora/panel/manager/styles/style.css @@ -0,0 +1,95 @@ +*{ + box-sizing:border-box; +} + +body{ + padding:0px; + margin:0px; + background: #f6f6f6; + font-family: 'Lora', serif; +} + +header{ + background: #008489; + height:66px; +} + +header * { + color: white; +} + +header .logo{ + float:left; + height:inherit; + margin-left:2em; + +} + +header .logo-text{ +margin:10px; +font-family: 'Condal', serif; +} + +header .logo-text span { + color:#FF4500; + +} + +header ul{ + float:right; + margin:0px; + padding:0px; + list-style: none; +} + +header ul li{ + float:left; + position:relative; +} + +header ul li ul{ + position:absolute; + top:66px; + right:0px; + width:180px; + display:none; +} + +header ul li:hover ul{ + display:block; +} + +header ul li ul li{ + width:100%; +} + +header ul li ul li a{ + padding:10px; + background:white; + color:#444; +} + +header ul li ul li a{ + color:red; +} + +header ul li ul li a:hover{ + background: #d5d5d6; +} + + +header ul li a{ + display:block; + padding:21px; + font-size:1.1em; + text-decoration:none; +} + +header ul li a:hover{ + background: #008489; + transition:0.5s; +} + +header.menu-toggle{ + display:none; +} \ No newline at end of file diff --git a/Anchal_Hora/panel/manager/update.html b/Anchal_Hora/panel/manager/update.html new file mode 100644 index 0000000..1527648 --- /dev/null +++ b/Anchal_Hora/panel/manager/update.html @@ -0,0 +1,76 @@ + + + + + + + + + + Manage user + + +
+ + + +
+ +
+ +
+
+ + Manage user +
+ +
+

User Information

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+
+
+
+ + + \ No newline at end of file diff --git a/Anchal_Hora/panel/signup.js b/Anchal_Hora/panel/signup.js new file mode 100644 index 0000000..1cff049 --- /dev/null +++ b/Anchal_Hora/panel/signup.js @@ -0,0 +1,31 @@ +document.getElementById("btn").addEventListener("click",postData) +function postData(){ + var Sno=parseInt(document.getElementById("inputid").value); + var Username=document.getElementById("inputName").value; + var Email=document.getElementById("inputEmail").value; + var Password=document.getElementById("inputPassword").value; + + + var json={ + "Sno":Sno, + "Name":Username, + "Email":Email, + "Password":Password + }; + console.log(json); + //sendHTTPReq('POST', "http://localhost:51391/api/Panel", json).then(x => func() ); + var xhr= new XMLHttpRequest(); + var url="http://localhost:51391/api/Panel"; + xhr.open('POST', url,true); + xhr.responseType='json'; + xhr.setRequestHeader('Content-type','application/json'); + console.log(JSON.stringify(json)); + xhr.onload = () => { + console.log(xhr.status); + //var jwtToken = xhr.response.token; + + }; + xhr.send(JSON.stringify(json)); +} + + diff --git a/Anchal_Hora/panel/style.css b/Anchal_Hora/panel/style.css new file mode 100644 index 0000000..970f806 --- /dev/null +++ b/Anchal_Hora/panel/style.css @@ -0,0 +1,54 @@ +body#LoginForm{ background-image:url("https://hdwallsource.com/img/2014/9/blur-26347-27038-hd-wallpapers.jpg"); background-repeat:no-repeat; background-position:center; background-size:cover; padding:10px;} + +.form-heading { color:#fff; font-size:23px;} + +.panel h2{ color:#444444; font-size:18px; margin:0 0 8px 0;} +.panel p { color:#777777; font-size:14px; margin-bottom:30px; line-height:24px;} +.login-form .form-control { + background: #f7f7f7 none repeat scroll 0 0; + border: 1px solid #d4d4d4; + border-radius: 1rem; + font-size: 14px; + height: 50px; + line-height: 50px; +} +.main-div { + background: #ffffff none repeat scroll 0 0; + border-radius: 1rem; + margin: 1px auto 10px; + max-width: 38%; + padding: 1px 10px 10px 20px; +} + +.login-form .form-group { + margin-bottom:5px; +} +.login-form{ text-align:center;} +.forgot a { + color: #777777; + font-size: 14px; + text-decoration: underline; +} +.login-form .btn.btn-primary { + background: #f0ad4e none repeat scroll 0 0; + border-color: #f0ad4e; + color: #ffffff; + font-size: 14px; + width: 100%; + height: 50px; + line-height: 50px; + padding: 0; +} +.forgot { + text-align: left; margin-bottom:5px; +} +.botto-text { + color: #ffffff; + font-size: 14px; + margin: auto; +} +.login-form .btn.btn-primary.reset { + background: #ff9900 none repeat scroll 0 0; +} +.back { text-align: left; margin-top:10px;} +.back a {color: #444444; font-size: 13px;text-decoration: none;} diff --git a/Anchal_Hora/panel/user/index.html b/Anchal_Hora/panel/user/index.html new file mode 100644 index 0000000..a9b6d57 --- /dev/null +++ b/Anchal_Hora/panel/user/index.html @@ -0,0 +1,78 @@ + + + + + + + + + + + + Manage user + + +
+ + + +
+ +
+ +
+
+ + Manage user +
+ +
+

User Information

+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+ +
+ +
+
+
+
+
+ + + \ No newline at end of file diff --git a/Anchal_Hora/panel/user/styles/admin.css b/Anchal_Hora/panel/user/styles/admin.css new file mode 100644 index 0000000..2171d15 --- /dev/null +++ b/Anchal_Hora/panel/user/styles/admin.css @@ -0,0 +1,87 @@ +header{ + background: #01474a; +} +.nav{ + display: flex; +} + +.admin-wrapper{ + display: flex; + height:calc(100%-66px); + +} + +.admin-wrapper .left-sidebar{ + flex:3; + height:100vh; + background: #FF7F50; + border-top: 1px solid black; + +} +.admin-wrapper .left-sidebar ul{ + list-style:none; + margin-top:4rem; + text-align: center; + padding: 4rem; + border:5rem; + color:white; +} + +.admin-wrapper .left-sidebar ul li a { + padding:18px; + display: block; + border-bottom:1px solid black; +} + +.admin-wrapper .left-sidebar ul li a:hover { + background:rgb(121, 145, 165); +} + +.admin-wrapper .admin-content{ + flex:7; + height:100%; + padding:40px 100px 100px; + +} + +.admin-content .page-title{ + text-align:center; + margin-bottom:1.5rem; +} +table{ + width:100%; + border-collapse:collapse; + font-size:1.1rem; +} + +th, +td{ + padding:15px; + text-align:left; + border-bottom:1px solid darkkhaki; +} + +.edit{ + color:firebrick; +} +.update{ + color:forestgreen; +} +.delete{ + color:darkslategray; +} + +.edit:hover, +.delete:hover, +.publish:hover{ + text-decoration:underline; +} + +form div{ + margin-bottom: 15px; +} + + + + + diff --git a/Anchal_Hora/panel/user/styles/style.css b/Anchal_Hora/panel/user/styles/style.css new file mode 100644 index 0000000..c1b7ff2 --- /dev/null +++ b/Anchal_Hora/panel/user/styles/style.css @@ -0,0 +1,95 @@ +*{ + box-sizing:border-box; +} + +body{ + padding:0px; + margin:0px; + background: #f6f6f6; + font-family: 'Lora', serif; +} + +header{ + background: #008489; + height:66px; +} + +header * { + color: white; +} + +header .logo{ + float:left; + height:inherit; + margin-left:2em; + +} + +header .logo-text{ +margin:10px; +font-family: 'Condal', serif; +} + +header .logo-text span { + color:#FF4500; + +} + +header ul{ + float:right; + margin:0px; + padding:0px; + list-style: none; +} + +header ul li{ + float:left; + position:relative; +} + +header ul li ul{ + position:absolute; + top:66px; + right:0px; + width:180px; + display:none; +} + +header ul li:hover ul{ + display:block; +} + +header ul li ul li{ + width:100%; +} + +header ul li ul li a{ + padding:10px; + background:white; + color:#444; +} + +header ul li ul li a{ + color:red; +} + +header ul li ul li a:hover{ + background: #d5d5d6; +} + + +header ul li a{ + display:block; + padding:21px; + font-size:1.1em; + text-decoration:none; +} + +header ul li a:hover{ + background: #008489; + transition:0.5s; +} + +header.menu-toggle{ + display:none; +} \ No newline at end of file