Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

ahjoyo / idc0007

  • This project
    • Loading...
  • Sign in
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
Switch branch/tag
  • icd007
  • views
  • view.html
Find file
BlameHistoryPermalink
  • mhasan's avatar
    logout added · 035630ed
    mhasan committed 6 years ago
    035630ed
view.html 5.38 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
<!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/view.js"></script>
    <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>

        <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 tasks is not null %}
    <h2 style="text-align: center; margin-top:80px"> View Tasks</h2>
    <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>

        <select name = "completion" id='selectComp' form='select'>
            <option value="todo"> To do </option>
            <option value="done"> Done</option>
            <option value="all">All</option> 
        </select>


        <input type="submit" name = "submit" id = "submit" value = "submit">
    </form>
    
    <table class="table table-dark table-hover" style="margin-left:auto; margin-right:auto;margin-top: 35px">
        <tr>

            <th class="table-info"> STATUS </th>
            <th class="table-info"> TASK ID </th>
            <th class="table-info"> DATE </th>
            <th class="table-info"> TIME</th>
            <th class="table-info"> TASKS</th>
            <th class="table-info"> </th>
            <th class="table-info"> EDIT Task </th>
            <th class="table-info"> DELETE Task </th>
        </tr>

        <form method="POST" action="./php/taskComplete.php" id='done'
            onsubmit="return confirm('Are you sure you want to mark task as Done?');"> </form>
        <form method="POST" action="edit.php" id='edit'> </form>
        <form method="POST" action="./php/delete.php" id='delete'
            onsubmit="return confirm('Do you really want to Delete the task?');"> </form>

        {% for task in tasks %}
        {% if 1 in task.task_completion %}
        <tr class="table-success">
            <td> DONE </td>
            <td>{{ task.taskID }}</td>
            <td>{{ task.t_date }}</td>
            <td>{{ task.t_time }}</td>
            <td>{{ task.task }}</td>
            <td> <input class="btn btn-warning" type='submit' form='done' value='done?' name={{task.taskID}}> </input></td>
            <td> <input class="btn btn-primary" 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>
        {% else %}
        <tr>
            <td> INCOMPLETE </td>
            <td>{{ task.taskID }}</td>
            <td>{{ task.t_date }}</td>
            <td>{{ task.t_time }}</td>
            <td>{{ task.task }}</td>
            <td> <input class="btn btn-warning" type='submit' form='done' value='done?' name={{task.taskID}}> </input></td>
            <td> <input class="btn btn-primary" 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>
        {% endif %}
        {% endfor %}

        <br> <br>
    

    </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"
        integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo"
        crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js"
        integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1"
        crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js"
        integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM"
        crossorigin="anonymous"></script>

</body>


</html>