1) Исправления в связи со сменой API MySQL
[openlib.git] / www / login.html
diff --git a/www/login.html b/www/login.html
new file mode 100644 (file)
index 0000000..e4ce813
--- /dev/null
@@ -0,0 +1,97 @@
+<!DOCTYPE html>\r
+<html xmlns="http://www.w3.org/1999/xhtml">\r
+<head>\r
+    <meta name="viewport" content="width=device-width, initial-scale=1.0" />\r
+    <title>COPS</title>\r
+    <script type="text/javascript" src="resources/jQuery/jquery-1.10.2.min.js"></script>\r
+    <link rel='stylesheet' type='text/css' href='http://fonts.googleapis.com/css?family=Open+Sans:400,300italic,800,300,400italic,600,600italic,700,700italic,800italic' />\r
+    <style media="screen" type="text/css">\r
+        body{\r
+            background:white;\r
+            font-family:'Open Sans';\r
+        }\r
+        \r
+        #block{\r
+            width:230px;\r
+            height:113px;\r
+            margin:auto;\r
+            background:#2c3e50;\r
+            margin-top:100px;\r
+            border-radius:2px;\r
+        }\r
+        \r
+        #block:before{\r
+            content:'';\r
+            display:block;\r
+            width:230px;\r
+            height:3px;\r
+        }\r
+        \r
+        #block:after{\r
+            content:'';\r
+            display:block;\r
+        }\r
+        \r
+        #block input[type=text],#block  input[type=password] {\r
+            font-family:'Open Sans';\r
+            width:156px;\r
+            height:32px;\r
+            margin:15px 15px;\r
+            border:0;\r
+            border-radius:2px;\r
+            display:block;\r
+            font-size:18px;\r
+        }\r
+        \r
+        #block input[type=password]{\r
+            width:156px;\r
+            height:32px;\r
+            margin:-5px 15px;\r
+        }\r
+        #submit{\r
+            position:absolute;\r
+            width:33px;\r
+            height:34px;\r
+            background:#9b59b6;\r
+            margin:15px;\r
+            color:#ffffff;\r
+            border:0;\r
+            margin:-29px 180px;\r
+            font-size:22px;\r
+            padding:0;\r
+        }\r
+    </style>\r
+    <script>\r
+        $(document).ready(function()\r
+        {\r
+            $('#loginForm').submit(function()\r
+            {\r
+              var username = $('#user').val();\r
+              var password = $('#password').val();\r
+\r
+              $.ajax(\r
+                {\r
+                  'password' : password,\r
+                  'username' : username,\r
+                  'url'      : 'index.php',\r
+                  'type'     : 'GET',\r
+                  'success'  : function(){ window.location = 'index.php'; },\r
+                  'error'    : function(){ alert('Bad Login Details');},\r
+                }\r
+              );\r
+\r
+              return false;\r
+            });\r
+        });\r
+    </script>\r
+</head>\r
+<body>\r
+    <form id="loginForm">\r
+    <div id="block">\r
+        <input id="user" type="text" placeholder="Username" required="required" />\r
+        <input id="password" type="password" placeholder="Password" required="required" />\r
+        <input id="submit" type="submit" value="&#x2192;" />\r
+    </div>\r
+    </form>\r
+</body>\r
+</html>
\ No newline at end of file