Commit 1cdc6994 by mhasan

LOGIN reqest at create task page

parent 423e76a3
Showing with 83 additions and 61 deletions
<?php <?php
session_start(); session_start();
require 'Twig/lib/Twig/Autoloader.php';
// $amount = $_POST['amount'];
Twig_Autoloader::register();
// Load twig templating engine
$loader = new Twig_Loader_Filesystem('views');
$twig = new Twig_Environment($loader);
// Enable debugging so we can dump array
$twig = new \Twig\Environment($loader, ['debug' => true,]);
$twig->addExtension(new \Twig\Extension\DebugExtension());
if(isset($_SESSION['userName'])) {
echo $twig->render('create.html', array('login' => "true"));
}
else {
echo $twig->render('create.html');
}
?> ?>
<!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">
<script src="js/libraries/node_modules/moment/moment.js"> </script>
<script src="js/edit.js"> </script>
<title> Create List</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>
<ul style='text-align:end;' class="navbar-nav ml-auto">
<li class="nav-item">
<form method="GET" action="php/logout.php">
<input class='btn btn-info' type = 'submit' name =' logout' value = 'logout'>
</form>
</li>
</ul>
</nav>
<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> --> <!-- Datev alidation -->
<br><br><br>
<label class="form-control-label" > Time : </label>
<input type = "time" name ="time" required> <br> <br>
<label class="form-control-label"> Task (upto 300 characters) : </label>
<textarea rows = "6" cols= "40" name = "todo" maxlength="300" required></textarea> <br> <br>
<input class="btn btn-success" type="submit" name = "submit" value="submit" id='submit'> <br>
</form>
</div>
<br> <br>
</body>
</html>
<!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">
<script src="js/libraries/node_modules/moment/moment.js"> </script>
<script src="js/edit.js"> </script>
<title> Create List</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>
<ul style='text-align:end;' class="navbar-nav ml-auto">
<li class="nav-item">
<form method="GET" action="php/logout.php">
<input class='btn btn-info' type = 'submit' name =' logout' value = 'logout'>
</form>
</li>
</ul>
</nav>
{% if login is not null %}
<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> --> <!-- Datev alidation -->
<br><br><br>
<label class="form-control-label" > Time : </label>
<input type = "time" name ="time" required> <br> <br>
<label class="form-control-label"> Task (upto 300 characters) : </label>
<textarea rows = "6" cols= "40" name = "todo" maxlength="300" required></textarea> <br> <br>
<input class="btn btn-success" type="submit" name = "submit" value="submit" id='submit'> <br>
</form>
</div>
<br> <br>
{% else %}
<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