Commit 062b200e by mhasan

changes to index and view pages

parent 3ce091aa
...@@ -5,7 +5,7 @@ session_start(); ...@@ -5,7 +5,7 @@ session_start();
<!DOCTYPE html> <!DOCTYPE html>
<html lang="en-US"> <html lang="en-US">
<head> <head>
<link rel="stylesheet" href= "css/create_style.css"> <link rel="stylesheet" href= "css/bootstrap.css">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="description" content="ICD0007 Project, Todo List"> <meta name="description" content="ICD0007 Project, Todo List">
<script src="js/libraries/node_modules/moment/moment.js"> </script> <script src="js/libraries/node_modules/moment/moment.js"> </script>
...@@ -13,27 +13,44 @@ session_start(); ...@@ -13,27 +13,44 @@ session_start();
<title> Create List</title> <title> Create List</title>
</head> </head>
<body> <body style='background-image:url("img/back.jpg"); background-repeat: no-repeat;'>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary" id="navbarColor01">
<nav class="nav"> <ul class="navbar-nav mr-auto">
<a href="index.php"> Index </a> &nbsp; &nbsp; <li class="nav-item">
<a href="register.php"> Register </a>&nbsp; &nbsp; <a class="nav-link" href="index.php"> Index </a> &nbsp; &nbsp;
<a href="create.php"> Create List </a>&nbsp; &nbsp; </li>
<a href="view.php"> View List</a>&nbsp; &nbsp; <li class="nav-item">
<a href="faq.php"> FAQ </a>&nbsp; &nbsp; <a class="nav-link" href="register.php"> Register </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="create.php"> Create List </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="view.php"> View List</a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="faq.php"> FAQ </a>&nbsp; &nbsp;
</li>
</ul>
</nav> </nav>
<h2> Create List</h2> <h2 style="text-align: center; margin-top:80px"> Create List</h2>
<div class='form'>
<form class = 'form-group' style='text-align:center' action = "./php/createTask.php" method="POST" onsubmit="return dateValid()">
<label class="form-control-label"> Date : </label>
<input type="text" name="date" id = 'date' onchange='dateValid();' required> <!-- <span id = 'dateText'> </span> -->
<form action = "./php/createTask.php" method="POST"> <br><br><br>
Date : <input type="text" name="date" id = 'date' onchange='dateValid();' required> <span id = 'dateText'> </span> <br> <br> <label class="form-control-label" > Time : </label>
Time : <input type = "time" name ="time" required> <br> <br> <input type = "time" name ="time" required> <br> <br>
Task (upto 300 characters) : <textarea rows = "6" cols= "40" name = "todo" maxlength="300" required></textarea> <br> <br>
<input type="submit" name = "submit" value="submit" id='submit' disabled> <br> <label class="form-control-label"> Task (upto 300 characters) : </label>
</form> <textarea rows = "6" cols= "40" name = "todo" maxlength="300" required></textarea> <br> <br>
<input class="btn btn-outline-success" type="submit" name = "submit" value="submit" id='submit'> <br>
</form>
</div>
</body> </body>
</html> </html>
......
...@@ -7,7 +7,7 @@ require "php/db_conn.php"; ...@@ -7,7 +7,7 @@ require "php/db_conn.php";
<html lang="en-US"> <html lang="en-US">
<head> <head>
<link rel="stylesheet" href="css/create_style.css"> <link rel="stylesheet" href= "css/bootstrap.css">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="description" content="ICD0007 Project, Todo List"> <meta name="description" content="ICD0007 Project, Todo List">
<title> Edit Tasks</title> <title> Edit Tasks</title>
...@@ -15,19 +15,49 @@ require "php/db_conn.php"; ...@@ -15,19 +15,49 @@ require "php/db_conn.php";
<script src="js/edit.js"> </script> <script src="js/edit.js"> </script>
</head> </head>
<body> <body style='background-image:url("img/back.jpg"); background-repeat: no-repeat;'>
<?php require "php/getData.php" ?> <?php require "php/getData.php" ?>
<form method="POST" onsubmit="return (dateValid() && timeValid());" action="php/updateData.php"> <nav class="navbar navbar-expand-lg navbar-dark bg-primary" id="navbarColor01">
Date: <textarea name="date" rows="1" cols="10" id="date" onfocusout="dateValid()"><?php echo($row['t_date']); ?></textarea><br> <br> <ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.php"> Index </a> &nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="register.php"> Register </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="create.php"> Create List </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="view.php"> View List</a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="faq.php"> FAQ </a>&nbsp; &nbsp;
</li>
</ul>
</nav>
<h2 style="text-align: center; margin-top:80px; margin-bottom:30px;"> Edit Task </h2>
<form class = 'form-group' style='text-align:center' method="POST" onsubmit="return (dateValid() && timeValid());" action="php/updateData.php">
<label class="form-control-label"> Date : </label>
<textarea name="date" rows="1" cols="10" id="date" onfocusout="dateValid()"><?php echo($row['t_date']); ?></textarea><br> <br>
<span id = "dateText"> </span> <span id = "dateText"> </span>
Time: <textarea name='time' rows="1" cols="10" id="time" onfocusout="timeValid()"><?php echo ($row['t_time']);?></textarea> <br> <br>
Task: <textarea rows="6" cols="40" name="todo" maxlength="300"><?php echo($row['task']);?></textarea> <br> <br> <label class="form-control-label" > Time : </label>
Task status: <select name='task_completion'> <textarea name='time' rows="1" cols="10" id="time" onfocusout="timeValid()"><?php echo ($row['t_time']);?></textarea> <br> <br>
<label class="form-control-label"> Task (upto 300 characters) : </label>
<textarea rows="6" cols="40" name="todo" maxlength="300"><?php echo($row['task']);?></textarea> <br> <br>
<label class="form-control-label"> Task status: </label>
<select name='task_completion'>
<option value="0"> Incomplete </option> <option value="0"> Incomplete </option>
<option value="1"> Complete </option> <option value="1"> Complete </option>
</select> </select>
<input type='submit' id='submit' name='save' value='save' disabled> <br> <br>
<input class="btn btn-success" type='submit' id='submit' name='save' value='save'>
</form> </form>
......
<!DOCTYPE html> <?php
<html lang="en"> require 'Twig/lib/Twig/Autoloader.php';
<head> Twig_Autoloader::register();
<link rel="stylesheet" href="css/index_style.css"> // Load twig templating engine
<meta charset="utf-8"> $loader = new Twig_Loader_Filesystem('views');
<title>Personal Assistence</title> $twig = new Twig_Environment($loader);
</head>
// Enable debugging so we can dump array
<body> $twig = new \Twig\Environment($loader, [
'debug' => true,
<nav class="nav"> ]);
<a href="index.php"> Index </a> &nbsp; &nbsp; $twig->addExtension(new \Twig\Extension\DebugExtension());
<a href="register.php"> Register </a>&nbsp; &nbsp;
<a href="create.php"> Create List </a>&nbsp; &nbsp; if (isset($_POST['submit'])) {
<a href="view.php"> View List</a>&nbsp; &nbsp; try {
<a href="delete.php"> DELETE Tasks </a>&nbsp; &nbsp; require "php/db_conn.php";
<a href="faq.php"> FAQ </a>&nbsp; &nbsp; $e = null;
</nav>
<h2> WELCOME TO YOUR VERY OWN PERSONAL ASSISTENT</h2> $querry = sprintf("SELECT passHash FROM login WHERE userName = '%s' ;", $_POST['userName']);
<p> In modern lifestyle we have to do lot of things, be at different places and communicate with lot of people. $pdo_st = $pdo->query($querry);
It gets complicated to manage all this. You have to plan your day, week even a month at a time. $pdo_st->setFetchMode(PDO::FETCH_ASSOC);
<br><b> So join us , manage your day with ease.</b></p>
$array = $pdo_st->fetch();
<form method="POST" action = "php/index.php"> $isMatch = password_verify($_POST['pass'], $array['passHash']);
<label id="user"> Username:</label>
if ($isMatch == true) {
<input type="text" name="userName" id="user"> session_start();
<br><br> $_SESSION['userName'] = $_POST['userName'];
<label id="pass"> Password: </label> header("location: view.php"); //redirects user to view page upon successful login!
<input type="password" name="pass" id="pass"> }
<br><br> else {
<input type="submit" name="submit" value="submit"> echo $twig -> render('index.html',array('login' => 'false' ) );
</form> }
} catch (PDOException $e) {
echo ($e->getMessage() . " " . $e->getLine());
</body> }
}
</html> else {
\ No newline at end of file echo $twig -> render('index.html');
}
\ No newline at end of file
...@@ -3,13 +3,13 @@ function dateValid() { ...@@ -3,13 +3,13 @@ function dateValid() {
// var matchVal = "^\d{ 4}\-(0 ? [1 - 9] | 1[012]) \-(0 ? [1 - 9] | [12][0 - 9] | 3[01])"; // var matchVal = "^\d{ 4}\-(0 ? [1 - 9] | 1[012]) \-(0 ? [1 - 9] | [12][0 - 9] | 3[01])";
if (moment(inputDate, ["YYYY-MM-DD", "YYYY-M-D"], true).isValid()) { if (moment(inputDate, ["YYYY-MM-DD", "YYYY-M-D"], true).isValid()) {
document.getElementById("dateText").innerText = "valid date"; document.getElementById("dateText").innerHTML = "valid date";
document.getElementById("submit").disabled = false; // document.getElementById("submit").disabled = false;
return true; return true;
} }
else { else {
alert("invalid date"); alert("invalid date");
document.getElementById("submit").disabled = true; // document.getElementById("submit").disabled = true;
return false; return false;
} }
} }
...@@ -20,12 +20,12 @@ function timeValid() { ...@@ -20,12 +20,12 @@ function timeValid() {
if (moment(inputTime, ["HH:mm", "h:mm a","HH:mm:ss","h:mm:ss a"],true).isValid()) { if (moment(inputTime, ["HH:mm", "h:mm a","HH:mm:ss","h:mm:ss a"],true).isValid()) {
document.getElementById("dateText").innerHTML = "Valid"; document.getElementById("dateText").innerHTML = "Valid";
document.getElementById("submit").disabled = false; // document.getElementById("submit").disabled = false;
return true; return true;
} }
else { else {
alert("invalid time"); alert("invalid time");
document.getElementById("submit").disabled = true; // document.getElementById("submit").disabled = true;
return false; return false;
} }
......
function dateValid() {
var inputDate = document.getElementById("dateInput").value.trim();
// var matchVal = "^\d{ 4}\-(0 ? [1 - 9] | 1[012]) \-(0 ? [1 - 9] | [12][0 - 9] | 3[01])";
if (moment(inputDate, ["YYYY-MM-DD", "YYYY-M-D"], true).isValid()) {
document.getElementById("submit").disabled = false;
return true;
}
else {
// alert("invalid date");
document.getElementById("submit").disabled = true;
return false;
}
}
function enableInput(selectVal) {
let selectElement = document.getElementById("selectElement");
if (selectElement.value == "custom") {
document.getElementById("dateInput").disabled = false;
console.log("disabled");
}
}
\ No newline at end of file
...@@ -15,7 +15,10 @@ if (isset($_POST['submit'])) { ...@@ -15,7 +15,10 @@ if (isset($_POST['submit'])) {
if ($isMatch == true) { if ($isMatch == true) {
session_start(); session_start();
$_SESSION['userName'] = $_POST['userName']; $_SESSION['userName'] = $_POST['userName'];
header("location: ../view.php"); //redirects user to a certain page upon successful login! header("location: ../view.php"); //redirects user to view page upon successful login!
}
else {
header("location: ../index.php"); //redirects to the index page upon login failure.
} }
} catch (PDOException $e) { } catch (PDOException $e) {
echo ($e->getMessage() . " " . $e->getLine()); echo ($e->getMessage() . " " . $e->getLine());
......
<?php <?php
require "db_conn.php"; require "db_conn.php";
session_start(); session_start();
$taskArray = array();
// $amount = $_POST['amount'];
class Task class Task
{ {
public $taskID; public $taskID;
...@@ -20,20 +21,60 @@ class Task ...@@ -20,20 +21,60 @@ class Task
$this->task_completion = $task_completion; $this->task_completion = $task_completion;
} }
} }
$taskArray = array();
if (isset($_SESSION['userName'])) {
$date = date('Y-m-d');
try {
$querry = sprintf("SELECT * FROM %s WHERE t_date >= '%s' ;", $_SESSION['userName'], $date);
function all($pdo, &$taskArr) {
// $date = date('Y-m-d');
$querry = sprintf("SELECT * FROM %s ORDER BY t_date ASC;", $_SESSION['userName']);
$pdo_st = $pdo->query($querry); $pdo_st = $pdo->query($querry);
$pdo_st->setFetchMode(PDO::FETCH_ASSOC); $pdo_st->setFetchMode(PDO::FETCH_ASSOC);
} catch (PDOException $p) { while ($row = $pdo_st->fetch()) // Takes 1 row of the data table, stores into an assoc array called row, elements of each row can be called by column name.
echo ($p->getMessage() . " " . $p->getLine()); {
// $taskArr[] = new Task($row['taskID'], $row['t_date'], $row['t_time'], $row['task'], $row['task_completion']); //creates on object called task, pushes it into the Array
array_push($taskArr, new Task($row['taskID'], $row['t_date'], $row['t_time'], $row['task'], $row['task_completion']) );
} }
} }
while ($row = $pdo_st->fetch()) // Takes 1 row of the data table, stores into an assoc array called row, elements of each row can be called by column name. function today($pdo, &$taskArr) {
$date = date('Y-m-d');
$querry = sprintf("SELECT * FROM %s WHERE t_date >= '%s' ORDER BY t_date ASC;", $_SESSION['userName'],$date);
$pdo_st = $pdo->query($querry);
$pdo_st->setFetchMode(PDO::FETCH_ASSOC);
while ($row = $pdo_st->fetch()) // Takes 1 row of the data table, stores into an assoc array called row, elements of each row can be called by column name.
{
// $taskArr[] = new Task($row['taskID'], $row['t_date'], $row['t_time'], $row['task'], $row['task_completion']); //creates on object called task, pushes it into the Array
array_push($taskArr, new Task($row['taskID'], $row['t_date'], $row['t_time'], $row['task'], $row['task_completion']) );
}
}
function custom($pdo, &$taskArr, $inputDate) {
$querry = sprintf("SELECT * FROM %s WHERE t_date >= '%s' ORDER BY t_date ASC;", $_SESSION['userName'],$inputDate);
$pdo_st = $pdo->query($querry);
$pdo_st->setFetchMode(PDO::FETCH_ASSOC);
while ($row = $pdo_st->fetch()) // Takes 1 row of the data table, stores into an assoc array called row, elements of each row can be called by column name.
{ {
$taskArray[] = new Task($row['taskID'], $row['t_date'], $row['t_time'], $row['task'], $row['task_completion']); //creates on object called task, pushes it into the Array // $taskArr[] = new Task($row['taskID'], $row['t_date'], $row['t_time'], $row['task'], $row['task_completion']); //creates on object called task, pushes it into the Array
array_push($taskArr, new Task($row['taskID'], $row['t_date'], $row['t_time'], $row['task'], $row['task_completion']) );
} }
}
if ($amount == 'all') {
try {
all($pdo,$taskArray);
} catch (PDOException $p) {
echo ($p->getMessage() . " " . $p->getLine());
}
} elseif ($amount == 'today'){
try {
today($pdo,$taskArray);
} catch (PDOException $p) {
echo ($p->getMessage() . " " . $p->getLine());
}
} elseif( $amount == 'custom') {
try {
custom($pdo,$taskArray,$custom);
} catch (PDOException $p) {
echo ($p->getMessage() . " " . $p->getLine());
}
}
...@@ -3,35 +3,56 @@ ...@@ -3,35 +3,56 @@
<html lang="en-US"> <html lang="en-US">
<head> <head>
<link rel="stylesheet" href="css/register_css.css"> <link rel="stylesheet" href="css/bootstrap.css">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="description" content="ICD0007 Project, Todo List"> <meta name="description" content="ICD0007 Project, Todo List">
<title> Registration</title> <title> Registration</title>
<script src="./js/register.js"> </script> <script src="./js/register.js"> </script>
</head> </head>
<body> <body style='background-image:url("img/back.jpg"); background-repeat: no-repeat;'>
<nav class="nav"> <nav class="navbar navbar-expand-lg navbar-dark bg-primary" id="navbarColor01">
<a href="index.php"> Index </a> &nbsp; &nbsp; <ul class="navbar-nav mr-auto">
<a href="register.php"> Register </a>&nbsp; &nbsp; <li class="nav-item">
<a href="create.php"> Create List </a>&nbsp; &nbsp; <a class="nav-link" href="index.php"> Index </a> &nbsp; &nbsp;
<a href="view.php"> View List</a>&nbsp; &nbsp; </li>
<a href="delete.php"> DELETE Tasks </a>&nbsp; &nbsp; <li class="nav-item">
<a href="faq.php"> FAQ </a>&nbsp; &nbsp; <a class="nav-link" href="register.php"> Register </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="create.php"> Create List </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="view.php"> View List</a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="faq.php"> FAQ </a>&nbsp; &nbsp;
</li>
</ul>
</nav> </nav>
<h2> Registration</h2> <h2 style="text-align: center; margin-top:80px"> Registration</h2>
<form action="./php/register.php" method="post"> <!--On submit call the matchPass function from the passwordMatch script --> <div class='form'>
User Name &emsp;: <input type="text" name="userName" id = "userName" onkeyup= "searchUser()"> &nbsp;&nbsp;&nbsp; <span id="suggest"> </span> <br> <form class = 'form-group' style='text-align:center; margin-top: 35px' action="./php/register.php" method="post"> <!--On every key press call the matchPass function from the passwordMatch script -->
Email &emsp;&emsp; &nbsp;&nbsp;&nbsp; : <input type="email" name="email" required> <br>
Password &emsp; &nbsp;&nbsp;: <input type="password" name="pass1" id="pass1" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match1"> </span> <br> <label class="form-control-label"> User Name :</label> <span id="suggest"> </span>
Confirm Password : <input type="password" name="pass2" id="pass2" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match2"> </span> <br> <input type="text" name="userName" id = "userName" onkeyup= "searchUser()"> &nbsp;&nbsp;&nbsp; <br>
<span id="match"> </span>
<input type="submit" name="submit" value="submit" id = "submit" disabled> <label class="form-control-label"> Email :</label>
</form> <input type="email" name="email" required> <br>
<label class="form-control-label"> Password :</label>
<input type="password" name="pass1" id="pass1" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match1"> </span> <br>
<label class="form-control-label"> Confirm Password :</label>
<input type="password" name="pass2" id="pass2" onkeyup="matchPass()" required> &nbsp;&nbsp;<span id="match2"> </span> <br>
<br><br><span id="match"> </span>
<br> <input class="btn btn-success" type="submit" name="submit" value="submit" id = "submit" disabled>
</form>
</div>
</body> </body>
......
<?php <?php
require 'Twig/lib/Twig/Autoloader.php';
require "php/serveData.php";
session_start(); session_start();
require 'Twig/lib/Twig/Autoloader.php';
// $amount = $_POST['amount'];
Twig_Autoloader::register(); Twig_Autoloader::register();
// Load twig templating engine // Load twig templating engine
$loader = new Twig_Loader_Filesystem('views'); $loader = new Twig_Loader_Filesystem('views');
...@@ -12,10 +11,18 @@ $twig = new Twig_Environment($loader); ...@@ -12,10 +11,18 @@ $twig = new Twig_Environment($loader);
// Enable debugging so we can dump array // Enable debugging so we can dump array
$twig = new \Twig\Environment($loader, [ $twig = new \Twig\Environment($loader, [
'debug' => true, 'debug' => true,
]); ]);
$twig->addExtension(new \Twig\Extension\DebugExtension()); $twig->addExtension(new \Twig\Extension\DebugExtension());
if(isset($_SESSION['userName'])) {
echo $twig->render('view.html', array( $amount = $_POST['amount'];
$custom = $_POST['custom'];
require "php/serveData.php";
echo $twig->render('view.html', array(
'tasks' => $taskArray, 'tasks' => $taskArray,
)); ));
}
else {
echo $twig -> render('view.html',array('tasks' => null));
}
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="css/bootstrap.css">
<meta charset="utf-8">
<title>Personal Assistence</title>
</head>
<body style='background-image:url("img/back.jpg"); background-repeat: no-repeat;'>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary" id="navbarColor01">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.php"> Index </a> &nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="register.php"> Register </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="create.php"> Create List </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="view.php"> View List</a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="faq.php"> FAQ </a>&nbsp; &nbsp;
</li>
</ul>
</nav>
<h2 style="text-align: center; margin-top:80px"> WELCOME TO YOUR VERY OWN PERSONAL ASSISTENT</h2>
<p style="text-align: center;"> In modern lifestyle we have to do lot of things, be at different places and communicate with lot of people.
It gets complicated to manage all this. You have to plan your day, week even a month at a time.
<br><b> So join us , manage your day with ease.</b></p>
<form method="POST" action = "index.php">
<label id="user"> Username:</label>
<input type="text" name="userName" id="user">
<br><br>
<label id="pass"> Password: </label>
<input type="password" name="pass" id="pass">
<br><br>
<input class='btn btn-success'type="submit" name="submit" value="submit">
</form>
<br> <br>
{% if login is not null %}
<h3 style="text-align:center;"> Incorrect username and password, please try again!</h3>
{% endif %}
</body>
</html>
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
<link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/bootstrap.css">
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="description" content="ICD0007 Project, Todo List"> <meta name="description" content="ICD0007 Project, Todo List">
<script src="js/libraries/node_modules/moment/moment.js"> </script>
<script src="js/view.js"></script>
<title> View Tasks</title> <title> View Tasks</title>
</head> </head>
<body> <body style='background-image:url("img/back.jpg"); background-repeat: no-repeat;'>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary" id="navbarColor01"> <nav class="navbar navbar-expand-lg navbar-dark bg-primary" id="navbarColor01">
<ul class="navbar-nav mr-auto"> <ul class="navbar-nav mr-auto">
<li class="nav-item"> <li class="nav-item">
...@@ -29,9 +31,22 @@ ...@@ -29,9 +31,22 @@
</ul> </ul>
</nav> </nav>
<h2> View Tasks for today</h2> {% if tasks is not null %}
<h2 style="text-align: center; margin-top:80px"> View Tasks for today</h2>
<table class="table table-success table-hover"> <form method='POST' action="view.php" id = "select">
<select name = "amount" id = "selectElement" form = "select" onchange="enableInput(this.options[this.selectedIndex].value);">
<option value = "today"> Today</option>
<option value = "all"> All</option>
<option value = "custom"> I will enter date</option>
</select>
<br> <br>
<input type="text" name = "custom" id="dateInput" onkeyup="dateValid();" disabled>
<br> <br>
<input type="submit" name = "submit" id = "submit" value = "submit">
</form>
<table class="table table-success table-hover" style="margin-left:auto; margin-right:auto;margin-top: 35px">
<tr> <tr>
<th class="table-info"> STATUS </th> <th class="table-info"> STATUS </th>
...@@ -58,9 +73,10 @@ ...@@ -58,9 +73,10 @@
<td>{{ task.t_date }}</td> <td>{{ task.t_date }}</td>
<td>{{ task.t_time }}</td> <td>{{ task.t_time }}</td>
<td>{{ task.task }}</td> <td>{{ task.task }}</td>
<td> <input type='submit' form='done' value='done?' name={{task.taskID}} > </input> </td> <td> <input class="btn btn-warning" type='submit' form='done' value='done?' name={{task.taskID}}> </input>
<td> <input type='submit' form='edit' value='edit' name={{task.taskID}}> </td> </td>
<td> <input type='submit' form='delete' value='delete' name={{task.taskID}}> </td> <td> <input class="btn btn-secondary" type='submit' form='edit' value='edit' name={{task.taskID}}> </td>
<td> <input class="btn btn-danger" type='submit' form='delete' value='delete' name={{task.taskID}}> </td>
</tr> </tr>
{% else %} {% else %}
<tr> <tr>
...@@ -69,9 +85,10 @@ ...@@ -69,9 +85,10 @@
<td>{{ task.t_date }}</td> <td>{{ task.t_date }}</td>
<td>{{ task.t_time }}</td> <td>{{ task.t_time }}</td>
<td>{{ task.task }}</td> <td>{{ task.task }}</td>
<td> <input type='submit' form='done' value='done?' name={{task.taskID}} > </input> </td> <td> <input class="btn btn-warning" type='submit' form='done' value='done?' name={{task.taskID}}> </input>
<td> <input type='submit' form='edit' value='edit' name={{task.taskID}}> </td> </td>
<td> <input type='submit' form='delete' value='delete' name={{task.taskID}}> </td> <td> <input class="btn btn-secondary" type='submit' form='edit' value='edit' name={{task.taskID}}> </td>
<td> <input class="btn btn-danger" type='submit' form='delete' value='delete' name={{task.taskID}}> </td>
</tr> </tr>
{% endif %} {% endif %}
{% endfor %} {% endfor %}
...@@ -79,7 +96,9 @@ ...@@ -79,7 +96,9 @@
</table> </table>
{% else %}
<h2 style="text-align: center; margin-top:80px"> Please log in </h2>
{% endif %}
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"
......
<!DOCTYPE html>
<html lang="en-US">
<head>
<link rel="stylesheet" href="css/bootstrap.css">
<meta charset="UTF-8">
<meta name="description" content="ICD0007 Project, Todo List">
<title> View Tasks</title>
</head>
<body style='background-image:url("img/back.jpg"); background-repeat: no-repeat;'>
<nav class="navbar navbar-expand-lg navbar-dark bg-primary" id="navbarColor01">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="index.php"> Index </a> &nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="register.php"> Register </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="create.php"> Create List </a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="view.php"> View List</a>&nbsp; &nbsp;
</li>
<li class="nav-item">
<a class="nav-link" href="faq.php"> FAQ </a>&nbsp; &nbsp;
</li>
</ul>
</nav>
{% if tasks is null %}
<h2 style="text-align: center; margin-top:80px"> Please log in </h2>
{% endif %}
</body>
</html>
\ 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