Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
ahjoyo
/
idc0007
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
1cdc6994
authored
5 years ago
by
mhasan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LOGIN reqest at create task page
parent
423e76a3
master
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
83 additions
and
61 deletions
create.php
views/create.html
create.php
View file @
1cdc6994
<?php
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>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"register.php"
>
Register
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"create.php"
>
Create List
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"view.php"
>
View List
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"faq.php"
>
FAQ
</a>
</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>
This diff is collapsed.
Click to expand it.
views/create.html
0 → 100644
View file @
1cdc6994
<!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>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"register.php"
>
Register
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"create.php"
>
Create List
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"view.php"
>
View List
</a>
</li>
<li
class=
"nav-item"
>
<a
class=
"nav-link"
href=
"faq.php"
>
FAQ
</a>
</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
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment