Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
- <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
- <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
- <script src="https://code.jquery.com/jquery-2.2.3.js"></script>
- <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.4/themes/smoothness/jquery-ui.css">
- <script src="http://code.jquery.com/jquery-1.9.1.js"></script>
- <script src="http://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
- <link rel="stylesheet" href="/resources/demos/style.css">
- <style>
- body { font-size: 62.5%; }
- label, input { display:block; }
- input.text { margin-bottom:12px; width:95%; padding: .4em; }
- fieldset { padding:0; border:0; margin-top:25px; }
- h1 { font-size: 1.2em; margin: .6em 0; }
- div#users-contain { width: 350px; margin: 20px 0; }
- div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
- div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
- .ui-dialog .ui-state-error { padding: .3em; }
- .validateTips { border: 1px solid transparent; padding: 0.3em; }
- .dropdown{
- position: relative;
- display: inline-block;
- }
- <style>
- fieldset {
- border: 0;
- }
- label {
- display: block;
- margin: 30px 0 0 0;
- }
- select {
- width: 200px;
- }
- .overflow {
- height: 200px;
- }
- </style>
- <script>
- var all_tasks_counter =0 ;
- var in_progress_counter =0;
- var completed_counter =0;
- var arch_counter =0;
- function newtask(id,name,date,description,status)
- {
- this.id = id ;
- this.name=name;
- this.date =date;
- this.description = description ;
- this.status = status;
- }
- var all=[];
- var arch=[];
- var completed=[];
- var progress=[];
- function show(){
- document.getElementById("dialog").style.display = 'block'}
- function hide(){
- document.getElementById("dialog").style.display = 'none'}
- function add()
- {
- var trry=document.getElementById('task').value;
- var trry1=document.getElementById('datepicker').value;
- var trry2=document.getElementById('description').value;
- var status = progress ;
- var task = new newtask(all_tasks_counter+1,trry,trry1,trry2,status);
- all_tasks_counter ++;
- in_progress_counter++ ;
- all.push(task);
- progress.push(task);
- hide();
- drawall();
- }
- var i;
- function CtoP (i)
- {
- progress.push(completed[i]);
- in_progress_counter ++ ;
- var count ;completed_counter -- ;
- for (count = i ; count < completed_counter ; count++)
- {
- completed[count].date=completed[count+1].date ;
- completed[count].description=completed[count+1].description ;
- completed[count].name=completed[count+1].name ;
- completed[count].status=completed[count+1].status ;
- }
- drawcompleted();
- }
- function CtoA (i)
- {
- arch.push(completed[i]);
- arch_counter ++ ;
- var count ;completed_counter-- ;
- for (count = i ; count < completed_counter ; count++)
- {
- completed[count].date=completed[count+1].date ;
- completed[count].description=completed[count+1].description ;
- completed[count].name=completed[count+1].name ;
- completed[count].status=completed[count+1].status ;
- }
- drawcompleted();
- }
- function PtoC (i)
- {
- completed.push(progress[i]);
- completed_counter ++ ;
- var count ;in_progress_counter-- ;
- for (count = i ; count < in_progress_counter ; count++)
- {
- progress[count].date=progress[count+1].date ;
- progress[count].description=progress[count+1].description ;
- progress[count].name=progress[count+1].name ;
- progress[count].status=progress[count+1].status ;
- }
- drawprogress();
- }
- function PtoA (i)
- {
- arch.push(progress[i]);
- arch_counter++ ;
- var count ;in_progress_counter-- ;
- for (count = i ; count < in_progress_counter ; count++)
- {
- progress[count].date=progress[count+1].date ;
- progress[count].description=progress[count+1].description ;
- progress[count].name=progress[count+1].name ;
- progress[count].status=progress[count+1].status ;
- }
- drawprogress();
- }
- function AtoP (i)
- {
- progress.push(arch[i]);
- progress_counter++ ;
- var count ;arch_counter-- ;
- for (count = i ; count < arch_counter ; count++)
- {
- arch[count].date=arch[count+1].date ;
- arch[count].description=arch[count+1].description ;
- arch[count].name=arch[count+1].name ;
- arch[count].status=arch[count+1].status ;
- }
- drawarch();
- }
- function AtoC (i)
- {
- completed.push(arch[i]);
- completed_counter++ ;
- var count ;arch_counter-- ;
- for (count = i ; count < arch_counter ; count++)
- {
- arch[count].date=arch[count+1].date ;
- arch[count].description=arch[count+1].description ;
- arch[count].name=arch[count+1].name ;
- arch[count].status=arch[count+1].status ;
- }
- drawarch();
- }
- function drawall()
- { if(all_tasks_counter == 0 )
- {
- var text = "<tr>";
- text += "<td></td>";
- text += "<td>" + "NO TASKS" + "</td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "</tr>";
- document.getElementById("pagee").innerHTML = text;
- }
- else{
- var text ="<table>";
- for(i = 0; i< all_tasks_counter; i++){
- text += "<tr>";
- text += "<td><input type=\"checkbox\" id=\"all[i].status\" + i></td>";
- text += "<td>" + (i+1) + "</td>";
- text += "<td>"+all[i].name + "</td>";
- text += "<td>"+all[i].date + "</td>";
- text += "<td><button>Edit Task</button><button>Delete Task</button><button>Archive Task</button><button>Mark As Completed</button></td>";
- text += "</tr>";
- }
- text +="</table>";
- document.getElementById("pagee").innerHTML = text;
- document.getElementById("allnumber").innerHTML = all_tasks_counter;
- document.getElementById("progressnumber").innerHTML = in_progress_counter;
- document.getElementById("completednumber").innerHTML = completed_counter;
- document.getElementById("archnumber").innerHTML = arch_counter;
- }
- }
- function drawcompleted(){
- if(completed_counter == 0 )
- {
- var text = "<tr>";
- text += "<td></td>";
- text += "<td>" + "NO TASKS" + "</td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "</tr>";
- document.getElementById("pagee").innerHTML = text;
- }
- else{ var text ="<table>";
- for(i = 0; i< completed_counter; i++){
- text = "<tr>";
- text += "<td> <input type=\"checkbox\" id=\"completed[i].status\" + i></td>";
- text += "<td>" + (i+1) + "</td>";
- text += "<td>"+completed[i].name + "</td>";
- text += "<td>"+completed[i].date + "</td>";
- text += "<td><button>Edit Task</button><button>Delete Task</button><button onclick = \"CtoA("+i+")\">Archive Task</button><button onclick =\"CtoP("+i+")\">In Progress</button></td>";
- text += "</tr>"; }
- text +="</table>";
- document.getElementById("pagee").innerHTML = text;
- document.getElementById("allnumber").innerHTML = all_tasks_counter;
- document.getElementById("progressnumber").innerHTML = in_progress_counter;
- document.getElementById("completednumber").innerHTML = completed_counter;
- document.getElementById("archnumber").innerHTML = arch_counter;
- }
- }
- // var x ;
- // function PtoC (x)
- // {
- // var y=x;
- // completed.push(progress[y]);
- // completed_counter++ ;
- // PtoC2 ();
- // }
- // function PtoC2()
- // {
- // var count ;
- // in_progress_counter-- ;
- // for (count = x ; count < in_progress_counter ; count++)
- // {
- // progress[count].date=progress[count+1].date ;
- // progress[count].description=progress[count+1].description ;
- // progress[count].name=progress[count+1].name ;
- // progress[count].status=progress[count+1].status ;
- // }
- // progress.splice(x,1);
- // drawprogress();
- // }
- function drawarch()
- { if(arch_counter == 0 )
- {
- var text = "<tr>";
- text += "<td></td>";
- text += "<td>" + "NO TASKS" + "</td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "</tr>";
- document.getElementById("pagee").innerHTML = text;
- }
- else{
- var text ="<table>";
- for(i = 0; i< arch_counter; i++){
- text = "<tr>";
- text += "<td><input type=\"checkbox\" id=\"arch[i].status\" + i></td>";
- text += "<td>" + (i+1) + "</td>";
- text += "<td>"+arch.name + "</td>";
- text += "<td>"+arch.date + "</td>";
- text += "<td><button>Edit Task</button><button>Delete Task</button><button onclick = \"AtoC("+i+")\">Mark As Completed</button><button onclick = \"AtoP("+i+")\">In Progress</button></td>";
- text += "</tr>"; }
- text +="</table>";
- document.getElementById("pagee").innerHTML = text;
- document.getElementById("allnumber").innerHTML = all_tasks_counter;
- document.getElementById("progressnumber").innerHTML = in_progress_counter;
- document.getElementById("completednumber").innerHTML = completed_counter;
- document.getElementById("archnumber").innerHTML = arch_counter;
- }
- }
- function drawprogress()
- { if(in_progress_counter == 0 )
- {
- var text = "<tr>";
- text += "<td></td>";
- text += "<td>" + "NO TASKS" + "</td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "<td></td>";
- text += "</tr>";
- document.getElementById("pagee").innerHTML = text;
- }
- else{
- var text ="<table>";
- for(i = 0; i< in_progress_counter; i++){
- text += "<tr>";
- text += "<td><input type=\"checkbox\" id=\"progress[i].status\" + i></td>";
- text += "<td>" + (i+1) + "</td>";
- text += "<td>"+progress[i].name + "</td>";
- text += "<td>"+progress[i].date + "</td>";
- text += "<td><button>Edit Task</button><button>Delete Task</button><button onclick = \"PtoA("+i+")\">Archive Task</button><button onclick = \"PtoC("+i+")\">Mark As Completed</button></td>";
- text += "</tr>"; }
- text +="</table>";
- document.getElementById("pagee").innerHTML = text;
- document.getElementById("allnumber").innerHTML = all_tasks_counter;
- document.getElementById("progressnumber").innerHTML = in_progress_counter;
- document.getElementById("completednumber").innerHTML = completed_counter;
- document.getElementById("archnumber").innerHTML = arch_counter;
- }
- }
- $(function(){
- $.datepicker.setDefaults(
- $.extend( $.datepicker.regional[ '' ] )
- );
- $( '#datepicker' ).datepicker();
- });
- </script>
- <style>
- table#one td , td {
- width : 100 % ;
- left-side : 100 % ;
- margin-right : 80% ;
- margin-top : 80% ;
- border : 1px solid black;
- border-collapse: collapse;
- table-layout:fixed;
- }
- td, td {
- padding: 45px;
- }
- <style>
- fieldset {
- border: 0;
- }
- label {
- display: block;
- margin: 30px 0 0 0;
- }
- select {
- width: 200px;
- }
- .overflow {
- height: 200px;
- }
- </style>
- </style>
- </head>
- <body>
- <div class="container-fluid" style="background-color:#B28AB2" >
- <h1 style="font-size:20px;"><strong>ToDoList</h1>
- <p style="font-size:20px;"> <strong>helps you manage your time</p>
- <div class="row">
- <div class="col-sm-4" style="background-color:lavender; height : 1000px ;width:400px">
- <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
- <button id="Rbutton1" name="choose action" onclick="drawall()" value="(1) All Tasks"><label style ="font-size : 20px;width:200px"> All Tasks </label><strong><p id="allnumber" style ="font-size : 20px;"></p></button>
- <br>
- <br>
- <button id="Rbutton2" name="choose action" onclick="drawprogress()" value="(2) In Progress"> <label style ="font-size : 20px; width:200px "> In Progress </label> <p id="progressnumber" style ="font-size : 20px;"></p></button>
- <br>
- <br>
- <button id="Rbutton3" name="choose action" onclick="drawcompleted()" value="(3) Completed Tasks"> <label style ="font-size : 20px;width:200px "> Completed Tasks </label> <p id="completednumber" style ="font-size : 20px;"></p></button>
- <br>
- <br>
- <button id="Rbutton4" name="choose action" onclick="drawarch()" value="(4) Archived"> <label style ="font-size : 20px; width:200px"> Archived</label><p id="archnumber" style ="font-size : 20px;"></p> </button>
- </div>
- <div class="col-sm-8" style="background-color:lavenderblush; height : 1000px ; width : 1500px">
- <br><br>
- <table id="page"></table>
- <br>
- <br>
- <div id="users-contain" class="ui-widget">
- <h1 id="heading" style="font-size :20px"></h1>
- <table id="users" class="ui-widget ui-widget-content" style= "width:1250px ; font-size : 20px">
- <thead>
- <tr class="ui-widget-header ">
- <th></th>
- <th>ID</th>
- <th>Task name</th>
- <th>Date</th>
- <th>options</th>
- </tr>
- </thead>
- <tbody id="pagee" >
- </tbody>
- </table>
- <button id="addbutton" type="button" class="btn btn-default" onclick="show()" ; style = "background-color: #D96C77; font-size : 30px;">+ Add Task </button>
- <div id="dialog" class="container" style="display:none; font-size:20px">
- <label for="task">Task</label>
- <input type="text" name="task" id="task" >
- <label for="date">Date</label>
- <input type="text" name="date" id="datepicker" >
- <label for="description">Description</label>
- <textarea id="description" rows="4" cols="30" ></textarea>
- <input id= "submit" onclick="add()" type="submit"></input>
- </div>
- </div>
- </div>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement