{"action":"created","comment":{"url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/comments/69507541","id":69507541,"diff_hunk":"@@ -0,0 +1,144 @@\n+<?php\n+session_start();\n+\n+if (isset($_COOKIE['emp_id']) && isset($_COOKIE['is_completed']))\n+{\n+    $_SESSION['emp_id'] = $_COOKIE['emp_id'];\n+    $_SESSION['is_completed'] = $_COOKIE['is_completed'];\n+}\n+\n+if (isset($_SESSION['emp_id']) && isset($_SESSION['is_completed']))\n+{\n+    switch ($_SESSION['is_completed'])\n+    {\n+        case '0':\n+            header('Location: form.php');\n+            break;\n+        case '1':\n+            header('Location: home.php');\n+            break;\n+        default :\n+            header('Location: error.php');\n+    }\n+}\n+$email_err = '';\n+$pwd_err = '';\n+$emp_id = TRUE;\n+$email = '';\n+\n+require_once('classlib/Database.php');\n+require_once('classlib/Validation.php');\n+require_once('classlib/Employee.php');\n+\n+$db_obj = Database::get_instance();\n+\n+if (isset($_POST['login']))\n+{\n+    $valid = new validation($db_obj);\n+    $email = isset($_POST['email']) ? $valid->sanitize_input($_POST['email']) : '';\n+    $password = isset($_POST['password']) ? $valid->sanitize_input($_POST['password']) : '';\n+\n+    if ( ! $valid->is_empty($email))\n+    {\n+        $email_err = '<strong>Error!</strong> Email field cannot be left blank';\n+    }\n+    else if ( 0 === $valid->is_valid_employee($email, hash('sha256', $password)))\n+    {\n+        $pwd_err = '<strong>Error!</strong> Incorrect Email or Password';\n+    }\n+    else if ( FALSE === $valid->is_valid_employee($email, hash('sha256', $password)))\n+    {\n+        header('Location: error.php');\n+    }\n+    else\n+    {\n+        $value = $valid->is_valid_employee($email, hash('sha256', $password));\n+        $_SESSION['emp_id'] = $value['id'];\n+        $_SESSION['is_completed'] = $value['is_completed'];\n+\n+        if ('checkbox' === $_POST['checkbox'])\n+        {\n+            setcookie('emp_id', $value['id'], time() + (86400 * 14), '/');\n+            setcookie('is_completed', $value['is_completed'], time() + (86400 * 14), '/');\n+        }\n+\n+        if (0 == $value['is_completed'])\n+        {\n+             header('Location: form.php');\n+        }\n+\n+        header('Location: home.php');\n+    }\n+}\n+?>\n+<!DOCTYPE html>\n+<html>\n+    <head>\n+        <meta charset=\"UTF-8\">\n+        <meta content=\"width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no\"\n+            name=\"viewport\">\n+        <title>Login</title>\n+        <link rel=\"stylesheet\" href=\"css/bootstrap.min.css\" />\n+        <link rel=\"stylesheet\" href=\"css/index.css\"/>\n+        <script src=\"https://ajax.googleapis.com/ajax/libs/jquery/1.12.2/jquery.min.js\"></script>\n+        <script src=\"js/bootstrap.min.js\"></script>\n+    </head>\n+    <body class=\"container_body\">\n+        <div class=\"container-fluid\">\n+            <div class=\"jumbotron transbox\">\n+                <h1>Employee </h1>\n+            </div>\n+            <div class=\"container\">\n+                <div class=\"row\">\n+                    <div class=\"col-sm-12 col-xs-12 col-md-6 col-md-offset-3 col-lg-6 col-lg-offset-3\">\n+                        <div class=\"well well-lg page-header\">\n+                            <div class=\"btn-group btn-group-justified page-header\">\n+                                <a class=\"btn btn-lg btn-primary active\">Login</a>\n+                                <a href=\"register.php\" class=\"btn btn-lg btn-primary\">Register</a>\n+                            </div>\n+                            <div>\n+                                <form role=\"form\" id=\"login\" method=\"post\" action=\"\">\n+                                    <div class=\"form-group\">\n+                                        <div class=\"input-group input-group-lg\">\n+                                            <span class=\"input-group-addon\" id=\"sizing-addon1\">\n+                                                <span class=\"glyphicon glyphicon-user\"\n+                                                    aria-hidden=\"true\"></span>\n+                                            </span>\n+                                            <input type=\"email\" class=\"form-control empty\"\n+                                                id=\"email\" name=\"email\" placeholder=\"Email\">\n+                                        </div>\n+                                        <div class=\"alert-danger\" id=\"email_err\">\n+                                        </div>\n+                                    </div>\n+                                    <div class=\"form-group\">\n+                                        <div class=\"input-group input-group-lg\">\n+                                            <span class=\"input-group-addon\" id=\"sizing-addon1\">\n+                                                <span class=\"glyphicon glyphicon-lock\"></span>\n+                                            </span>\n+                                            <input type=\"password\" class=\"form-control empty\"\n+                                                id=\"pwd\" name=\"password\" placeholder=\"Password\">\n+                                        </div>\n+                                        <div class=\"alert-danger\" id=\"pwd_err\">\n+                                        <?php echo $pwd_err;?>\n+                                        </div>\n+                                    </div>\n+                                    <div class=\"checkbox\">\n+                                        <label><input type=\"checkbox\" name=\"checkbox\"\n+                                            value=\"checkbox\"> Remember me</label>","path":"index.php","position":127,"original_position":127,"commit_id":"500c9ac45abfd697ca4c64b8e093c6bbbf763d22","original_commit_id":"500c9ac45abfd697ca4c64b8e093c6bbbf763d22","user":{"login":"satejkumar","id":8774058,"avatar_url":"https://avatars.githubusercontent.com/u/8774058?v=3","gravatar_id":"","url":"https://api.github.com/users/satejkumar","html_url":"https://github.com/satejkumar","followers_url":"https://api.github.com/users/satejkumar/followers","following_url":"https://api.github.com/users/satejkumar/following{/other_user}","gists_url":"https://api.github.com/users/satejkumar/gists{/gist_id}","starred_url":"https://api.github.com/users/satejkumar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/satejkumar/subscriptions","organizations_url":"https://api.github.com/users/satejkumar/orgs","repos_url":"https://api.github.com/users/satejkumar/repos","events_url":"https://api.github.com/users/satejkumar/events{/privacy}","received_events_url":"https://api.github.com/users/satejkumar/received_events","type":"User","site_admin":false},"body":"Space before remember me","created_at":"2016-07-05T04:51:46Z","updated_at":"2016-07-05T04:51:46Z","html_url":"https://github.com/sanjeebr/Profile_App/pull/3#discussion_r69507541","pull_request_url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/comments/69507541"},"html":{"href":"https://github.com/sanjeebr/Profile_App/pull/3#discussion_r69507541"},"pull_request":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3","id":75986873,"html_url":"https://github.com/sanjeebr/Profile_App/pull/3","diff_url":"https://github.com/sanjeebr/Profile_App/pull/3.diff","patch_url":"https://github.com/sanjeebr/Profile_App/pull/3.patch","issue_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues/3","number":3,"state":"open","locked":false,"title":"J query","user":{"login":"sanjeebr","id":19812158,"avatar_url":"https://avatars.githubusercontent.com/u/19812158?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjeebr","html_url":"https://github.com/sanjeebr","followers_url":"https://api.github.com/users/sanjeebr/followers","following_url":"https://api.github.com/users/sanjeebr/following{/other_user}","gists_url":"https://api.github.com/users/sanjeebr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjeebr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjeebr/subscriptions","organizations_url":"https://api.github.com/users/sanjeebr/orgs","repos_url":"https://api.github.com/users/sanjeebr/repos","events_url":"https://api.github.com/users/sanjeebr/events{/privacy}","received_events_url":"https://api.github.com/users/sanjeebr/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-07-01T14:19:17Z","updated_at":"2016-07-05T04:51:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c70ce8526c127faa1217514204b8ec81f7ff0349","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3/commits","review_comments_url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3/comments","review_comment_url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues/3/comments","statuses_url":"https://api.github.com/repos/sanjeebr/Profile_App/statuses/500c9ac45abfd697ca4c64b8e093c6bbbf763d22","head":{"label":"sanjeebr:jQuery","ref":"jQuery","sha":"500c9ac45abfd697ca4c64b8e093c6bbbf763d22","user":{"login":"sanjeebr","id":19812158,"avatar_url":"https://avatars.githubusercontent.com/u/19812158?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjeebr","html_url":"https://github.com/sanjeebr","followers_url":"https://api.github.com/users/sanjeebr/followers","following_url":"https://api.github.com/users/sanjeebr/following{/other_user}","gists_url":"https://api.github.com/users/sanjeebr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjeebr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjeebr/subscriptions","organizations_url":"https://api.github.com/users/sanjeebr/orgs","repos_url":"https://api.github.com/users/sanjeebr/repos","events_url":"https://api.github.com/users/sanjeebr/events{/privacy}","received_events_url":"https://api.github.com/users/sanjeebr/received_events","type":"User","site_admin":false},"repo":{"id":61516489,"name":"Profile_App","full_name":"sanjeebr/Profile_App","owner":{"login":"sanjeebr","id":19812158,"avatar_url":"https://avatars.githubusercontent.com/u/19812158?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjeebr","html_url":"https://github.com/sanjeebr","followers_url":"https://api.github.com/users/sanjeebr/followers","following_url":"https://api.github.com/users/sanjeebr/following{/other_user}","gists_url":"https://api.github.com/users/sanjeebr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjeebr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjeebr/subscriptions","organizations_url":"https://api.github.com/users/sanjeebr/orgs","repos_url":"https://api.github.com/users/sanjeebr/repos","events_url":"https://api.github.com/users/sanjeebr/events{/privacy}","received_events_url":"https://api.github.com/users/sanjeebr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sanjeebr/Profile_App","description":"","fork":false,"url":"https://api.github.com/repos/sanjeebr/Profile_App","forks_url":"https://api.github.com/repos/sanjeebr/Profile_App/forks","keys_url":"https://api.github.com/repos/sanjeebr/Profile_App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanjeebr/Profile_App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanjeebr/Profile_App/teams","hooks_url":"https://api.github.com/repos/sanjeebr/Profile_App/hooks","issue_events_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues/events{/number}","events_url":"https://api.github.com/repos/sanjeebr/Profile_App/events","assignees_url":"https://api.github.com/repos/sanjeebr/Profile_App/assignees{/user}","branches_url":"https://api.github.com/repos/sanjeebr/Profile_App/branches{/branch}","tags_url":"https://api.github.com/repos/sanjeebr/Profile_App/tags","blobs_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanjeebr/Profile_App/statuses/{sha}","languages_url":"https://api.github.com/repos/sanjeebr/Profile_App/languages","stargazers_url":"https://api.github.com/repos/sanjeebr/Profile_App/stargazers","contributors_url":"https://api.github.com/repos/sanjeebr/Profile_App/contributors","subscribers_url":"https://api.github.com/repos/sanjeebr/Profile_App/subscribers","subscription_url":"https://api.github.com/repos/sanjeebr/Profile_App/subscription","commits_url":"https://api.github.com/repos/sanjeebr/Profile_App/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanjeebr/Profile_App/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanjeebr/Profile_App/contents/{+path}","compare_url":"https://api.github.com/repos/sanjeebr/Profile_App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanjeebr/Profile_App/merges","archive_url":"https://api.github.com/repos/sanjeebr/Profile_App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanjeebr/Profile_App/downloads","issues_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues{/number}","pulls_url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls{/number}","milestones_url":"https://api.github.com/repos/sanjeebr/Profile_App/milestones{/number}","notifications_url":"https://api.github.com/repos/sanjeebr/Profile_App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanjeebr/Profile_App/labels{/name}","releases_url":"https://api.github.com/repos/sanjeebr/Profile_App/releases{/id}","deployments_url":"https://api.github.com/repos/sanjeebr/Profile_App/deployments","created_at":"2016-06-20T04:20:09Z","updated_at":"2016-06-20T04:30:15Z","pushed_at":"2016-07-01T14:19:18Z","git_url":"git://github.com/sanjeebr/Profile_App.git","ssh_url":"git@github.com:sanjeebr/Profile_App.git","clone_url":"https://github.com/sanjeebr/Profile_App.git","svn_url":"https://github.com/sanjeebr/Profile_App","homepage":null,"size":6064,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"base":{"label":"sanjeebr:master","ref":"master","sha":"03a53d245d3877ca202752e0db59cb25ec7215cd","user":{"login":"sanjeebr","id":19812158,"avatar_url":"https://avatars.githubusercontent.com/u/19812158?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjeebr","html_url":"https://github.com/sanjeebr","followers_url":"https://api.github.com/users/sanjeebr/followers","following_url":"https://api.github.com/users/sanjeebr/following{/other_user}","gists_url":"https://api.github.com/users/sanjeebr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjeebr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjeebr/subscriptions","organizations_url":"https://api.github.com/users/sanjeebr/orgs","repos_url":"https://api.github.com/users/sanjeebr/repos","events_url":"https://api.github.com/users/sanjeebr/events{/privacy}","received_events_url":"https://api.github.com/users/sanjeebr/received_events","type":"User","site_admin":false},"repo":{"id":61516489,"name":"Profile_App","full_name":"sanjeebr/Profile_App","owner":{"login":"sanjeebr","id":19812158,"avatar_url":"https://avatars.githubusercontent.com/u/19812158?v=3","gravatar_id":"","url":"https://api.github.com/users/sanjeebr","html_url":"https://github.com/sanjeebr","followers_url":"https://api.github.com/users/sanjeebr/followers","following_url":"https://api.github.com/users/sanjeebr/following{/other_user}","gists_url":"https://api.github.com/users/sanjeebr/gists{/gist_id}","starred_url":"https://api.github.com/users/sanjeebr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sanjeebr/subscriptions","organizations_url":"https://api.github.com/users/sanjeebr/orgs","repos_url":"https://api.github.com/users/sanjeebr/repos","events_url":"https://api.github.com/users/sanjeebr/events{/privacy}","received_events_url":"https://api.github.com/users/sanjeebr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sanjeebr/Profile_App","description":"","fork":false,"url":"https://api.github.com/repos/sanjeebr/Profile_App","forks_url":"https://api.github.com/repos/sanjeebr/Profile_App/forks","keys_url":"https://api.github.com/repos/sanjeebr/Profile_App/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sanjeebr/Profile_App/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sanjeebr/Profile_App/teams","hooks_url":"https://api.github.com/repos/sanjeebr/Profile_App/hooks","issue_events_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues/events{/number}","events_url":"https://api.github.com/repos/sanjeebr/Profile_App/events","assignees_url":"https://api.github.com/repos/sanjeebr/Profile_App/assignees{/user}","branches_url":"https://api.github.com/repos/sanjeebr/Profile_App/branches{/branch}","tags_url":"https://api.github.com/repos/sanjeebr/Profile_App/tags","blobs_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/refs{/sha}","trees_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sanjeebr/Profile_App/statuses/{sha}","languages_url":"https://api.github.com/repos/sanjeebr/Profile_App/languages","stargazers_url":"https://api.github.com/repos/sanjeebr/Profile_App/stargazers","contributors_url":"https://api.github.com/repos/sanjeebr/Profile_App/contributors","subscribers_url":"https://api.github.com/repos/sanjeebr/Profile_App/subscribers","subscription_url":"https://api.github.com/repos/sanjeebr/Profile_App/subscription","commits_url":"https://api.github.com/repos/sanjeebr/Profile_App/commits{/sha}","git_commits_url":"https://api.github.com/repos/sanjeebr/Profile_App/git/commits{/sha}","comments_url":"https://api.github.com/repos/sanjeebr/Profile_App/comments{/number}","issue_comment_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues/comments{/number}","contents_url":"https://api.github.com/repos/sanjeebr/Profile_App/contents/{+path}","compare_url":"https://api.github.com/repos/sanjeebr/Profile_App/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sanjeebr/Profile_App/merges","archive_url":"https://api.github.com/repos/sanjeebr/Profile_App/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sanjeebr/Profile_App/downloads","issues_url":"https://api.github.com/repos/sanjeebr/Profile_App/issues{/number}","pulls_url":"https://api.github.com/repos/sanjeebr/Profile_App/pulls{/number}","milestones_url":"https://api.github.com/repos/sanjeebr/Profile_App/milestones{/number}","notifications_url":"https://api.github.com/repos/sanjeebr/Profile_App/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sanjeebr/Profile_App/labels{/name}","releases_url":"https://api.github.com/repos/sanjeebr/Profile_App/releases{/id}","deployments_url":"https://api.github.com/repos/sanjeebr/Profile_App/deployments","created_at":"2016-06-20T04:20:09Z","updated_at":"2016-06-20T04:30:15Z","pushed_at":"2016-07-01T14:19:18Z","git_url":"git://github.com/sanjeebr/Profile_App.git","ssh_url":"git@github.com:sanjeebr/Profile_App.git","clone_url":"https://github.com/sanjeebr/Profile_App.git","svn_url":"https://github.com/sanjeebr/Profile_App","homepage":null,"size":6064,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":3,"forks":0,"open_issues":3,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3"},"html":{"href":"https://github.com/sanjeebr/Profile_App/pull/3"},"issue":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/issues/3"},"comments":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/sanjeebr/Profile_App/statuses/500c9ac45abfd697ca4c64b8e093c6bbbf763d22"}}}}
{"actor":{"display_login":"satejkumar"}}