Commit 05a0834c by sopham

remove tomerge folder

parent 7f53639a
var i = 0;
//add new row to list after submitting
function addRow(){
if (document.getElementById('addTask').value!=''){
i++;
var title = document.getElementById('addTask').value;
var node = document.createElement('div');
node.setAttribute("id", "n" + i);
node.innerHTML = '<input id="option' + i + '" type="checkbox" class="hidden" name="checkbox"><label for="option' + i + '" class="check--label"><span class="check--label-box"></span><span class="check--label-text">'+ title +'</span>';
document.getElementById('doList').appendChild(node);
}
}
//clear input after submitting
function onFormSubmit(){
document.getElementById('addTask').value='';
}
//delete all tasks
function deleteAll() {
let x;
for (x = 1; x <= i; x++) {
let e = document.getElementById("n" + x);
e.parentNode.removeChild(e);
}
}
//delete completed tasks
function deleteComplete() {
var boxes = document.getElementsByClassName('hidden');
var texts = document.getElementsByClassName('check--label');
for(let i = 0; i<boxes.length; i++){
box = boxes[i];
txt = texts[i];
if(box.checked){
box.parentNode.removeChild(box);
txt.parentNode.removeChild(txt);
}
}
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Roboto+Slab" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="function.js" type="text/javascript"></script>
</head>
<body>
<div id="wrapper">
<div class="row">
<div class="side" id="side">
<div class="list-card">
<div class="avatar-upload">
<div class="avatar-edit">
<input type="file" accept="image/gif, image/jpeg, image/png" id="imageUpload" onchange="readURL(this);">
<label for="imageUpload"></label>
</div>
<div class="avatar-preview">
<div id="imagePreview" style="background-image: url(https://s3-us-west-2.amazonaws.com/s.cdpn.io/20625/avatar-bg.png);"></div>
</div>
</div>
</div>
<div class="task-card">
<div class="extra-content" id="extraContent">
<a href="javascript:window.print()"><i class="glyphicon glyphicon-print"></i> Print List</a>
<a onclick="deleteComplete();"><i class="fa fa-trash w3-large"></i> Completed Tasks</a>
<a onclick="deleteAll();"><i class="fa fa-trash w3-large"></i> Delete All</a>
</div><br>
<form action="index_php.php" method="POST" id="action">
<input type="submit" class="logout-button" name="logout"value="Logout">
</form>
</div>
</div>
<div class="main">
<div class="card">
<form action="" method="POST" id="addAction">
<input type="text" id="addTask" onkeypress="return event.keyCode != 13" name="add-task" placeholder="Add tasks..." autocomplete="off">
<input type="button" class="add-button" id="add" onclick="addRow(); onFormSubmit();" onkeypress="return searchKeyPress(event);" name="add-button" value="Add">
</form>
<form class="task-board card" class="list" id="form">
<div class="list-item" id="doList">
<div class="progress-container">
<div class="progress-bar" id="myBar"></div>
</div>
<input id="option" type="checkbox" name="checkbox" class="hidden">
<label for="option" class="check--label">
<span class="check--label-box"></span>
<span class="check--label-text">One</span>
</label>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
//enter to add to list
var input = document.getElementById("addTask");
input.addEventListener("keyup", function(event) {
if (event.keyCode === 13) {
event.preventDefault();
document.getElementById("add").click();
}
});
//scrolling
window.onscroll = function() {myFunction()};
function myFunction() {
var winScroll = document.body.scrollTop || document.documentElement.scrollTop;
var height = document.documentElement.scrollHeight - document.documentElement.clientHeight;
var scrolled = (winScroll / height) * 100;
document.getElementById("myBar").style.width = scrolled + "%";
}
</script>
</body>
</html>
<?php
if(isset($_POST['logout'])) {
session_destroy();
header('Location: login_page.php');
exit;
}
if(isset($_POST['add-button'])){
$addTask = $_POST['add-task'];
$file = fopen("taskList.txt","a+") or die("Unable to open file");
$s = $addTask."\r\n";
fputs($file,$s) or die("Unable to open save");
fclose($file);
header('Location: index.php');
}
?>
\ No newline at end of file
<?php
session_start();
error_reporting(0);
$user = $_POST['username'];
$pass = $_POST['password'];
if(isset($_POST['submit'])){
if($user=="admin" && $pass==admin){
header('Location:index.php');
}
else{
echo "Wrong Username or/and Password";
}
}
?>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" href="login_style.css">
</head>
<body>
<div id="wrapper">
<div class="row">
<div class="column">
<div class="card">
<form name="input" action="login_check.php" method="POST">
<label for="username">Username</label>
<input type="text" id="username" name="username" pattern="[a-zA-Z][a-zA-Z0-9-_\.]{1,20}" required><br>
<label for="password">Password</label>
<input type="password" id="password" name="password" autocomplete="off" required><br>
<input type="submit" name="submit" value="Login">
</form>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
@charset "UTF-8";
#wrapper{
max-width: 1350px;
min-width: 1350px;
}
.card {
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2);
padding: 50px 50px 70px 50px;
text-align: center;
background-color: #9370DB;
border-radius: 6px;
width: 350px;
margin: auto;
margin-top: 15%;
color: white;
font-size: 25px;
font-family: 'Roboto Slab', serif;
}
input[type=text], [type=password] {
position: inherit;
padding: 10px 0px 10px 10px;
margin: 8px;
display: inline-block;
border: 1px solid #ccc;
border-radius: 6px;
box-sizing: border-box;
color: black;
font-size: 20px;
font-family: 'Roboto Slab', serif;
vertical-align: middle;
width: 50%;
}
input[type=submit] {
font-family: 'Roboto Slab', serif;
font-size: 15px;
font-weight: bold;
background-color: white;
color: black;
padding: 10px 20px;
margin: 7px 35px 0px 0px;
border-radius: 6px;
border: 1px solid #ccc;
cursor: pointer;
float: right;
letter-spacing: 1px;
}
input[type=submit]:hover {
background-color: rgb(182, 171, 189);
color: white;
border-radius: 6px;
}
\ No newline at end of file
@charset "UTF-8";
* {
box-sizing: border-box;
font-family: 'Roboto Slab', serif;
font-size: 20px;
}
@media print{
#form {
overflow-y:hidden;
}
#side {
display: none; }
#action{
display: none;
}
#addAction{
display: none;
}
#buttonExtra{
display: none;
}
#extraContent{
display: none;
}
#dropContent{
display: none;
}
#doList {
display: block;
position: absolute;
top: 10px;
left: 20px;
}
}
@media screen and (max-width: 600px) {
body {float: none;}
}
.row {
margin: 0 -5px;
display: flex;
}
.card {
width: 1005px;
height: 100%;
min-height: 940px;
box-shadow: 0 4px 8px 0 rgba(0,0,0, 0.2);
padding: 30px;
text-align: center;
background-color: #f1f1f1;
margin: 10px 10px 10px 10px;
}
.list-card {
height: 20%;
box-shadow: 0 4px 8px 0 rgba(0,0,0, 0.2);
padding: 12px;
text-align: center;
font-family: 'Roboto Slab', serif;
background-color: #f1f1f1;
text-align: center;
margin: 10px 10px 10px 10px;
}
.task-card {
cursor: pointer;
height: 80%;
box-shadow: 0 4px 8px 0 rgba(0,0,0, 0.2);
padding: 30px;
margin: 10px 10px 10px 10px;
text-align: center;
background-color: #f1f1f1;
}
.side {
padding: 0px 5px 0px 30px;
}
.extra-content {
font-family: 'Roboto Slab', serif;
width: 100%;
border-radius: 6px;
}
.extra-content a {
color: black;
padding: 15px 16px;
display: block;
border-radius: 6px;
}
.extra-content a:hover {
color: white;
background-color:#b198e6b9;
}
.logout-button {
background-color: #9370DB;
font-family: 'Roboto Slab', serif;
width: 100%;
padding: 10px;
border-radius: 6px;
border: none;
transition: all 0.5s;
cursor: pointer;
display: inline-block;
color: white;
}
.logout-button:hover{
background: red;
}
input[type=text] {
width: 70%;
box-sizing: border-box;
border: 2px solid #9370DB;
border-radius: 6px;
background-color: white;
padding: 12px 0 12px 40px;
float:left;
margin-left: 90px;
margin-top: 60px;
}
.add-button {
background-color:rgb(83, 68, 170);
font-family: 'Roboto Slab', serif;
width: 10%;
color: white;
padding: 14px;
border-radius: 6px;
border: none;
transition: all 0.5s;
cursor: pointer;
float: left;
margin-top: 60px;
margin-left: 5px;
}
.add-button:hover{
background-color: #9370DB;
color: white;
}
.task-board {
border: 6px;
margin-top: 160px;
margin-left: 90px;
height: 80%;
width: 80%;
background-color: white;
border-radius: 15px;
overflow-y: scroll;
min-width: 200px;
height: 200px;
}
.checkmark {
position: absolute;
top: 9px;
left: 15px;
height: 25px;
width: 25px;
border-radius: 50%;
background-color: #eee;
}
.hidden {
position: absolute;
appearance: none;
}
.list {
display: flex;
}
.check--label {
display: flex;
justify-content: flex-start;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-top: 15px;
height: 40px;
}
.check--label-box {
display: flex;
align-self: center;
position: relative;
height: 25px;
width: 25px;
margin: 0 20px;
border: 2px solid rgb(83, 68, 170);
cursor: pointer;
border-radius: 50%;
}
.check--label-text {
position: relative;
display: flex;
cursor: pointer;
align-self: center;
padding: 20px;
font-size: 22px;
border-left: 1px solid #ecf0f1;
}
.check--label-text:after {
content: '';
display: block;
width: 0%;
height: 2px;
background-color: #000;
position: absolute;
top: 50%;
left: 7.5%;
transform: translateY(-50%);
transition: width 100ms ease-in-out;
}
.hidden:checked + .check--label {
background-color: #fff;
}
.hidden:checked + .check--label .check--label-box {
background-color: rgb(83, 68, 170);
}
.hidden:checked + .check--label .check--label-box:after {
content: '';
display: block;
position: absolute;
top: 3px;
left: 7px;
width: 7px;
height: 12px;
border: solid white;
border-width: 0 3px 3px 0;
transform: rotate(45deg);
}
.hidden:checked + .check--label .check--label-text:after {
width: 85%;
}
.avatar-upload {
position: relative;
max-width: 205px;
margin: 50px auto;
}
.avatar-edit {
position: absolute;
right: 12px;
z-index: 1;
top: -20px;
}
.avatar-upload .avatar-edit input {
display: none;
}
.avatar-upload input + label {
display: inline-block;
width: 34px;
height: 34px;
margin-bottom: 0;
border-radius: 100%;
background: #FFFFFF;
border: 1px solid transparent;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.12);
cursor: pointer;
font-weight: normal;
transition: all .2s ease-in-out;
}
.avatar-upload input + label:hover {
background: #f1f1f1;
border-color: #d6d6d6;
}
.avatar-upload input + label:after {
content: "\f040";
font-family: 'FontAwesome';
color: #757575;
position: absolute;
top: 2px;
left: 0px;
right: 0px;
text-align: center;
margin: auto;
}
.avatar-preview {
width: 190px;
height: 190px;
position: relative;
top: -35px;
border-radius: 100%;
border: 6px solid #F8F8F8;
box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.1);
}
.avatar-preview > div {
width: 100%;
height: 100%;
border-radius: 50%;
background-size: cover;
background-repeat: no-repeat;
background-position: center;
}
.progress-container {
position: relative;
width: 100%;
height: 8px;
background: #ccc;
}
#myBar {
position: absolute;
height: 8px;
background: red;
width: 0%;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment